routes.go 57 KB

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