routes.go 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. ChatRoomMember "wechat-api/internal/handler/ChatRoomMember"
  6. Message "wechat-api/internal/handler/Message"
  7. Msg "wechat-api/internal/handler/Msg"
  8. UsageDetail "wechat-api/internal/handler/UsageDetail"
  9. UsageTotal "wechat-api/internal/handler/UsageTotal"
  10. User "wechat-api/internal/handler/User"
  11. WechatServer "wechat-api/internal/handler/WechatServer"
  12. WorkPhone "wechat-api/internal/handler/WorkPhone"
  13. Wx "wechat-api/internal/handler/Wx"
  14. Wxhook "wechat-api/internal/handler/Wxhook"
  15. agent "wechat-api/internal/handler/agent"
  16. agent_base "wechat-api/internal/handler/agent_base"
  17. aliyun_avatar "wechat-api/internal/handler/aliyun_avatar"
  18. allocagent "wechat-api/internal/handler/allocagent"
  19. avatar "wechat-api/internal/handler/avatar"
  20. base "wechat-api/internal/handler/base"
  21. batch_msg "wechat-api/internal/handler/batch_msg"
  22. category "wechat-api/internal/handler/category"
  23. chatrecords "wechat-api/internal/handler/chatrecords"
  24. chatsession "wechat-api/internal/handler/chatsession"
  25. contact "wechat-api/internal/handler/contact"
  26. credit_balance "wechat-api/internal/handler/credit_balance"
  27. credit_usage "wechat-api/internal/handler/credit_usage"
  28. dashboard "wechat-api/internal/handler/dashboard"
  29. employee "wechat-api/internal/handler/employee"
  30. employee_config "wechat-api/internal/handler/employee_config"
  31. label "wechat-api/internal/handler/label"
  32. label_relationship "wechat-api/internal/handler/label_relationship"
  33. label_tagging "wechat-api/internal/handler/label_tagging"
  34. message_records "wechat-api/internal/handler/message_records"
  35. openapi "wechat-api/internal/handler/openapi"
  36. pay_recharge "wechat-api/internal/handler/pay_recharge"
  37. sop_node "wechat-api/internal/handler/sop_node"
  38. sop_stage "wechat-api/internal/handler/sop_stage"
  39. sop_task "wechat-api/internal/handler/sop_task"
  40. token "wechat-api/internal/handler/token"
  41. tutorial "wechat-api/internal/handler/tutorial"
  42. whatsapp "wechat-api/internal/handler/whatsapp"
  43. whatsapp_channel "wechat-api/internal/handler/whatsapp_channel"
  44. work_experience "wechat-api/internal/handler/work_experience"
  45. wp_wecom "wechat-api/internal/handler/wp_wecom"
  46. wxcard "wechat-api/internal/handler/wxcard"
  47. wxcarduser "wechat-api/internal/handler/wxcarduser"
  48. wxcardvisit "wechat-api/internal/handler/wxcardvisit"
  49. xiaoice "wechat-api/internal/handler/xiaoice"
  50. xunji "wechat-api/internal/handler/xunji"
  51. "wechat-api/internal/svc"
  52. "github.com/zeromicro/go-zero/rest"
  53. )
  54. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  55. server.AddRoutes(
  56. []rest.Route{
  57. {
  58. Method: http.MethodGet,
  59. Path: "/init/database",
  60. Handler: base.InitDatabaseHandler(serverCtx),
  61. },
  62. },
  63. )
  64. server.AddRoutes(
  65. rest.WithMiddlewares(
  66. []rest.Middleware{serverCtx.Authority},
  67. []rest.Route{
  68. {
  69. Method: http.MethodPost,
  70. Path: "/server/create",
  71. Handler: WechatServer.CreateServerHandler(serverCtx),
  72. },
  73. {
  74. Method: http.MethodPost,
  75. Path: "/server/update",
  76. Handler: WechatServer.UpdateServerHandler(serverCtx),
  77. },
  78. {
  79. Method: http.MethodPost,
  80. Path: "/server/delete",
  81. Handler: WechatServer.DeleteServerHandler(serverCtx),
  82. },
  83. {
  84. Method: http.MethodPost,
  85. Path: "/server/list",
  86. Handler: WechatServer.GetServerListHandler(serverCtx),
  87. },
  88. {
  89. Method: http.MethodPost,
  90. Path: "/server",
  91. Handler: WechatServer.GetServerByIdHandler(serverCtx),
  92. },
  93. }...,
  94. ),
  95. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  96. )
  97. server.AddRoutes(
  98. rest.WithMiddlewares(
  99. []rest.Middleware{serverCtx.Authority},
  100. []rest.Route{
  101. {
  102. Method: http.MethodPost,
  103. Path: "/wx/create",
  104. Handler: Wx.CreateWxHandler(serverCtx),
  105. },
  106. {
  107. Method: http.MethodPost,
  108. Path: "/wx/check",
  109. Handler: Wx.CheckWxHandler(serverCtx),
  110. },
  111. {
  112. Method: http.MethodPost,
  113. Path: "/wx/update",
  114. Handler: Wx.UpdateWxHandler(serverCtx),
  115. },
  116. {
  117. Method: http.MethodPost,
  118. Path: "/wx/updateBlockAndAllowList",
  119. Handler: Wx.UpdateBlockAndAllowListHandler(serverCtx),
  120. },
  121. {
  122. Method: http.MethodPost,
  123. Path: "/wx/delete",
  124. Handler: Wx.DeleteWxHandler(serverCtx),
  125. },
  126. {
  127. Method: http.MethodPost,
  128. Path: "/wx/list",
  129. Handler: Wx.GetWxListHandler(serverCtx),
  130. },
  131. {
  132. Method: http.MethodPost,
  133. Path: "/wx/selectList",
  134. Handler: Wx.GetSelectWxListHandler(serverCtx),
  135. },
  136. {
  137. Method: http.MethodPost,
  138. Path: "/wx/getWxAllowBlockList",
  139. Handler: Wx.GetWxAllowBlockListHandler(serverCtx),
  140. },
  141. {
  142. Method: http.MethodPost,
  143. Path: "/wx",
  144. Handler: Wx.GetWxByIdHandler(serverCtx),
  145. },
  146. }...,
  147. ),
  148. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  149. )
  150. server.AddRoutes(
  151. rest.WithMiddlewares(
  152. []rest.Middleware{serverCtx.Authority},
  153. []rest.Route{
  154. {
  155. Method: http.MethodPost,
  156. Path: "/agent/data/batchDelete",
  157. Handler: agent.BatchDeleteAgentDataHandler(serverCtx),
  158. },
  159. {
  160. Method: http.MethodPost,
  161. Path: "/agent/data/upload",
  162. Handler: agent.UploadAgentDataHandler(serverCtx),
  163. },
  164. {
  165. Method: http.MethodPost,
  166. Path: "/agent/create",
  167. Handler: agent.CreateAgentHandler(serverCtx),
  168. },
  169. {
  170. Method: http.MethodPost,
  171. Path: "/agent/update",
  172. Handler: agent.UpdateAgentHandler(serverCtx),
  173. },
  174. {
  175. Method: http.MethodPost,
  176. Path: "/agent/delete",
  177. Handler: agent.DeleteAgentHandler(serverCtx),
  178. },
  179. {
  180. Method: http.MethodPost,
  181. Path: "/agent/list",
  182. Handler: agent.GetAgentListHandler(serverCtx),
  183. },
  184. {
  185. Method: http.MethodPost,
  186. Path: "/agent",
  187. Handler: agent.GetAgentByIdHandler(serverCtx),
  188. },
  189. {
  190. Method: http.MethodPost,
  191. Path: "/agent/collection/list",
  192. Handler: agent.GetAgentCollectionListHandler(serverCtx),
  193. },
  194. {
  195. Method: http.MethodPost,
  196. Path: "/agent/collection/detail",
  197. Handler: agent.GetAgentCollectionInfoHandler(serverCtx),
  198. },
  199. {
  200. Method: http.MethodPost,
  201. Path: "/agent/data/list",
  202. Handler: agent.GetAgentDataListHandler(serverCtx),
  203. },
  204. {
  205. Method: http.MethodPost,
  206. Path: "/agent/data/detail",
  207. Handler: agent.GetAgentDataDetailHandler(serverCtx),
  208. },
  209. {
  210. Method: http.MethodPost,
  211. Path: "/agent/data/create",
  212. Handler: agent.CreateAgentDataHandler(serverCtx),
  213. },
  214. {
  215. Method: http.MethodPost,
  216. Path: "/agent/data/update",
  217. Handler: agent.UpdateAgentDataHandler(serverCtx),
  218. },
  219. {
  220. Method: http.MethodPost,
  221. Path: "/agent/data/delete",
  222. Handler: agent.DeleteAgentDataHandler(serverCtx),
  223. },
  224. }...,
  225. ),
  226. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  227. )
  228. server.AddRoutes(
  229. rest.WithMiddlewares(
  230. []rest.Middleware{serverCtx.Authority},
  231. []rest.Route{
  232. {
  233. Method: http.MethodPost,
  234. Path: "/label_relationship/create",
  235. Handler: label_relationship.CreateLabelRelationshipHandler(serverCtx),
  236. },
  237. {
  238. Method: http.MethodPost,
  239. Path: "/label_relationship/update",
  240. Handler: label_relationship.UpdateLabelRelationshipHandler(serverCtx),
  241. },
  242. {
  243. Method: http.MethodPost,
  244. Path: "/label_relationship/update_contact_labels",
  245. Handler: label_relationship.UpdateLabelRelationshipsHandler(serverCtx),
  246. },
  247. {
  248. Method: http.MethodPost,
  249. Path: "/label_relationship/batch_update_contact_labels",
  250. Handler: label_relationship.BatchUpdateLabelRelationshipsHandler(serverCtx),
  251. },
  252. {
  253. Method: http.MethodPost,
  254. Path: "/label_relationship/delete",
  255. Handler: label_relationship.DeleteLabelRelationshipHandler(serverCtx),
  256. },
  257. {
  258. Method: http.MethodPost,
  259. Path: "/label_relationship/list",
  260. Handler: label_relationship.GetLabelRelationshipListHandler(serverCtx),
  261. },
  262. {
  263. Method: http.MethodPost,
  264. Path: "/label_relationship",
  265. Handler: label_relationship.GetLabelRelationshipByIdHandler(serverCtx),
  266. },
  267. {
  268. Method: http.MethodPost,
  269. Path: "/label_relationship/setWhatsappContactLabel",
  270. Handler: label_relationship.SetWhatsappContactLabelHandler(serverCtx),
  271. },
  272. {
  273. Method: http.MethodPost,
  274. Path: "/label_relationship/setWhatsappContactBatchLabel",
  275. Handler: label_relationship.SetWhatsappContactBatchLabelHandler(serverCtx),
  276. },
  277. }...,
  278. ),
  279. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  280. )
  281. server.AddRoutes(
  282. []rest.Route{
  283. {
  284. Method: http.MethodPost,
  285. Path: "/wxhook/sendTextMsg",
  286. Handler: Wxhook.SendTextMsgHandler(serverCtx),
  287. },
  288. },
  289. )
  290. server.AddRoutes(
  291. rest.WithMiddlewares(
  292. []rest.Middleware{serverCtx.Authority},
  293. []rest.Route{
  294. {
  295. Method: http.MethodPost,
  296. Path: "/wxhook/refreshLoginQR",
  297. Handler: Wxhook.RefreshLoginQRHandler(serverCtx),
  298. },
  299. {
  300. Method: http.MethodPost,
  301. Path: "/wxhook/logout",
  302. Handler: Wxhook.LogoutHandler(serverCtx),
  303. },
  304. {
  305. Method: http.MethodPost,
  306. Path: "/wxhook/terminateThisWeChat",
  307. Handler: Wxhook.TerminateThisWeChatHandler(serverCtx),
  308. },
  309. {
  310. Method: http.MethodPost,
  311. Path: "/wxhook/getFriendsAndGroups",
  312. Handler: Wxhook.GetFriendsAndGroupsHandler(serverCtx),
  313. },
  314. {
  315. Method: http.MethodPost,
  316. Path: "/wxhook/sendPicMsg",
  317. Handler: Wxhook.SendPicMsgHandler(serverCtx),
  318. },
  319. {
  320. Method: http.MethodPost,
  321. Path: "/wxhook/sendPicMsgLocal",
  322. Handler: Wxhook.SendPicMsgLocalHandler(serverCtx),
  323. },
  324. }...,
  325. ),
  326. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  327. )
  328. server.AddRoutes(
  329. rest.WithMiddlewares(
  330. []rest.Middleware{serverCtx.Authority},
  331. []rest.Route{
  332. {
  333. Method: http.MethodPost,
  334. Path: "/contact/create",
  335. Handler: contact.CreateContactHandler(serverCtx),
  336. },
  337. {
  338. Method: http.MethodPost,
  339. Path: "/contact/update",
  340. Handler: contact.UpdateContactHandler(serverCtx),
  341. },
  342. {
  343. Method: http.MethodPost,
  344. Path: "/contact/delete",
  345. Handler: contact.DeleteContactHandler(serverCtx),
  346. },
  347. {
  348. Method: http.MethodPost,
  349. Path: "/contact/list",
  350. Handler: contact.GetContactListHandler(serverCtx),
  351. },
  352. {
  353. Method: http.MethodPost,
  354. Path: "/contact",
  355. Handler: contact.GetContactByIdHandler(serverCtx),
  356. },
  357. {
  358. Method: http.MethodPost,
  359. Path: "/contact/addNewFriend",
  360. Handler: contact.AddNewFriendHandler(serverCtx),
  361. },
  362. {
  363. Method: http.MethodPost,
  364. Path: "/contact/changeBlockList",
  365. Handler: contact.ChangeBlockListHandler(serverCtx),
  366. },
  367. {
  368. Method: http.MethodPost,
  369. Path: "/contact/importWhatsappContact",
  370. Handler: contact.ImportWhatsappContactHandler(serverCtx),
  371. },
  372. {
  373. Method: http.MethodPost,
  374. Path: "/contact/getWhatsappContactList",
  375. Handler: contact.GetWhatsappContactListHandler(serverCtx),
  376. },
  377. {
  378. Method: http.MethodPost,
  379. Path: "/contact/createWhatsappContact",
  380. Handler: contact.CreateWhatsappContactHandler(serverCtx),
  381. },
  382. {
  383. Method: http.MethodPost,
  384. Path: "/contact/updateWhatsappContact",
  385. Handler: contact.UpdateWhatsappContactHandler(serverCtx),
  386. },
  387. {
  388. Method: http.MethodPost,
  389. Path: "/contact/deleteWhatsappContact",
  390. Handler: contact.DeleteWhatsappContactHandler(serverCtx),
  391. },
  392. {
  393. Method: http.MethodPost,
  394. Path: "/contact/getWhatsappContact",
  395. Handler: contact.GetWhatsappContactHandler(serverCtx),
  396. },
  397. }...,
  398. ),
  399. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  400. )
  401. server.AddRoutes(
  402. rest.WithMiddlewares(
  403. []rest.Middleware{serverCtx.Authority},
  404. []rest.Route{
  405. {
  406. Method: http.MethodPost,
  407. Path: "/message/create",
  408. Handler: Message.CreateMessageHandler(serverCtx),
  409. },
  410. {
  411. Method: http.MethodPost,
  412. Path: "/message/update",
  413. Handler: Message.UpdateMessageHandler(serverCtx),
  414. },
  415. {
  416. Method: http.MethodPost,
  417. Path: "/message/delete",
  418. Handler: Message.DeleteMessageHandler(serverCtx),
  419. },
  420. {
  421. Method: http.MethodPost,
  422. Path: "/message/list",
  423. Handler: Message.GetMessageListHandler(serverCtx),
  424. },
  425. {
  426. Method: http.MethodPost,
  427. Path: "/message",
  428. Handler: Message.GetMessageByIdHandler(serverCtx),
  429. },
  430. }...,
  431. ),
  432. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  433. )
  434. server.AddRoutes(
  435. rest.WithMiddlewares(
  436. []rest.Middleware{serverCtx.Authority},
  437. []rest.Route{
  438. {
  439. Method: http.MethodPost,
  440. Path: "/label/create",
  441. Handler: label.CreateLabelHandler(serverCtx),
  442. },
  443. {
  444. Method: http.MethodPost,
  445. Path: "/label/update",
  446. Handler: label.UpdateLabelHandler(serverCtx),
  447. },
  448. {
  449. Method: http.MethodPost,
  450. Path: "/label/delete",
  451. Handler: label.DeleteLabelHandler(serverCtx),
  452. },
  453. {
  454. Method: http.MethodPost,
  455. Path: "/label/list",
  456. Handler: label.GetLabelListHandler(serverCtx),
  457. },
  458. {
  459. Method: http.MethodPost,
  460. Path: "/label/select_list",
  461. Handler: label.GetLabelSelectListHandler(serverCtx),
  462. },
  463. {
  464. Method: http.MethodPost,
  465. Path: "/label/batch_select_list",
  466. Handler: label.GetLabelBatchSelectListHandler(serverCtx),
  467. },
  468. {
  469. Method: http.MethodPost,
  470. Path: "/label/contacts",
  471. Handler: label.GetLabelContactsHandler(serverCtx),
  472. },
  473. {
  474. Method: http.MethodPost,
  475. Path: "/label",
  476. Handler: label.GetLabelByIdHandler(serverCtx),
  477. },
  478. }...,
  479. ),
  480. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  481. )
  482. server.AddRoutes(
  483. rest.WithMiddlewares(
  484. []rest.Middleware{serverCtx.Authority},
  485. []rest.Route{
  486. {
  487. Method: http.MethodPost,
  488. Path: "/label_tagging/create",
  489. Handler: label_tagging.CreateLabelTaggingHandler(serverCtx),
  490. },
  491. {
  492. Method: http.MethodPost,
  493. Path: "/label_tagging/update",
  494. Handler: label_tagging.UpdateLabelTaggingHandler(serverCtx),
  495. },
  496. {
  497. Method: http.MethodPost,
  498. Path: "/label_tagging/delete",
  499. Handler: label_tagging.DeleteLabelTaggingHandler(serverCtx),
  500. },
  501. {
  502. Method: http.MethodPost,
  503. Path: "/label_tagging/list",
  504. Handler: label_tagging.GetLabelTaggingListHandler(serverCtx),
  505. },
  506. {
  507. Method: http.MethodPost,
  508. Path: "/label_tagging",
  509. Handler: label_tagging.GetLabelTaggingByIdHandler(serverCtx),
  510. },
  511. }...,
  512. ),
  513. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  514. )
  515. server.AddRoutes(
  516. []rest.Route{
  517. {
  518. Method: http.MethodPost,
  519. Path: "/api/sop_task/list",
  520. Handler: sop_task.GetApiSopTaskListHandler(serverCtx),
  521. },
  522. },
  523. )
  524. server.AddRoutes(
  525. rest.WithMiddlewares(
  526. []rest.Middleware{serverCtx.Authority},
  527. []rest.Route{
  528. {
  529. Method: http.MethodPost,
  530. Path: "/sop_task/create",
  531. Handler: sop_task.CreateSopTaskHandler(serverCtx),
  532. },
  533. {
  534. Method: http.MethodPost,
  535. Path: "/sop_task/update",
  536. Handler: sop_task.UpdateSopTaskHandler(serverCtx),
  537. },
  538. {
  539. Method: http.MethodPost,
  540. Path: "/sop_task/delete",
  541. Handler: sop_task.DeleteSopTaskHandler(serverCtx),
  542. },
  543. {
  544. Method: http.MethodPost,
  545. Path: "/sop_task/list",
  546. Handler: sop_task.GetSopTaskListHandler(serverCtx),
  547. },
  548. {
  549. Method: http.MethodPost,
  550. Path: "/sop_task/record_list",
  551. Handler: sop_task.GetSopTaskRecordListHandler(serverCtx),
  552. },
  553. {
  554. Method: http.MethodPost,
  555. Path: "/sop_task",
  556. Handler: sop_task.GetSopTaskByIdHandler(serverCtx),
  557. },
  558. {
  559. Method: http.MethodPost,
  560. Path: "/sop_task/detail",
  561. Handler: sop_task.GetSopTaskDetailHandler(serverCtx),
  562. },
  563. {
  564. Method: http.MethodPost,
  565. Path: "/sop_task/publish",
  566. Handler: sop_task.PublishSopTaskHandler(serverCtx),
  567. },
  568. {
  569. Method: http.MethodPost,
  570. Path: "/sop_task/start",
  571. Handler: sop_task.SopTaskStartHandler(serverCtx),
  572. },
  573. {
  574. Method: http.MethodPost,
  575. Path: "/sop_task/stop",
  576. Handler: sop_task.SopTaskStopHandler(serverCtx),
  577. },
  578. {
  579. Method: http.MethodPost,
  580. Path: "/sop_task/copy",
  581. Handler: sop_task.SopTaskCopyHandler(serverCtx),
  582. },
  583. {
  584. Method: http.MethodPost,
  585. Path: "/sop_task/message_var",
  586. Handler: sop_task.GetSopMessageVarHandler(serverCtx),
  587. },
  588. {
  589. Method: http.MethodPost,
  590. Path: "/sop_task/outline",
  591. Handler: sop_task.GetSopTaskOutlineHandler(serverCtx),
  592. },
  593. {
  594. Method: http.MethodPost,
  595. Path: "/sop_task/test_node",
  596. Handler: sop_task.TestNodeHandler(serverCtx),
  597. },
  598. {
  599. Method: http.MethodPost,
  600. Path: "/sop_task/generate_ai_answer",
  601. Handler: sop_task.GenerateAiAnswerHandler(serverCtx),
  602. },
  603. }...,
  604. ),
  605. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  606. )
  607. server.AddRoutes(
  608. []rest.Route{
  609. {
  610. Method: http.MethodPost,
  611. Path: "/api/sop_stage/list",
  612. Handler: sop_stage.GetApiSopStageListHandler(serverCtx),
  613. },
  614. },
  615. )
  616. server.AddRoutes(
  617. rest.WithMiddlewares(
  618. []rest.Middleware{serverCtx.Authority},
  619. []rest.Route{
  620. {
  621. Method: http.MethodPost,
  622. Path: "/sop_stage/create",
  623. Handler: sop_stage.CreateSopStageHandler(serverCtx),
  624. },
  625. {
  626. Method: http.MethodPost,
  627. Path: "/sop_stage/update",
  628. Handler: sop_stage.UpdateSopStageHandler(serverCtx),
  629. },
  630. {
  631. Method: http.MethodPost,
  632. Path: "/sop_stage/delete",
  633. Handler: sop_stage.DeleteSopStageHandler(serverCtx),
  634. },
  635. {
  636. Method: http.MethodPost,
  637. Path: "/sop_stage/list",
  638. Handler: sop_stage.GetSopStageListHandler(serverCtx),
  639. },
  640. {
  641. Method: http.MethodPost,
  642. Path: "/sop_stage",
  643. Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
  644. },
  645. {
  646. Method: http.MethodPost,
  647. Path: "/sop_stage/detail",
  648. Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
  649. },
  650. {
  651. Method: http.MethodPost,
  652. Path: "/sop_stage/move",
  653. Handler: sop_stage.MoveSopStageHandler(serverCtx),
  654. },
  655. {
  656. Method: http.MethodPost,
  657. Path: "/sop_stage/copy",
  658. Handler: sop_stage.SopStageCopyHandler(serverCtx),
  659. },
  660. }...,
  661. ),
  662. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  663. )
  664. server.AddRoutes(
  665. []rest.Route{
  666. {
  667. Method: http.MethodPost,
  668. Path: "/api/sop_node/list",
  669. Handler: sop_node.GetApiSopNodeListHandler(serverCtx),
  670. },
  671. },
  672. )
  673. server.AddRoutes(
  674. rest.WithMiddlewares(
  675. []rest.Middleware{serverCtx.Authority},
  676. []rest.Route{
  677. {
  678. Method: http.MethodPost,
  679. Path: "/sop_node/create",
  680. Handler: sop_node.CreateSopNodeHandler(serverCtx),
  681. },
  682. {
  683. Method: http.MethodPost,
  684. Path: "/sop_node/update",
  685. Handler: sop_node.UpdateSopNodeHandler(serverCtx),
  686. },
  687. {
  688. Method: http.MethodPost,
  689. Path: "/sop_node/delete",
  690. Handler: sop_node.DeleteSopNodeHandler(serverCtx),
  691. },
  692. {
  693. Method: http.MethodPost,
  694. Path: "/sop_node/list",
  695. Handler: sop_node.GetSopNodeListHandler(serverCtx),
  696. },
  697. {
  698. Method: http.MethodPost,
  699. Path: "/sop_node/detail",
  700. Handler: sop_node.GetSopNodeDetailHandler(serverCtx),
  701. },
  702. }...,
  703. ),
  704. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  705. )
  706. server.AddRoutes(
  707. rest.WithMiddlewares(
  708. []rest.Middleware{serverCtx.Authority},
  709. []rest.Route{
  710. {
  711. Method: http.MethodPost,
  712. Path: "/message_records/create",
  713. Handler: message_records.CreateMessageRecordsHandler(serverCtx),
  714. },
  715. {
  716. Method: http.MethodPost,
  717. Path: "/message_records/update",
  718. Handler: message_records.UpdateMessageRecordsHandler(serverCtx),
  719. },
  720. {
  721. Method: http.MethodPost,
  722. Path: "/message_records/delete",
  723. Handler: message_records.DeleteMessageRecordsHandler(serverCtx),
  724. },
  725. {
  726. Method: http.MethodPost,
  727. Path: "/message_records/list",
  728. Handler: message_records.GetMessageRecordsListHandler(serverCtx),
  729. },
  730. {
  731. Method: http.MethodPost,
  732. Path: "/message_records",
  733. Handler: message_records.GetMessageRecordsByIdHandler(serverCtx),
  734. },
  735. }...,
  736. ),
  737. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  738. )
  739. server.AddRoutes(
  740. rest.WithMiddlewares(
  741. []rest.Middleware{serverCtx.Authority},
  742. []rest.Route{
  743. {
  744. Method: http.MethodPost,
  745. Path: "/chatroom_member/list",
  746. Handler: ChatRoomMember.GetChatroomMemberListHandler(serverCtx),
  747. },
  748. }...,
  749. ),
  750. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  751. )
  752. server.AddRoutes(
  753. []rest.Route{
  754. {
  755. Method: http.MethodPost,
  756. Path: "/api/user/login",
  757. Handler: User.DoApiUserLoginHandler(serverCtx),
  758. },
  759. {
  760. Method: http.MethodPost,
  761. Path: "/gpts/user/login",
  762. Handler: User.DoGptsUserLoginHandler(serverCtx),
  763. },
  764. {
  765. Method: http.MethodPost,
  766. Path: "/gpts/user/info",
  767. Handler: User.GetGptsUserInfoHandler(serverCtx),
  768. },
  769. {
  770. Method: http.MethodPost,
  771. Path: "/gpts/user/update",
  772. Handler: User.UpdateGptsUserInfoHandler(serverCtx),
  773. },
  774. {
  775. Method: http.MethodPost,
  776. Path: "/gpts/user/balance",
  777. Handler: User.GetGptsUserBalanceHandler(serverCtx),
  778. },
  779. {
  780. Method: http.MethodPost,
  781. Path: "/gpts/user/password",
  782. Handler: User.UpdateGptsUserPwdHandler(serverCtx),
  783. },
  784. },
  785. )
  786. server.AddRoutes(
  787. rest.WithMiddlewares(
  788. []rest.Middleware{serverCtx.Miniprogram},
  789. []rest.Route{
  790. {
  791. Method: http.MethodPost,
  792. Path: "/api/user/vip",
  793. Handler: User.GetApiUserVipHandler(serverCtx),
  794. },
  795. }...,
  796. ),
  797. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  798. )
  799. server.AddRoutes(
  800. rest.WithMiddlewares(
  801. []rest.Middleware{serverCtx.Authority},
  802. []rest.Route{
  803. {
  804. Method: http.MethodGet,
  805. Path: "/user/info",
  806. Handler: User.GetUserInfoHandler(serverCtx),
  807. },
  808. }...,
  809. ),
  810. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  811. )
  812. server.AddRoutes(
  813. []rest.Route{
  814. {
  815. Method: http.MethodPost,
  816. Path: "/contact/getContactByWxid",
  817. Handler: openapi.OpenapiGetContactByWxidHandler(serverCtx),
  818. },
  819. {
  820. Method: http.MethodPost,
  821. Path: "/contact/getContactList",
  822. Handler: openapi.OpenapiGetContactListHandler(serverCtx),
  823. },
  824. },
  825. rest.WithPrefix("/openapi"),
  826. )
  827. server.AddRoutes(
  828. rest.WithMiddlewares(
  829. []rest.Middleware{serverCtx.Authority},
  830. []rest.Route{
  831. {
  832. Method: http.MethodPost,
  833. Path: "/batch_msg/create",
  834. Handler: batch_msg.CreateBatchMsgHandler(serverCtx),
  835. },
  836. {
  837. Method: http.MethodPost,
  838. Path: "/batch_msg/update",
  839. Handler: batch_msg.UpdateBatchMsgHandler(serverCtx),
  840. },
  841. {
  842. Method: http.MethodPost,
  843. Path: "/batch_msg/delete",
  844. Handler: batch_msg.DeleteBatchMsgHandler(serverCtx),
  845. },
  846. {
  847. Method: http.MethodPost,
  848. Path: "/batch_msg/list",
  849. Handler: batch_msg.GetBatchMsgListHandler(serverCtx),
  850. },
  851. {
  852. Method: http.MethodPost,
  853. Path: "/batch_msg",
  854. Handler: batch_msg.GetBatchMsgByIdHandler(serverCtx),
  855. },
  856. {
  857. Method: http.MethodPost,
  858. Path: "/batch_msg/stop",
  859. Handler: batch_msg.StopBatchMsgHandler(serverCtx),
  860. },
  861. {
  862. Method: http.MethodPost,
  863. Path: "/batch_msg/getWhatcappBatchMsgList",
  864. Handler: batch_msg.GetWhatcappBatchMsgListHandler(serverCtx),
  865. },
  866. {
  867. Method: http.MethodPost,
  868. Path: "/batch_msg/createWhatcappBatchMsg",
  869. Handler: batch_msg.CreateWhatcappBatchMsgHandler(serverCtx),
  870. },
  871. {
  872. Method: http.MethodPost,
  873. Path: "/batch_msg/updateWhatcappBatchMsg",
  874. Handler: batch_msg.UpdateWhatcappBatchMsgHandler(serverCtx),
  875. },
  876. {
  877. Method: http.MethodPost,
  878. Path: "/batch_msg/getWhatcappBatchMsg",
  879. Handler: batch_msg.GetWhatcappBatchMsgHandler(serverCtx),
  880. },
  881. {
  882. Method: http.MethodPost,
  883. Path: "/batch_msg/removeWhatcappBatchMsg",
  884. Handler: batch_msg.RemoveWhatcappBatchMsgHandler(serverCtx),
  885. },
  886. {
  887. Method: http.MethodPost,
  888. Path: "/batch_msg/getWhatcappBatchMsgHistory",
  889. Handler: batch_msg.GetWhatcappBatchMsgHistoryHandler(serverCtx),
  890. },
  891. {
  892. Method: http.MethodPost,
  893. Path: "/batch_msg/sendBatchMsgText",
  894. Handler: batch_msg.SendBatchMsgTextHandler(serverCtx),
  895. },
  896. }...,
  897. ),
  898. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  899. )
  900. server.AddRoutes(
  901. rest.WithMiddlewares(
  902. []rest.Middleware{serverCtx.Authority},
  903. []rest.Route{
  904. {
  905. Method: http.MethodPost,
  906. Path: "/msg/create",
  907. Handler: Msg.CreateMsgHandler(serverCtx),
  908. },
  909. {
  910. Method: http.MethodPost,
  911. Path: "/msg/update",
  912. Handler: Msg.UpdateMsgHandler(serverCtx),
  913. },
  914. {
  915. Method: http.MethodPost,
  916. Path: "/msg/delete",
  917. Handler: Msg.DeleteMsgHandler(serverCtx),
  918. },
  919. {
  920. Method: http.MethodPost,
  921. Path: "/msg/list",
  922. Handler: Msg.GetMsgListHandler(serverCtx),
  923. },
  924. {
  925. Method: http.MethodPost,
  926. Path: "/msg",
  927. Handler: Msg.GetMsgByIdHandler(serverCtx),
  928. },
  929. }...,
  930. ),
  931. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  932. )
  933. server.AddRoutes(
  934. []rest.Route{
  935. {
  936. Method: http.MethodPost,
  937. Path: "/api/employee/list",
  938. Handler: employee.GetApiEmployeeListHandler(serverCtx),
  939. },
  940. {
  941. Method: http.MethodPost,
  942. Path: "/api/employee/detail",
  943. Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
  944. },
  945. },
  946. )
  947. server.AddRoutes(
  948. []rest.Route{
  949. {
  950. Method: http.MethodPost,
  951. Path: "/employee/search",
  952. Handler: employee.GetEmployeeSearchHandler(serverCtx),
  953. },
  954. {
  955. Method: http.MethodPost,
  956. Path: "/employee/search/test",
  957. Handler: employee.GetEmployeeSearchTestHandler(serverCtx),
  958. },
  959. {
  960. Method: http.MethodPost,
  961. Path: "/employee/detail",
  962. Handler: employee.GetEmployeeDetailHandler(serverCtx),
  963. },
  964. },
  965. )
  966. server.AddRoutes(
  967. rest.WithMiddlewares(
  968. []rest.Middleware{serverCtx.Authority},
  969. []rest.Route{
  970. {
  971. Method: http.MethodPost,
  972. Path: "/employee/create",
  973. Handler: employee.CreateEmployeeHandler(serverCtx),
  974. },
  975. {
  976. Method: http.MethodPost,
  977. Path: "/employee/update",
  978. Handler: employee.UpdateEmployeeHandler(serverCtx),
  979. },
  980. {
  981. Method: http.MethodPost,
  982. Path: "/employee/delete",
  983. Handler: employee.DeleteEmployeeHandler(serverCtx),
  984. },
  985. {
  986. Method: http.MethodPost,
  987. Path: "/employee/list",
  988. Handler: employee.GetEmployeeListHandler(serverCtx),
  989. },
  990. {
  991. Method: http.MethodPost,
  992. Path: "/employee",
  993. Handler: employee.GetEmployeeByIdHandler(serverCtx),
  994. },
  995. }...,
  996. ),
  997. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  998. )
  999. server.AddRoutes(
  1000. rest.WithMiddlewares(
  1001. []rest.Middleware{serverCtx.Authority},
  1002. []rest.Route{
  1003. {
  1004. Method: http.MethodPost,
  1005. Path: "/work_experience/create",
  1006. Handler: work_experience.CreateWorkExperienceHandler(serverCtx),
  1007. },
  1008. {
  1009. Method: http.MethodPost,
  1010. Path: "/work_experience/update",
  1011. Handler: work_experience.UpdateWorkExperienceHandler(serverCtx),
  1012. },
  1013. {
  1014. Method: http.MethodPost,
  1015. Path: "/work_experience/delete",
  1016. Handler: work_experience.DeleteWorkExperienceHandler(serverCtx),
  1017. },
  1018. {
  1019. Method: http.MethodPost,
  1020. Path: "/work_experience/list",
  1021. Handler: work_experience.GetWorkExperienceListHandler(serverCtx),
  1022. },
  1023. {
  1024. Method: http.MethodPost,
  1025. Path: "/work_experience",
  1026. Handler: work_experience.GetWorkExperienceByIdHandler(serverCtx),
  1027. },
  1028. }...,
  1029. ),
  1030. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1031. )
  1032. server.AddRoutes(
  1033. rest.WithMiddlewares(
  1034. []rest.Middleware{serverCtx.Authority},
  1035. []rest.Route{
  1036. {
  1037. Method: http.MethodPost,
  1038. Path: "/tutorial/create",
  1039. Handler: tutorial.CreateTutorialHandler(serverCtx),
  1040. },
  1041. {
  1042. Method: http.MethodPost,
  1043. Path: "/tutorial/update",
  1044. Handler: tutorial.UpdateTutorialHandler(serverCtx),
  1045. },
  1046. {
  1047. Method: http.MethodPost,
  1048. Path: "/tutorial/delete",
  1049. Handler: tutorial.DeleteTutorialHandler(serverCtx),
  1050. },
  1051. {
  1052. Method: http.MethodPost,
  1053. Path: "/tutorial/list",
  1054. Handler: tutorial.GetTutorialListHandler(serverCtx),
  1055. },
  1056. {
  1057. Method: http.MethodPost,
  1058. Path: "/tutorial",
  1059. Handler: tutorial.GetTutorialByIdHandler(serverCtx),
  1060. },
  1061. }...,
  1062. ),
  1063. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1064. )
  1065. server.AddRoutes(
  1066. rest.WithMiddlewares(
  1067. []rest.Middleware{serverCtx.Authority},
  1068. []rest.Route{
  1069. {
  1070. Method: http.MethodGet,
  1071. Path: "/employee_config/list",
  1072. Handler: employee_config.GetEmployeeListConfigHandler(serverCtx),
  1073. },
  1074. }...,
  1075. ),
  1076. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1077. )
  1078. server.AddRoutes(
  1079. []rest.Route{
  1080. {
  1081. Method: http.MethodPost,
  1082. Path: "/token/check",
  1083. Handler: token.CheckTokenHandler(serverCtx),
  1084. },
  1085. },
  1086. )
  1087. server.AddRoutes(
  1088. rest.WithMiddlewares(
  1089. []rest.Middleware{serverCtx.Authority},
  1090. []rest.Route{
  1091. {
  1092. Method: http.MethodPost,
  1093. Path: "/token/third/create",
  1094. Handler: token.CreateTokenHandler(serverCtx),
  1095. },
  1096. {
  1097. Method: http.MethodPost,
  1098. Path: "/token/third/update",
  1099. Handler: token.UpdateTokenHandler(serverCtx),
  1100. },
  1101. {
  1102. Method: http.MethodPost,
  1103. Path: "/token/third/delete",
  1104. Handler: token.DeleteTokenHandler(serverCtx),
  1105. },
  1106. {
  1107. Method: http.MethodPost,
  1108. Path: "/token/third/list",
  1109. Handler: token.GetTokenListHandler(serverCtx),
  1110. },
  1111. {
  1112. Method: http.MethodPost,
  1113. Path: "/token/api/list",
  1114. Handler: token.GetApiTokenListHandler(serverCtx),
  1115. },
  1116. {
  1117. Method: http.MethodPost,
  1118. Path: "/token/third/detail",
  1119. Handler: token.GetTokenByIdHandler(serverCtx),
  1120. },
  1121. {
  1122. Method: http.MethodPost,
  1123. Path: "/token/third/clear",
  1124. Handler: token.ClearTokenByIdHandler(serverCtx),
  1125. },
  1126. }...,
  1127. ),
  1128. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1129. )
  1130. server.AddRoutes(
  1131. []rest.Route{
  1132. {
  1133. Method: http.MethodPost,
  1134. Path: "/category/list",
  1135. Handler: category.GetCategoryListHandler(serverCtx),
  1136. },
  1137. {
  1138. Method: http.MethodPost,
  1139. Path: "/category",
  1140. Handler: category.GetCategoryByIdHandler(serverCtx),
  1141. },
  1142. {
  1143. Method: http.MethodPost,
  1144. Path: "/api/category/list",
  1145. Handler: category.GetApiCategoryListHandler(serverCtx),
  1146. },
  1147. },
  1148. )
  1149. server.AddRoutes(
  1150. rest.WithMiddlewares(
  1151. []rest.Middleware{serverCtx.Authority},
  1152. []rest.Route{
  1153. {
  1154. Method: http.MethodPost,
  1155. Path: "/category/create",
  1156. Handler: category.CreateCategoryHandler(serverCtx),
  1157. },
  1158. {
  1159. Method: http.MethodPost,
  1160. Path: "/category/update",
  1161. Handler: category.UpdateCategoryHandler(serverCtx),
  1162. },
  1163. {
  1164. Method: http.MethodPost,
  1165. Path: "/category/delete",
  1166. Handler: category.DeleteCategoryHandler(serverCtx),
  1167. },
  1168. }...,
  1169. ),
  1170. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1171. )
  1172. server.AddRoutes(
  1173. rest.WithMiddlewares(
  1174. []rest.Middleware{serverCtx.Authority},
  1175. []rest.Route{
  1176. {
  1177. Method: http.MethodPost,
  1178. Path: "/agent_base/create",
  1179. Handler: agent_base.CreateAgentBaseHandler(serverCtx),
  1180. },
  1181. {
  1182. Method: http.MethodPost,
  1183. Path: "/agent_base/update",
  1184. Handler: agent_base.UpdateAgentBaseHandler(serverCtx),
  1185. },
  1186. {
  1187. Method: http.MethodPost,
  1188. Path: "/agent_base/delete",
  1189. Handler: agent_base.DeleteAgentBaseHandler(serverCtx),
  1190. },
  1191. {
  1192. Method: http.MethodPost,
  1193. Path: "/agent_base/list",
  1194. Handler: agent_base.GetAgentBaseListHandler(serverCtx),
  1195. },
  1196. {
  1197. Method: http.MethodPost,
  1198. Path: "/agent_base",
  1199. Handler: agent_base.GetAgentBaseByIdHandler(serverCtx),
  1200. },
  1201. }...,
  1202. ),
  1203. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1204. )
  1205. server.AddRoutes(
  1206. []rest.Route{
  1207. {
  1208. Method: http.MethodPost,
  1209. Path: "/gpts/chat/submit",
  1210. Handler: chatrecords.GptsSubmitApiChatHandler(serverCtx),
  1211. },
  1212. {
  1213. Method: http.MethodPost,
  1214. Path: "/gpts/chat/message",
  1215. Handler: chatrecords.GptsGetApiMessageHandler(serverCtx),
  1216. },
  1217. {
  1218. Method: http.MethodPost,
  1219. Path: "/gpts/chat/session",
  1220. Handler: chatrecords.GptsGetApiSessionHandler(serverCtx),
  1221. },
  1222. {
  1223. Method: http.MethodPost,
  1224. Path: "/gpts/chat/session/delete",
  1225. Handler: chatrecords.GptsDeleteApiSessionHandler(serverCtx),
  1226. },
  1227. {
  1228. Method: http.MethodPost,
  1229. Path: "/gpts/chat/session/rename",
  1230. Handler: chatrecords.GptsRenameApiSessionHandler(serverCtx),
  1231. },
  1232. },
  1233. )
  1234. server.AddRoutes(
  1235. rest.WithMiddlewares(
  1236. []rest.Middleware{serverCtx.Miniprogram},
  1237. []rest.Route{
  1238. {
  1239. Method: http.MethodPost,
  1240. Path: "/api/chat/create",
  1241. Handler: chatrecords.SubmitApiChatHandler(serverCtx),
  1242. },
  1243. {
  1244. Method: http.MethodPost,
  1245. Path: "/api/chat/answer",
  1246. Handler: chatrecords.AnswerApiChatHandler(serverCtx),
  1247. },
  1248. {
  1249. Method: http.MethodPost,
  1250. Path: "/api/chat/list",
  1251. Handler: chatrecords.GetApiChatListHandler(serverCtx),
  1252. },
  1253. {
  1254. Method: http.MethodPost,
  1255. Path: "/api/chat/recommmend",
  1256. Handler: chatrecords.GetApiRecommendChatHandler(serverCtx),
  1257. },
  1258. }...,
  1259. ),
  1260. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1261. )
  1262. server.AddRoutes(
  1263. rest.WithMiddlewares(
  1264. []rest.Middleware{serverCtx.Authority},
  1265. []rest.Route{
  1266. {
  1267. Method: http.MethodPost,
  1268. Path: "/chat_records/create",
  1269. Handler: chatrecords.CreateChatRecordsHandler(serverCtx),
  1270. },
  1271. {
  1272. Method: http.MethodPost,
  1273. Path: "/chat_records/update",
  1274. Handler: chatrecords.UpdateChatRecordsHandler(serverCtx),
  1275. },
  1276. {
  1277. Method: http.MethodPost,
  1278. Path: "/chat_records/delete",
  1279. Handler: chatrecords.DeleteChatRecordsHandler(serverCtx),
  1280. },
  1281. {
  1282. Method: http.MethodPost,
  1283. Path: "/chat_records/list",
  1284. Handler: chatrecords.GetChatRecordsListHandler(serverCtx),
  1285. },
  1286. {
  1287. Method: http.MethodPost,
  1288. Path: "/chat_records",
  1289. Handler: chatrecords.GetChatRecordsByIdHandler(serverCtx),
  1290. },
  1291. }...,
  1292. ),
  1293. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1294. )
  1295. server.AddRoutes(
  1296. rest.WithMiddlewares(
  1297. []rest.Middleware{serverCtx.Miniprogram},
  1298. []rest.Route{
  1299. {
  1300. Method: http.MethodPost,
  1301. Path: "/api/session/list",
  1302. Handler: chatsession.GetApiSessionListHandler(serverCtx),
  1303. },
  1304. {
  1305. Method: http.MethodPost,
  1306. Path: "/api/session/update",
  1307. Handler: chatsession.UpdateApiSessionHandler(serverCtx),
  1308. },
  1309. {
  1310. Method: http.MethodPost,
  1311. Path: "/api/session/delete",
  1312. Handler: chatsession.DeleteApiSessionHandler(serverCtx),
  1313. },
  1314. }...,
  1315. ),
  1316. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1317. )
  1318. server.AddRoutes(
  1319. rest.WithMiddlewares(
  1320. []rest.Middleware{serverCtx.Authority},
  1321. []rest.Route{
  1322. {
  1323. Method: http.MethodPost,
  1324. Path: "/chat_session/create",
  1325. Handler: chatsession.CreateChatSessionHandler(serverCtx),
  1326. },
  1327. {
  1328. Method: http.MethodPost,
  1329. Path: "/chat_session/update",
  1330. Handler: chatsession.UpdateChatSessionHandler(serverCtx),
  1331. },
  1332. {
  1333. Method: http.MethodPost,
  1334. Path: "/chat_session/delete",
  1335. Handler: chatsession.DeleteChatSessionHandler(serverCtx),
  1336. },
  1337. {
  1338. Method: http.MethodPost,
  1339. Path: "/chat_session/list",
  1340. Handler: chatsession.GetChatSessionListHandler(serverCtx),
  1341. },
  1342. {
  1343. Method: http.MethodPost,
  1344. Path: "/chat_session",
  1345. Handler: chatsession.GetChatSessionByIdHandler(serverCtx),
  1346. },
  1347. }...,
  1348. ),
  1349. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1350. )
  1351. server.AddRoutes(
  1352. rest.WithMiddlewares(
  1353. []rest.Middleware{serverCtx.Miniprogram},
  1354. []rest.Route{
  1355. {
  1356. Method: http.MethodPost,
  1357. Path: "/api/card/detail",
  1358. Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
  1359. },
  1360. }...,
  1361. ),
  1362. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1363. )
  1364. server.AddRoutes(
  1365. []rest.Route{
  1366. {
  1367. Method: http.MethodGet,
  1368. Path: "/api/card/qrcode",
  1369. Handler: wxcard.GetApiWxCardQrcodeHandler(serverCtx),
  1370. },
  1371. },
  1372. )
  1373. server.AddRoutes(
  1374. rest.WithMiddlewares(
  1375. []rest.Middleware{serverCtx.Authority},
  1376. []rest.Route{
  1377. {
  1378. Method: http.MethodPost,
  1379. Path: "/wx_card/create",
  1380. Handler: wxcard.CreateWxCardHandler(serverCtx),
  1381. },
  1382. {
  1383. Method: http.MethodPost,
  1384. Path: "/wx_card/update",
  1385. Handler: wxcard.UpdateWxCardHandler(serverCtx),
  1386. },
  1387. {
  1388. Method: http.MethodPost,
  1389. Path: "/wx_card/delete",
  1390. Handler: wxcard.DeleteWxCardHandler(serverCtx),
  1391. },
  1392. {
  1393. Method: http.MethodPost,
  1394. Path: "/wx_card/list",
  1395. Handler: wxcard.GetWxCardListHandler(serverCtx),
  1396. },
  1397. {
  1398. Method: http.MethodPost,
  1399. Path: "/wx_card",
  1400. Handler: wxcard.GetWxCardByIdHandler(serverCtx),
  1401. },
  1402. }...,
  1403. ),
  1404. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1405. )
  1406. server.AddRoutes(
  1407. rest.WithMiddlewares(
  1408. []rest.Middleware{serverCtx.Miniprogram},
  1409. []rest.Route{
  1410. {
  1411. Method: http.MethodPost,
  1412. Path: "/api/user/update",
  1413. Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
  1414. },
  1415. }...,
  1416. ),
  1417. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1418. )
  1419. server.AddRoutes(
  1420. rest.WithMiddlewares(
  1421. []rest.Middleware{serverCtx.Authority},
  1422. []rest.Route{
  1423. {
  1424. Method: http.MethodPost,
  1425. Path: "/wx_card_user/create",
  1426. Handler: wxcarduser.CreateWxCardUserHandler(serverCtx),
  1427. },
  1428. {
  1429. Method: http.MethodPost,
  1430. Path: "/wx_card_user/update",
  1431. Handler: wxcarduser.UpdateWxCardUserHandler(serverCtx),
  1432. },
  1433. {
  1434. Method: http.MethodPost,
  1435. Path: "/wx_card_user/delete",
  1436. Handler: wxcarduser.DeleteWxCardUserHandler(serverCtx),
  1437. },
  1438. {
  1439. Method: http.MethodPost,
  1440. Path: "/wx_card_user/list",
  1441. Handler: wxcarduser.GetWxCardUserListHandler(serverCtx),
  1442. },
  1443. {
  1444. Method: http.MethodPost,
  1445. Path: "/wx_card_user",
  1446. Handler: wxcarduser.GetWxCardUserByIdHandler(serverCtx),
  1447. },
  1448. }...,
  1449. ),
  1450. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1451. )
  1452. server.AddRoutes(
  1453. rest.WithMiddlewares(
  1454. []rest.Middleware{serverCtx.Miniprogram},
  1455. []rest.Route{
  1456. {
  1457. Method: http.MethodPost,
  1458. Path: "/api/card/visit",
  1459. Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
  1460. },
  1461. {
  1462. Method: http.MethodPost,
  1463. Path: "/api/card/visit/history",
  1464. Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
  1465. },
  1466. }...,
  1467. ),
  1468. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1469. )
  1470. server.AddRoutes(
  1471. rest.WithMiddlewares(
  1472. []rest.Middleware{serverCtx.Authority},
  1473. []rest.Route{
  1474. {
  1475. Method: http.MethodPost,
  1476. Path: "/wx_card_visit/create",
  1477. Handler: wxcardvisit.CreateWxCardVisitHandler(serverCtx),
  1478. },
  1479. {
  1480. Method: http.MethodPost,
  1481. Path: "/wx_card_visit/update",
  1482. Handler: wxcardvisit.UpdateWxCardVisitHandler(serverCtx),
  1483. },
  1484. {
  1485. Method: http.MethodPost,
  1486. Path: "/wx_card_visit/delete",
  1487. Handler: wxcardvisit.DeleteWxCardVisitHandler(serverCtx),
  1488. },
  1489. {
  1490. Method: http.MethodPost,
  1491. Path: "/wx_card_visit/list",
  1492. Handler: wxcardvisit.GetWxCardVisitListHandler(serverCtx),
  1493. },
  1494. {
  1495. Method: http.MethodPost,
  1496. Path: "/wx_card_visit",
  1497. Handler: wxcardvisit.GetWxCardVisitByIdHandler(serverCtx),
  1498. },
  1499. }...,
  1500. ),
  1501. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1502. )
  1503. server.AddRoutes(
  1504. rest.WithMiddlewares(
  1505. []rest.Middleware{serverCtx.Miniprogram},
  1506. []rest.Route{
  1507. {
  1508. Method: http.MethodPost,
  1509. Path: "/api/avatar/config",
  1510. Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
  1511. },
  1512. {
  1513. Method: http.MethodPost,
  1514. Path: "/api/avatar/sendText",
  1515. Handler: avatar.SendApiAvatarTextHandler(serverCtx),
  1516. },
  1517. {
  1518. Method: http.MethodPost,
  1519. Path: "/api/avatar/stop",
  1520. Handler: avatar.StopApiAvatarHandler(serverCtx),
  1521. },
  1522. {
  1523. Method: http.MethodPost,
  1524. Path: "/api/avatar/sts",
  1525. Handler: avatar.GetAcsResponseHandler(serverCtx),
  1526. },
  1527. {
  1528. Method: http.MethodPost,
  1529. Path: "/api/avatar/signature",
  1530. Handler: avatar.GetSignatureResponseHandler(serverCtx),
  1531. },
  1532. }...,
  1533. ),
  1534. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1535. )
  1536. server.AddRoutes(
  1537. rest.WithMiddlewares(
  1538. []rest.Middleware{serverCtx.Authority},
  1539. []rest.Route{
  1540. {
  1541. Method: http.MethodPost,
  1542. Path: "/aliyun_avatar/create",
  1543. Handler: aliyun_avatar.CreateAliyunAvatarHandler(serverCtx),
  1544. },
  1545. {
  1546. Method: http.MethodPost,
  1547. Path: "/aliyun_avatar/update",
  1548. Handler: aliyun_avatar.UpdateAliyunAvatarHandler(serverCtx),
  1549. },
  1550. {
  1551. Method: http.MethodPost,
  1552. Path: "/aliyun_avatar/delete",
  1553. Handler: aliyun_avatar.DeleteAliyunAvatarHandler(serverCtx),
  1554. },
  1555. {
  1556. Method: http.MethodPost,
  1557. Path: "/aliyun_avatar/list",
  1558. Handler: aliyun_avatar.GetAliyunAvatarListHandler(serverCtx),
  1559. },
  1560. {
  1561. Method: http.MethodPost,
  1562. Path: "/aliyun_avatar",
  1563. Handler: aliyun_avatar.GetAliyunAvatarByIdHandler(serverCtx),
  1564. },
  1565. }...,
  1566. ),
  1567. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1568. )
  1569. server.AddRoutes(
  1570. rest.WithMiddlewares(
  1571. []rest.Middleware{serverCtx.Authority},
  1572. []rest.Route{
  1573. {
  1574. Method: http.MethodPost,
  1575. Path: "/workphone/wxaccount/refresh",
  1576. Handler: WorkPhone.WxRefreshHandler(serverCtx),
  1577. },
  1578. {
  1579. Method: http.MethodPost,
  1580. Path: "/workphone/Qwaccount/refresh",
  1581. Handler: WorkPhone.QwRefreshHandler(serverCtx),
  1582. },
  1583. }...,
  1584. ),
  1585. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1586. )
  1587. server.AddRoutes(
  1588. rest.WithMiddlewares(
  1589. []rest.Middleware{serverCtx.Authority},
  1590. []rest.Route{
  1591. {
  1592. Method: http.MethodPost,
  1593. Path: "/usage_detail/list",
  1594. Handler: UsageDetail.GetUsageDetailListHandler(serverCtx),
  1595. },
  1596. {
  1597. Method: http.MethodPost,
  1598. Path: "/usage_detail",
  1599. Handler: UsageDetail.GetUsageDetailHandler(serverCtx),
  1600. },
  1601. }...,
  1602. ),
  1603. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1604. )
  1605. server.AddRoutes(
  1606. rest.WithMiddlewares(
  1607. []rest.Middleware{serverCtx.Authority},
  1608. []rest.Route{
  1609. {
  1610. Method: http.MethodPost,
  1611. Path: "/usage_total/list",
  1612. Handler: UsageTotal.GetUsageTotalListHandler(serverCtx),
  1613. },
  1614. }...,
  1615. ),
  1616. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1617. )
  1618. server.AddRoutes(
  1619. rest.WithMiddlewares(
  1620. []rest.Middleware{serverCtx.Authority},
  1621. []rest.Route{
  1622. {
  1623. Method: http.MethodPost,
  1624. Path: "/alloc_agent/create",
  1625. Handler: allocagent.CreateAllocAgentHandler(serverCtx),
  1626. },
  1627. {
  1628. Method: http.MethodPost,
  1629. Path: "/alloc_agent/update",
  1630. Handler: allocagent.UpdateAllocAgentHandler(serverCtx),
  1631. },
  1632. {
  1633. Method: http.MethodPost,
  1634. Path: "/alloc_agent/delete",
  1635. Handler: allocagent.DeleteAllocAgentHandler(serverCtx),
  1636. },
  1637. {
  1638. Method: http.MethodPost,
  1639. Path: "/alloc_agent/list",
  1640. Handler: allocagent.GetAllocAgentListHandler(serverCtx),
  1641. },
  1642. {
  1643. Method: http.MethodPost,
  1644. Path: "/alloc_agent",
  1645. Handler: allocagent.GetAllocAgentByIdHandler(serverCtx),
  1646. },
  1647. {
  1648. Method: http.MethodPost,
  1649. Path: "/alloc_agent/query",
  1650. Handler: allocagent.QueryAllocAgentHandler(serverCtx),
  1651. },
  1652. {
  1653. Method: http.MethodPost,
  1654. Path: "/alloc_agent/alloc",
  1655. Handler: allocagent.DoAllocAgentHandler(serverCtx),
  1656. },
  1657. }...,
  1658. ),
  1659. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1660. )
  1661. server.AddRoutes(
  1662. []rest.Route{
  1663. {
  1664. Method: http.MethodGet,
  1665. Path: "/api/xiaoice/signature",
  1666. Handler: xiaoice.SignatureGenHandler(serverCtx),
  1667. },
  1668. {
  1669. Method: http.MethodPost,
  1670. Path: "/api/xiaoice/message",
  1671. Handler: xiaoice.GptbotsMessageHandler(serverCtx),
  1672. },
  1673. {
  1674. Method: http.MethodPost,
  1675. Path: "/api/xiaoice/chat",
  1676. Handler: xiaoice.GptbotsChatHandler(serverCtx),
  1677. },
  1678. },
  1679. )
  1680. server.AddRoutes(
  1681. rest.WithMiddlewares(
  1682. []rest.Middleware{serverCtx.Authority},
  1683. []rest.Route{
  1684. {
  1685. Method: http.MethodPost,
  1686. Path: "/dashboard/charts",
  1687. Handler: dashboard.GetChartsHandler(serverCtx),
  1688. },
  1689. {
  1690. Method: http.MethodPost,
  1691. Path: "/dashboard/wx",
  1692. Handler: dashboard.GetWxsHandler(serverCtx),
  1693. },
  1694. }...,
  1695. ),
  1696. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1697. )
  1698. server.AddRoutes(
  1699. rest.WithMiddlewares(
  1700. []rest.Middleware{serverCtx.Authority},
  1701. []rest.Route{
  1702. {
  1703. Method: http.MethodPost,
  1704. Path: "/credit_balance/create",
  1705. Handler: credit_balance.CreateCreditBalanceHandler(serverCtx),
  1706. },
  1707. {
  1708. Method: http.MethodPost,
  1709. Path: "/credit_balance/update",
  1710. Handler: credit_balance.UpdateCreditBalanceHandler(serverCtx),
  1711. },
  1712. {
  1713. Method: http.MethodPost,
  1714. Path: "/credit_balance/delete",
  1715. Handler: credit_balance.DeleteCreditBalanceHandler(serverCtx),
  1716. },
  1717. {
  1718. Method: http.MethodPost,
  1719. Path: "/credit_balance/list",
  1720. Handler: credit_balance.GetCreditBalanceListHandler(serverCtx),
  1721. },
  1722. {
  1723. Method: http.MethodPost,
  1724. Path: "/credit_balance",
  1725. Handler: credit_balance.GetCreditBalanceByIdHandler(serverCtx),
  1726. },
  1727. {
  1728. Method: http.MethodPost,
  1729. Path: "/credit_balance/operate",
  1730. Handler: credit_balance.OperateCreditBalanceHandler(serverCtx),
  1731. },
  1732. }...,
  1733. ),
  1734. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1735. )
  1736. server.AddRoutes(
  1737. rest.WithMiddlewares(
  1738. []rest.Middleware{serverCtx.Authority},
  1739. []rest.Route{
  1740. {
  1741. Method: http.MethodPost,
  1742. Path: "/credit_usage/create",
  1743. Handler: credit_usage.CreateCreditUsageHandler(serverCtx),
  1744. },
  1745. {
  1746. Method: http.MethodPost,
  1747. Path: "/credit_usage/update",
  1748. Handler: credit_usage.UpdateCreditUsageHandler(serverCtx),
  1749. },
  1750. {
  1751. Method: http.MethodPost,
  1752. Path: "/credit_usage/delete",
  1753. Handler: credit_usage.DeleteCreditUsageHandler(serverCtx),
  1754. },
  1755. {
  1756. Method: http.MethodPost,
  1757. Path: "/credit_usage/list",
  1758. Handler: credit_usage.GetCreditUsageListHandler(serverCtx),
  1759. },
  1760. {
  1761. Method: http.MethodPost,
  1762. Path: "/credit_usage",
  1763. Handler: credit_usage.GetCreditUsageByIdHandler(serverCtx),
  1764. },
  1765. }...,
  1766. ),
  1767. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1768. )
  1769. server.AddRoutes(
  1770. rest.WithMiddlewares(
  1771. []rest.Middleware{serverCtx.Authority},
  1772. []rest.Route{
  1773. {
  1774. Method: http.MethodPost,
  1775. Path: "/pay_recharge/create",
  1776. Handler: pay_recharge.CreatePayRechargeHandler(serverCtx),
  1777. },
  1778. {
  1779. Method: http.MethodPost,
  1780. Path: "/pay_recharge/update",
  1781. Handler: pay_recharge.UpdatePayRechargeHandler(serverCtx),
  1782. },
  1783. {
  1784. Method: http.MethodPost,
  1785. Path: "/pay_recharge/delete",
  1786. Handler: pay_recharge.DeletePayRechargeHandler(serverCtx),
  1787. },
  1788. {
  1789. Method: http.MethodPost,
  1790. Path: "/pay_recharge/list",
  1791. Handler: pay_recharge.GetPayRechargeListHandler(serverCtx),
  1792. },
  1793. {
  1794. Method: http.MethodPost,
  1795. Path: "/pay_recharge",
  1796. Handler: pay_recharge.GetPayRechargeByIdHandler(serverCtx),
  1797. },
  1798. }...,
  1799. ),
  1800. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1801. )
  1802. server.AddRoutes(
  1803. rest.WithMiddlewares(
  1804. []rest.Middleware{serverCtx.Authority},
  1805. []rest.Route{
  1806. {
  1807. Method: http.MethodPost,
  1808. Path: "/whatsapp/create",
  1809. Handler: whatsapp.CreateWhatsappHandler(serverCtx),
  1810. },
  1811. {
  1812. Method: http.MethodPost,
  1813. Path: "/whatsapp/update",
  1814. Handler: whatsapp.UpdateWhatsappHandler(serverCtx),
  1815. },
  1816. {
  1817. Method: http.MethodPost,
  1818. Path: "/whatsapp/delete",
  1819. Handler: whatsapp.DeleteWhatsappHandler(serverCtx),
  1820. },
  1821. {
  1822. Method: http.MethodPost,
  1823. Path: "/whatsapp/list",
  1824. Handler: whatsapp.GetWhatsappListHandler(serverCtx),
  1825. },
  1826. {
  1827. Method: http.MethodPost,
  1828. Path: "/whatsapp",
  1829. Handler: whatsapp.GetWhatsappByIdHandler(serverCtx),
  1830. },
  1831. {
  1832. Method: http.MethodPost,
  1833. Path: "/whatsapp/sendCode",
  1834. Handler: whatsapp.SendWhatsappCodeHandler(serverCtx),
  1835. },
  1836. {
  1837. Method: http.MethodPost,
  1838. Path: "/whatsapp/submitCode",
  1839. Handler: whatsapp.SubmitWhatsappCodeHandler(serverCtx),
  1840. },
  1841. {
  1842. Method: http.MethodPost,
  1843. Path: "/whatsapp/getAutomation",
  1844. Handler: whatsapp.GetAutomationHandler(serverCtx),
  1845. },
  1846. {
  1847. Method: http.MethodPost,
  1848. Path: "/whatsapp/setAutomation",
  1849. Handler: whatsapp.SetAutomationHandler(serverCtx),
  1850. },
  1851. {
  1852. Method: http.MethodPost,
  1853. Path: "/whatsapp/getQrcode",
  1854. Handler: whatsapp.GetQrcodeHandler(serverCtx),
  1855. },
  1856. {
  1857. Method: http.MethodPost,
  1858. Path: "/whatsapp/createQrcode",
  1859. Handler: whatsapp.CreateQrcodeHandler(serverCtx),
  1860. },
  1861. {
  1862. Method: http.MethodPost,
  1863. Path: "/whatsapp/removeQrcode",
  1864. Handler: whatsapp.RemoveQrcodeHandler(serverCtx),
  1865. },
  1866. {
  1867. Method: http.MethodPost,
  1868. Path: "/whatsapp/updateQrcode",
  1869. Handler: whatsapp.UpdateQrcodeHandler(serverCtx),
  1870. },
  1871. {
  1872. Method: http.MethodPost,
  1873. Path: "/whatsapp/getBusinessInfo",
  1874. Handler: whatsapp.GetBusinessInfoHandler(serverCtx),
  1875. },
  1876. {
  1877. Method: http.MethodPost,
  1878. Path: "/whatsapp/setBusinessInfo",
  1879. Handler: whatsapp.SetBusinessInfoHandler(serverCtx),
  1880. },
  1881. {
  1882. Method: http.MethodPost,
  1883. Path: "/whatsapp/registerPhoneNumber",
  1884. Handler: whatsapp.RegisterPhoneNumberHandler(serverCtx),
  1885. },
  1886. {
  1887. Method: http.MethodPost,
  1888. Path: "/whatsapp/deregisterPhoneNumber",
  1889. Handler: whatsapp.DeregisterPhoneNumberHandler(serverCtx),
  1890. },
  1891. {
  1892. Method: http.MethodPost,
  1893. Path: "/whatsapp/updateAgent",
  1894. Handler: whatsapp.UpdateAgentHandler(serverCtx),
  1895. },
  1896. {
  1897. Method: http.MethodPost,
  1898. Path: "/whatsapp/getAllowBlockList",
  1899. Handler: whatsapp.GetAllowBlockListHandler(serverCtx),
  1900. },
  1901. {
  1902. Method: http.MethodPost,
  1903. Path: "/whatsapp/updateAllowAndBlockList",
  1904. Handler: whatsapp.UpdateAllowAndBlockListHandler(serverCtx),
  1905. },
  1906. {
  1907. Method: http.MethodPost,
  1908. Path: "/whatsapp/updateAgentApi",
  1909. Handler: whatsapp.UpdateAgentApiHandler(serverCtx),
  1910. },
  1911. {
  1912. Method: http.MethodPost,
  1913. Path: "/whatsapp/createTemplate",
  1914. Handler: whatsapp.CreateWhatsappTemplateHandler(serverCtx),
  1915. },
  1916. {
  1917. Method: http.MethodPost,
  1918. Path: "/whatsapp/listTemplate",
  1919. Handler: whatsapp.ListWhatsappTemplateHandler(serverCtx),
  1920. },
  1921. {
  1922. Method: http.MethodPost,
  1923. Path: "/whatsapp/removeTemplate",
  1924. Handler: whatsapp.RemoveWhatsappTemplateHandler(serverCtx),
  1925. },
  1926. {
  1927. Method: http.MethodPost,
  1928. Path: "/whatsapp/editTemplate",
  1929. Handler: whatsapp.EditWhatsappTemplateHandler(serverCtx),
  1930. },
  1931. {
  1932. Method: http.MethodPost,
  1933. Path: "/whatsapp/getTemplate",
  1934. Handler: whatsapp.GetWhatsappTemplateHandler(serverCtx),
  1935. },
  1936. }...,
  1937. ),
  1938. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1939. )
  1940. server.AddRoutes(
  1941. rest.WithMiddlewares(
  1942. []rest.Middleware{serverCtx.Authority},
  1943. []rest.Route{
  1944. {
  1945. Method: http.MethodPost,
  1946. Path: "/whatsapp_channel/create",
  1947. Handler: whatsapp_channel.CreateWhatsappChannelHandler(serverCtx),
  1948. },
  1949. {
  1950. Method: http.MethodPost,
  1951. Path: "/whatsapp_channel/update",
  1952. Handler: whatsapp_channel.UpdateWhatsappChannelHandler(serverCtx),
  1953. },
  1954. {
  1955. Method: http.MethodPost,
  1956. Path: "/whatsapp_channel/delete",
  1957. Handler: whatsapp_channel.DeleteWhatsappChannelHandler(serverCtx),
  1958. },
  1959. {
  1960. Method: http.MethodPost,
  1961. Path: "/whatsapp_channel/list",
  1962. Handler: whatsapp_channel.GetWhatsappChannelListHandler(serverCtx),
  1963. },
  1964. {
  1965. Method: http.MethodPost,
  1966. Path: "/whatsapp_channel/search",
  1967. Handler: whatsapp_channel.GetWhatsappChannelSearchHandler(serverCtx),
  1968. },
  1969. {
  1970. Method: http.MethodPost,
  1971. Path: "/whatsapp_channel",
  1972. Handler: whatsapp_channel.GetWhatsappChannelByIdHandler(serverCtx),
  1973. },
  1974. }...,
  1975. ),
  1976. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1977. )
  1978. server.AddRoutes(
  1979. []rest.Route{
  1980. {
  1981. Method: http.MethodPost,
  1982. Path: "/wp/wecom/send_msg",
  1983. Handler: wp_wecom.SendMsgHandler(serverCtx),
  1984. },
  1985. {
  1986. Method: http.MethodPost,
  1987. Path: "/wp/wecom/send_msg_by_chan",
  1988. Handler: wp_wecom.SendMsgByChanHandler(serverCtx),
  1989. },
  1990. },
  1991. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1992. )
  1993. server.AddRoutes(
  1994. rest.WithMiddlewares(
  1995. []rest.Middleware{serverCtx.Authority},
  1996. []rest.Route{
  1997. {
  1998. Method: http.MethodPost,
  1999. Path: "/xunji/create",
  2000. Handler: xunji.CreateXunjiHandler(serverCtx),
  2001. },
  2002. {
  2003. Method: http.MethodPost,
  2004. Path: "/xunji/update",
  2005. Handler: xunji.UpdateXunjiHandler(serverCtx),
  2006. },
  2007. {
  2008. Method: http.MethodPost,
  2009. Path: "/xunji/delete",
  2010. Handler: xunji.DeleteXunjiHandler(serverCtx),
  2011. },
  2012. {
  2013. Method: http.MethodPost,
  2014. Path: "/xunji/list",
  2015. Handler: xunji.GetXunjiListHandler(serverCtx),
  2016. },
  2017. {
  2018. Method: http.MethodPost,
  2019. Path: "/xunji",
  2020. Handler: xunji.GetXunjiByIdHandler(serverCtx),
  2021. },
  2022. }...,
  2023. ),
  2024. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  2025. )
  2026. }