i2bill.api 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. Remark string `json:"remark"`
  117. }
  118. type Response {
  119. Code int `json:"code"`
  120. Msg string `json:"msg"`
  121. Data interface{} `json:"data"`
  122. }
  123. type GetErpOptionsetReq {
  124. Code string `json:"code"`
  125. }
  126. // 认证模块
  127. @server(
  128. group: auth
  129. )
  130. service i2bill-api {
  131. @handler Hello
  132. get /api/hello
  133. @handler LoginByWeixin
  134. post /api/auth/loginByWeixin(loginByWeixinRequest) returns(loginByWeixinResponse)
  135. }
  136. // 用户模块
  137. @server(
  138. jwt: JwtAuth
  139. group: user
  140. )
  141. service i2bill-api {
  142. @handler JzQrCode
  143. get /api/user/share/jzQrcode returns(jzQrcodeResponse)
  144. @handler BindMobile
  145. post /api/user/bindMobile(bindMobileRequest) returns(Response)
  146. @handler GetUser
  147. get /api/user/info returns(infoResponse)
  148. @handler UpdateUser
  149. post /api/user/update returns(Response)
  150. @handler PunchClock
  151. post /api/user/punchClock(punchClockRequest) returns(Response)
  152. @handler PunchClockPage
  153. get /api/user/punchClock/page returns(Response)
  154. @handler PunchClockGet
  155. get /api/user/punchClock/get_to_day returns(Response)
  156. }
  157. // 兼职模块
  158. @server(
  159. jwt: JwtAuth
  160. group: mkt_part_time_user
  161. )
  162. service i2bill-api {
  163. @handler MktPartTimeUserAdd
  164. post /api/v1/part_time_user/add (partTimeUserAddRequest) returns(Response)
  165. @handler MktPartTimeUserUpdate
  166. post /api/v1/part_time_user/update (partTimeUserAddRequest) returns(Response)
  167. @handler MktPartTimeUserGet
  168. get /api/v1/part_time_user/get returns(Response)
  169. }
  170. @server(
  171. group: mkt_qr
  172. )
  173. service i2bill-api {
  174. @handler MktQrAdd
  175. post /api/v1/mkt_qr/add returns(Response)
  176. @handler MktQrGet
  177. get /api/v1/mkt_qr/get returns(Response)
  178. }
  179. // 收单模块
  180. @server(
  181. jwt: JwtAuth
  182. group: acquirer
  183. )
  184. service i2bill-api {
  185. @handler Enroll
  186. post /api/acquirer/enroll(enrollRequest) returns(Response)
  187. }
  188. @server(
  189. jwt: JwtAuth
  190. group: acquirer_student
  191. )
  192. service i2bill-api{
  193. @handler AcquirerStudentPage
  194. get /api/v1/acquirer_student/page returns(Response)
  195. @handler AcquirerStudentTotal
  196. get /api/v1/acquirer_student/total returns(Response)
  197. @handler AcquirerStudentRemark
  198. post /api/v1/acquirer_student/remark returns(Response)
  199. }
  200. @server(
  201. group: acquirer_student
  202. )
  203. service i2bill-api {
  204. @handler AcquirerStudentAdd
  205. post /api/v1/acquirer_student/add(enrollAddReq) returns(Response)
  206. }
  207. //收单二维码
  208. @server(
  209. jwt: JwtAuth
  210. group: acquirer_mkt_qr
  211. )
  212. service i2bill-api {
  213. @handler AcquirerMktQrUpdate
  214. post /api/v1/acquirer_mkt_qr/update returns(Response)
  215. @handler AcquirerMktQrGet
  216. get /api/v1/acquirer_mkt_qr/get returns(Response)
  217. }
  218. //系统
  219. @server(
  220. jwt: JwtAuth
  221. group: system
  222. )
  223. service i2bill-api {
  224. @handler SystemFileUpload
  225. post /api/v1/system_file/upload returns(Response)
  226. @handler SystemFileDownload
  227. get /api/v1/system_file/download returns(Response)
  228. }
  229. // 城市树
  230. @server(
  231. jwt: JwtAuth
  232. group: base_organ
  233. )
  234. service i2bill-api{
  235. @handler GetErpCityTree
  236. get /api/v1/base_organ/get_erp_city_tree returns(Response)
  237. }
  238. //erp 字典
  239. @server(
  240. jwt: JwtAuth
  241. group: sys_optionset
  242. )
  243. service i2bill-api{
  244. @handler GetErpOptionset
  245. get /api/v1/sys_optionset/get_erp_optionset returns(Response)
  246. }
  247. //erp 渠道细分
  248. @server(
  249. jwt: JwtAuth
  250. group: mkt_network_detail
  251. )
  252. service i2bill-api{
  253. @handler GetErpMktNetworkDetail
  254. get /api/v1/mkt_network_detail/get_erp_mkt_network_detail returns(Response)
  255. }
  256. //erp 收单资源校区
  257. @server(
  258. jwt: JwtAuth
  259. group: base_organ_school
  260. )
  261. service i2bill-api{
  262. @handler GetErpSchPerm
  263. get /api/v1/base_organ_school/get_erp_sch_perm returns(Response)
  264. @handler GetErpSchTree
  265. get /api/v1/base_organ_school/get_organ_school_tree returns(Response)
  266. }
  267. //erp 校区活动
  268. @server(
  269. jwt: JwtAuth
  270. group: mkt_active
  271. )
  272. service i2bill-api{
  273. @handler GetErpMktActive
  274. get /api/v1/mkt_active/get_erp_mkt_active returns(Response)
  275. }