routes.go 54 KB

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