routes.go 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  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.WithMiddlewares(
  717. []rest.Middleware{serverCtx.Miniprogram},
  718. []rest.Route{
  719. {
  720. Method: http.MethodPost,
  721. Path: "/api/employee/list",
  722. Handler: employee.GetApiEmployeeListHandler(serverCtx),
  723. },
  724. {
  725. Method: http.MethodPost,
  726. Path: "/api/employee/detail",
  727. Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
  728. },
  729. }...,
  730. ),
  731. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  732. )
  733. server.AddRoutes(
  734. []rest.Route{
  735. {
  736. Method: http.MethodPost,
  737. Path: "/employee/search",
  738. Handler: employee.GetEmployeeSearchHandler(serverCtx),
  739. },
  740. {
  741. Method: http.MethodPost,
  742. Path: "/employee/search/test",
  743. Handler: employee.GetEmployeeSearchTestHandler(serverCtx),
  744. },
  745. {
  746. Method: http.MethodPost,
  747. Path: "/employee/detail",
  748. Handler: employee.GetEmployeeDetailHandler(serverCtx),
  749. },
  750. },
  751. )
  752. server.AddRoutes(
  753. rest.WithMiddlewares(
  754. []rest.Middleware{serverCtx.Authority},
  755. []rest.Route{
  756. {
  757. Method: http.MethodPost,
  758. Path: "/employee/create",
  759. Handler: employee.CreateEmployeeHandler(serverCtx),
  760. },
  761. {
  762. Method: http.MethodPost,
  763. Path: "/employee/update",
  764. Handler: employee.UpdateEmployeeHandler(serverCtx),
  765. },
  766. {
  767. Method: http.MethodPost,
  768. Path: "/employee/delete",
  769. Handler: employee.DeleteEmployeeHandler(serverCtx),
  770. },
  771. {
  772. Method: http.MethodPost,
  773. Path: "/employee/list",
  774. Handler: employee.GetEmployeeListHandler(serverCtx),
  775. },
  776. {
  777. Method: http.MethodPost,
  778. Path: "/employee",
  779. Handler: employee.GetEmployeeByIdHandler(serverCtx),
  780. },
  781. }...,
  782. ),
  783. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  784. )
  785. server.AddRoutes(
  786. rest.WithMiddlewares(
  787. []rest.Middleware{serverCtx.Authority},
  788. []rest.Route{
  789. {
  790. Method: http.MethodPost,
  791. Path: "/work_experience/create",
  792. Handler: work_experience.CreateWorkExperienceHandler(serverCtx),
  793. },
  794. {
  795. Method: http.MethodPost,
  796. Path: "/work_experience/update",
  797. Handler: work_experience.UpdateWorkExperienceHandler(serverCtx),
  798. },
  799. {
  800. Method: http.MethodPost,
  801. Path: "/work_experience/delete",
  802. Handler: work_experience.DeleteWorkExperienceHandler(serverCtx),
  803. },
  804. {
  805. Method: http.MethodPost,
  806. Path: "/work_experience/list",
  807. Handler: work_experience.GetWorkExperienceListHandler(serverCtx),
  808. },
  809. {
  810. Method: http.MethodPost,
  811. Path: "/work_experience",
  812. Handler: work_experience.GetWorkExperienceByIdHandler(serverCtx),
  813. },
  814. }...,
  815. ),
  816. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  817. )
  818. server.AddRoutes(
  819. rest.WithMiddlewares(
  820. []rest.Middleware{serverCtx.Authority},
  821. []rest.Route{
  822. {
  823. Method: http.MethodPost,
  824. Path: "/tutorial/create",
  825. Handler: tutorial.CreateTutorialHandler(serverCtx),
  826. },
  827. {
  828. Method: http.MethodPost,
  829. Path: "/tutorial/update",
  830. Handler: tutorial.UpdateTutorialHandler(serverCtx),
  831. },
  832. {
  833. Method: http.MethodPost,
  834. Path: "/tutorial/delete",
  835. Handler: tutorial.DeleteTutorialHandler(serverCtx),
  836. },
  837. {
  838. Method: http.MethodPost,
  839. Path: "/tutorial/list",
  840. Handler: tutorial.GetTutorialListHandler(serverCtx),
  841. },
  842. {
  843. Method: http.MethodPost,
  844. Path: "/tutorial",
  845. Handler: tutorial.GetTutorialByIdHandler(serverCtx),
  846. },
  847. }...,
  848. ),
  849. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  850. )
  851. server.AddRoutes(
  852. rest.WithMiddlewares(
  853. []rest.Middleware{serverCtx.Authority},
  854. []rest.Route{
  855. {
  856. Method: http.MethodGet,
  857. Path: "/employee_config/list",
  858. Handler: employee_config.GetEmployeeListConfigHandler(serverCtx),
  859. },
  860. }...,
  861. ),
  862. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  863. )
  864. server.AddRoutes(
  865. []rest.Route{
  866. {
  867. Method: http.MethodPost,
  868. Path: "/token/check",
  869. Handler: token.CheckTokenHandler(serverCtx),
  870. },
  871. },
  872. )
  873. server.AddRoutes(
  874. rest.WithMiddlewares(
  875. []rest.Middleware{serverCtx.Authority},
  876. []rest.Route{
  877. {
  878. Method: http.MethodPost,
  879. Path: "/token/third/create",
  880. Handler: token.CreateTokenHandler(serverCtx),
  881. },
  882. {
  883. Method: http.MethodPost,
  884. Path: "/token/third/update",
  885. Handler: token.UpdateTokenHandler(serverCtx),
  886. },
  887. {
  888. Method: http.MethodPost,
  889. Path: "/token/third/delete",
  890. Handler: token.DeleteTokenHandler(serverCtx),
  891. },
  892. {
  893. Method: http.MethodPost,
  894. Path: "/token/third/list",
  895. Handler: token.GetTokenListHandler(serverCtx),
  896. },
  897. {
  898. Method: http.MethodPost,
  899. Path: "/token/third/detail",
  900. Handler: token.GetTokenByIdHandler(serverCtx),
  901. },
  902. }...,
  903. ),
  904. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  905. )
  906. server.AddRoutes(
  907. rest.WithMiddlewares(
  908. []rest.Middleware{serverCtx.Miniprogram},
  909. []rest.Route{
  910. {
  911. Method: http.MethodPost,
  912. Path: "/api/category/list",
  913. Handler: category.GetApiCategoryListHandler(serverCtx),
  914. },
  915. }...,
  916. ),
  917. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  918. )
  919. server.AddRoutes(
  920. []rest.Route{
  921. {
  922. Method: http.MethodPost,
  923. Path: "/category/list",
  924. Handler: category.GetCategoryListHandler(serverCtx),
  925. },
  926. {
  927. Method: http.MethodPost,
  928. Path: "/category",
  929. Handler: category.GetCategoryByIdHandler(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: "/category/create",
  940. Handler: category.CreateCategoryHandler(serverCtx),
  941. },
  942. {
  943. Method: http.MethodPost,
  944. Path: "/category/update",
  945. Handler: category.UpdateCategoryHandler(serverCtx),
  946. },
  947. {
  948. Method: http.MethodPost,
  949. Path: "/category/delete",
  950. Handler: category.DeleteCategoryHandler(serverCtx),
  951. },
  952. }...,
  953. ),
  954. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  955. )
  956. server.AddRoutes(
  957. rest.WithMiddlewares(
  958. []rest.Middleware{serverCtx.Authority},
  959. []rest.Route{
  960. {
  961. Method: http.MethodPost,
  962. Path: "/agent_base/create",
  963. Handler: agent_base.CreateAgentBaseHandler(serverCtx),
  964. },
  965. {
  966. Method: http.MethodPost,
  967. Path: "/agent_base/update",
  968. Handler: agent_base.UpdateAgentBaseHandler(serverCtx),
  969. },
  970. {
  971. Method: http.MethodPost,
  972. Path: "/agent_base/delete",
  973. Handler: agent_base.DeleteAgentBaseHandler(serverCtx),
  974. },
  975. {
  976. Method: http.MethodPost,
  977. Path: "/agent_base/list",
  978. Handler: agent_base.GetAgentBaseListHandler(serverCtx),
  979. },
  980. {
  981. Method: http.MethodPost,
  982. Path: "/agent_base",
  983. Handler: agent_base.GetAgentBaseByIdHandler(serverCtx),
  984. },
  985. }...,
  986. ),
  987. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  988. )
  989. server.AddRoutes(
  990. rest.WithMiddlewares(
  991. []rest.Middleware{serverCtx.Miniprogram},
  992. []rest.Route{
  993. {
  994. Method: http.MethodPost,
  995. Path: "/api/chat/create",
  996. Handler: chatrecords.SubmitApiChatHandler(serverCtx),
  997. },
  998. {
  999. Method: http.MethodPost,
  1000. Path: "/api/chat/list",
  1001. Handler: chatrecords.GetApiChatListHandler(serverCtx),
  1002. },
  1003. {
  1004. Method: http.MethodPost,
  1005. Path: "/api/chat/save",
  1006. Handler: chatrecords.SaveApiChatHandler(serverCtx),
  1007. },
  1008. }...,
  1009. ),
  1010. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1011. )
  1012. server.AddRoutes(
  1013. rest.WithMiddlewares(
  1014. []rest.Middleware{serverCtx.Authority},
  1015. []rest.Route{
  1016. {
  1017. Method: http.MethodPost,
  1018. Path: "/chat_records/create",
  1019. Handler: chatrecords.CreateChatRecordsHandler(serverCtx),
  1020. },
  1021. {
  1022. Method: http.MethodPost,
  1023. Path: "/chat_records/update",
  1024. Handler: chatrecords.UpdateChatRecordsHandler(serverCtx),
  1025. },
  1026. {
  1027. Method: http.MethodPost,
  1028. Path: "/chat_records/delete",
  1029. Handler: chatrecords.DeleteChatRecordsHandler(serverCtx),
  1030. },
  1031. {
  1032. Method: http.MethodPost,
  1033. Path: "/chat_records/list",
  1034. Handler: chatrecords.GetChatRecordsListHandler(serverCtx),
  1035. },
  1036. {
  1037. Method: http.MethodPost,
  1038. Path: "/chat_records",
  1039. Handler: chatrecords.GetChatRecordsByIdHandler(serverCtx),
  1040. },
  1041. }...,
  1042. ),
  1043. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1044. )
  1045. server.AddRoutes(
  1046. rest.WithMiddlewares(
  1047. []rest.Middleware{serverCtx.Miniprogram},
  1048. []rest.Route{
  1049. {
  1050. Method: http.MethodPost,
  1051. Path: "/api/session/list",
  1052. Handler: chatsession.GetApiSessionListHandler(serverCtx),
  1053. },
  1054. {
  1055. Method: http.MethodPost,
  1056. Path: "/api/session/update",
  1057. Handler: chatsession.UpdateApiSessionHandler(serverCtx),
  1058. },
  1059. {
  1060. Method: http.MethodPost,
  1061. Path: "/api/session/delete",
  1062. Handler: chatsession.DeleteApiSessionHandler(serverCtx),
  1063. },
  1064. }...,
  1065. ),
  1066. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1067. )
  1068. server.AddRoutes(
  1069. rest.WithMiddlewares(
  1070. []rest.Middleware{serverCtx.Authority},
  1071. []rest.Route{
  1072. {
  1073. Method: http.MethodPost,
  1074. Path: "/chat_session/create",
  1075. Handler: chatsession.CreateChatSessionHandler(serverCtx),
  1076. },
  1077. {
  1078. Method: http.MethodPost,
  1079. Path: "/chat_session/update",
  1080. Handler: chatsession.UpdateChatSessionHandler(serverCtx),
  1081. },
  1082. {
  1083. Method: http.MethodPost,
  1084. Path: "/chat_session/delete",
  1085. Handler: chatsession.DeleteChatSessionHandler(serverCtx),
  1086. },
  1087. {
  1088. Method: http.MethodPost,
  1089. Path: "/chat_session/list",
  1090. Handler: chatsession.GetChatSessionListHandler(serverCtx),
  1091. },
  1092. {
  1093. Method: http.MethodPost,
  1094. Path: "/chat_session",
  1095. Handler: chatsession.GetChatSessionByIdHandler(serverCtx),
  1096. },
  1097. }...,
  1098. ),
  1099. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1100. )
  1101. server.AddRoutes(
  1102. rest.WithMiddlewares(
  1103. []rest.Middleware{serverCtx.Miniprogram},
  1104. []rest.Route{
  1105. {
  1106. Method: http.MethodPost,
  1107. Path: "/api/card/detail",
  1108. Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
  1109. },
  1110. }...,
  1111. ),
  1112. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1113. )
  1114. server.AddRoutes(
  1115. rest.WithMiddlewares(
  1116. []rest.Middleware{serverCtx.Authority},
  1117. []rest.Route{
  1118. {
  1119. Method: http.MethodPost,
  1120. Path: "/wx_card/create",
  1121. Handler: wxcard.CreateWxCardHandler(serverCtx),
  1122. },
  1123. {
  1124. Method: http.MethodPost,
  1125. Path: "/wx_card/update",
  1126. Handler: wxcard.UpdateWxCardHandler(serverCtx),
  1127. },
  1128. {
  1129. Method: http.MethodPost,
  1130. Path: "/wx_card/delete",
  1131. Handler: wxcard.DeleteWxCardHandler(serverCtx),
  1132. },
  1133. {
  1134. Method: http.MethodPost,
  1135. Path: "/wx_card/list",
  1136. Handler: wxcard.GetWxCardListHandler(serverCtx),
  1137. },
  1138. {
  1139. Method: http.MethodPost,
  1140. Path: "/wx_card",
  1141. Handler: wxcard.GetWxCardByIdHandler(serverCtx),
  1142. },
  1143. }...,
  1144. ),
  1145. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1146. )
  1147. server.AddRoutes(
  1148. rest.WithMiddlewares(
  1149. []rest.Middleware{serverCtx.Miniprogram},
  1150. []rest.Route{
  1151. {
  1152. Method: http.MethodPost,
  1153. Path: "/api/user/update",
  1154. Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
  1155. },
  1156. }...,
  1157. ),
  1158. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1159. )
  1160. server.AddRoutes(
  1161. rest.WithMiddlewares(
  1162. []rest.Middleware{serverCtx.Authority},
  1163. []rest.Route{
  1164. {
  1165. Method: http.MethodPost,
  1166. Path: "/wx_card_user/create",
  1167. Handler: wxcarduser.CreateWxCardUserHandler(serverCtx),
  1168. },
  1169. {
  1170. Method: http.MethodPost,
  1171. Path: "/wx_card_user/update",
  1172. Handler: wxcarduser.UpdateWxCardUserHandler(serverCtx),
  1173. },
  1174. {
  1175. Method: http.MethodPost,
  1176. Path: "/wx_card_user/delete",
  1177. Handler: wxcarduser.DeleteWxCardUserHandler(serverCtx),
  1178. },
  1179. {
  1180. Method: http.MethodPost,
  1181. Path: "/wx_card_user/list",
  1182. Handler: wxcarduser.GetWxCardUserListHandler(serverCtx),
  1183. },
  1184. {
  1185. Method: http.MethodPost,
  1186. Path: "/wx_card_user",
  1187. Handler: wxcarduser.GetWxCardUserByIdHandler(serverCtx),
  1188. },
  1189. }...,
  1190. ),
  1191. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1192. )
  1193. server.AddRoutes(
  1194. rest.WithMiddlewares(
  1195. []rest.Middleware{serverCtx.Miniprogram},
  1196. []rest.Route{
  1197. {
  1198. Method: http.MethodPost,
  1199. Path: "/api/card/visit",
  1200. Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
  1201. },
  1202. {
  1203. Method: http.MethodPost,
  1204. Path: "/api/card/visit/history",
  1205. Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
  1206. },
  1207. }...,
  1208. ),
  1209. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1210. )
  1211. server.AddRoutes(
  1212. rest.WithMiddlewares(
  1213. []rest.Middleware{serverCtx.Authority},
  1214. []rest.Route{
  1215. {
  1216. Method: http.MethodPost,
  1217. Path: "/wx_card_visit/create",
  1218. Handler: wxcardvisit.CreateWxCardVisitHandler(serverCtx),
  1219. },
  1220. {
  1221. Method: http.MethodPost,
  1222. Path: "/wx_card_visit/update",
  1223. Handler: wxcardvisit.UpdateWxCardVisitHandler(serverCtx),
  1224. },
  1225. {
  1226. Method: http.MethodPost,
  1227. Path: "/wx_card_visit/delete",
  1228. Handler: wxcardvisit.DeleteWxCardVisitHandler(serverCtx),
  1229. },
  1230. {
  1231. Method: http.MethodPost,
  1232. Path: "/wx_card_visit/list",
  1233. Handler: wxcardvisit.GetWxCardVisitListHandler(serverCtx),
  1234. },
  1235. {
  1236. Method: http.MethodPost,
  1237. Path: "/wx_card_visit",
  1238. Handler: wxcardvisit.GetWxCardVisitByIdHandler(serverCtx),
  1239. },
  1240. }...,
  1241. ),
  1242. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1243. )
  1244. server.AddRoutes(
  1245. rest.WithMiddlewares(
  1246. []rest.Middleware{serverCtx.Miniprogram},
  1247. []rest.Route{
  1248. {
  1249. Method: http.MethodPost,
  1250. Path: "/api/avatar/config",
  1251. Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
  1252. },
  1253. }...,
  1254. ),
  1255. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1256. )
  1257. }