routes.go 52 KB

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