i2bill.api 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. syntax = "v1"
  2. info(
  3. title: // TODO: add title
  4. desc: // TODO: add description
  5. author: "double.huang"
  6. email: "2637309949@qq.com"
  7. )
  8. type PageResult {
  9. Page int `json:"page"`
  10. Rows int `json:"rows"`
  11. TotalSize int64 `json:"totalSize"`
  12. TotalPageSize int64 `json:"totalPageSize"`
  13. Content []map[string]interface{} `json:"content"`
  14. }
  15. type WXLoginResponse {
  16. OpenID string `json:"openid"`
  17. SessionKey string `json:"session_key"`
  18. UnionID string `json:"unionid"`
  19. ErrCode int `json:"errcode"`
  20. ErrMsg string `json:"errmsg"`
  21. }
  22. type Watermark {
  23. AppID string `json:"appid"`
  24. TimeStamp int64 `json:"timestamp"`
  25. }
  26. type WXUserInfo {
  27. OpenID string `json:"openId,omitempty"`
  28. SessionKey string `json:"SessionKey"`
  29. NickName string `json:"nickName"`
  30. AvatarUrl string `json:"avatarUrl"`
  31. Gender int64 `json:"gender"`
  32. Country string `json:"country"`
  33. Province string `json:"province"`
  34. City string `json:"city"`
  35. UnionID string `json:"unionId,omitempty"`
  36. Language string `json:"language"`
  37. Watermark Watermark `json:"watermark,omitempty"`
  38. }
  39. type ResUserInfo {
  40. UserInfo WXUserInfo `json:"userInfo"`
  41. RawData string `json:"rawData"`
  42. Signature string `json:"signature"`
  43. EncryptedData string `json:"encryptedData"`
  44. IV string `json:"iv"`
  45. }
  46. type loginByWeixinRequest {
  47. Code string `json:"code"`
  48. // UserInfo ResUserInfo `json:"userInfo"`
  49. }
  50. type AuthUserInfo {
  51. ID int64 `json:"id"`
  52. Mobile string `json:"mobile"`
  53. UserName string `json:"username"`
  54. NickName string `json:"nickname"`
  55. Gender int64 `json:"gender"`
  56. Avatar string `json:"avatar"`
  57. Birthday int64 `json:"birthday"`
  58. ErpRoleType int64 `json:"erp_role_type"`
  59. ErpRole string `json:"erp_role"`
  60. MkId string `json:"mk_id"`
  61. }
  62. type loginByWeixinResponse {
  63. Token string `json:"token"`
  64. UserInfo AuthUserInfo `json:"userInfo"`
  65. }
  66. type jzQrcodeResponse {
  67. Id int64 `json:"id"`
  68. FileId string `json:"fileId"`
  69. }
  70. type bindMobileRequest {
  71. Iv string `json:"iv"`
  72. EncryptedData string `json:"encryptedData"`
  73. }
  74. type bindMobileResponse {
  75. Id int64 `json:"id"`
  76. }
  77. type partTimeUserAddRequest {
  78. Name string `json:"name"`
  79. IponeNumber string `json:"ipone_number"`
  80. Sex int64 `json:"sex"`
  81. MkId string `json:"mk_id"`
  82. CityId int64 `json:"city_id"` // 城市
  83. }
  84. type infoResponse {
  85. ID int64 `json:"id"`
  86. Mobile string `json:"mobile"`
  87. UserName string `json:"username"`
  88. CityName string `json:"cityname"`
  89. NickName string `json:"nickname"`
  90. Gender int64 `json:"gender"`
  91. Avatar string `json:"avatar"`
  92. Birthday int64 `json:"birthday"`
  93. ErpRoleType int64 `json:"erpRoleType"`
  94. }
  95. type punchClockRequest {
  96. Lat string `json:"lat"`
  97. Address string `json:"address"`
  98. Type int64 `json:"type"`
  99. }
  100. type enrollRequest {
  101. Scene string `json:"scene"`
  102. Name string `json:"name"`
  103. ContactName string `json:"contactName"`
  104. ContactPhone string `json:"contactPhone"`
  105. SchId int64 `json:"schId"`
  106. Location string `json:"location"`
  107. }
  108. type enrollAddReq {
  109. StuName string `json:"stu_name"`
  110. AgeGroup int `json:"age_group,optional"`
  111. StuLinkPerson int `json:"stu_link_person"`
  112. StuPhone string `json:"stu_phone"`
  113. SchId int `json:"sch_id,optional"`
  114. Address string `json:"address"`
  115. Sign string `json:"sign"`
  116. }
  117. type Response {
  118. Code int `json:"code"`
  119. Msg string `json:"msg"`
  120. Data interface{} `json:"data"`
  121. }
  122. type GetErpOptionsetReq {
  123. Code string `json:"code"`
  124. }
  125. // 认证模块
  126. @server(
  127. group: auth
  128. )
  129. service i2bill-api {
  130. @handler Hello
  131. get /api/hello
  132. @handler LoginByWeixin
  133. post /api/auth/loginByWeixin(loginByWeixinRequest) returns(loginByWeixinResponse)
  134. }
  135. // 用户模块
  136. @server(
  137. jwt: JwtAuth
  138. group: user
  139. )
  140. service i2bill-api {
  141. @handler JzQrCode
  142. get /api/user/share/jzQrcode returns(jzQrcodeResponse)
  143. @handler BindMobile
  144. post /api/user/bindMobile(bindMobileRequest) returns(Response)
  145. @handler GetUser
  146. get /api/user/info returns(infoResponse)
  147. @handler UpdateUser
  148. post /api/user/update returns(Response)
  149. @handler PunchClock
  150. post /api/user/punchClock(punchClockRequest) returns(Response)
  151. @handler PunchClockPage
  152. get /api/user/punchClock/page returns(Response)
  153. @handler PunchClockGet
  154. get /api/user/punchClock/get_to_day returns(Response)
  155. }
  156. // 兼职模块
  157. @server(
  158. jwt: JwtAuth
  159. group: mkt_part_time_user
  160. )
  161. service i2bill-api {
  162. @handler MktPartTimeUserAdd
  163. post /api/v1/part_time_user/add (partTimeUserAddRequest) returns(Response)
  164. @handler MktPartTimeUserUpdate
  165. post /api/v1/part_time_user/update (partTimeUserAddRequest) returns(Response)
  166. @handler MktPartTimeUserGet
  167. get /api/v1/part_time_user/get returns(Response)
  168. }
  169. @server(
  170. group: mkt_qr
  171. )
  172. service i2bill-api {
  173. @handler MktQrAdd
  174. post /api/v1/mkt_qr/add returns(Response)
  175. @handler MktQrGet
  176. get /api/v1/mkt_qr/get returns(Response)
  177. }
  178. // 收单模块
  179. @server(
  180. jwt: JwtAuth
  181. group: acquirer
  182. )
  183. service i2bill-api {
  184. @handler Enroll
  185. post /api/acquirer/enroll(enrollRequest) returns(Response)
  186. }
  187. @server(
  188. jwt: JwtAuth
  189. group: acquirer_student
  190. )
  191. service i2bill-api{
  192. @handler AcquirerStudentPage
  193. get /api/v1/acquirer_student/page returns(Response)
  194. @handler AcquirerStudentTotal
  195. get /api/v1/acquirer_student/total returns(Response)
  196. @handler AcquirerStudentRemark
  197. post /api/v1/acquirer_student/remark returns(Response)
  198. }
  199. @server(
  200. group: acquirer_student
  201. )
  202. service i2bill-api {
  203. @handler AcquirerStudentAdd
  204. post /api/v1/acquirer_student/add(enrollAddReq) returns(Response)
  205. }
  206. //收单二维码
  207. @server(
  208. jwt: JwtAuth
  209. group: acquirer_mkt_qr
  210. )
  211. service i2bill-api {
  212. @handler AcquirerMktQrUpdate
  213. post /api/v1/acquirer_mkt_qr/update returns(Response)
  214. @handler AcquirerMktQrGet
  215. get /api/v1/acquirer_mkt_qr/get returns(Response)
  216. }
  217. //系统
  218. @server(
  219. jwt: JwtAuth
  220. group: system
  221. )
  222. service i2bill-api {
  223. @handler SystemFileUpload
  224. post /api/v1/system_file/upload returns(Response)
  225. @handler SystemFileDownload
  226. get /api/v1/system_file/download returns(Response)
  227. }
  228. // 城市树
  229. @server(
  230. jwt: JwtAuth
  231. group: base_organ
  232. )
  233. service i2bill-api{
  234. @handler GetErpCityTree
  235. get /api/v1/base_organ/get_erp_city_tree returns(Response)
  236. }
  237. //erp 字典
  238. @server(
  239. jwt: JwtAuth
  240. group: sys_optionset
  241. )
  242. service i2bill-api{
  243. @handler GetErpOptionset
  244. get /api/v1/sys_optionset/get_erp_optionset returns(Response)
  245. }
  246. //erp 渠道细分
  247. @server(
  248. jwt: JwtAuth
  249. group: mkt_network_detail
  250. )
  251. service i2bill-api{
  252. @handler GetErpMktNetworkDetail
  253. get /api/v1/mkt_network_detail/get_erp_mkt_network_detail returns(Response)
  254. }
  255. //erp 收单资源校区
  256. @server(
  257. jwt: JwtAuth
  258. group: base_organ_school
  259. )
  260. service i2bill-api{
  261. @handler GetErpSchPerm
  262. get /api/v1/base_organ_school/get_erp_sch_perm returns(Response)
  263. @handler GetErpSchTree
  264. get /api/v1/base_organ_school/get_organ_school_tree returns(Response)
  265. }
  266. //erp 校区活动
  267. @server(
  268. jwt: JwtAuth
  269. group: mkt_active
  270. )
  271. service i2bill-api{
  272. @handler GetErpMktActive
  273. get /api/v1/mkt_active/get_erp_mkt_active returns(Response)
  274. }