routes.go 45 KB

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