routes.go 32 KB

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