routes.go 40 KB

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