routes.go 44 KB

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