routes.go 36 KB

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