routes.go 32 KB

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