routes.go 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  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. ),
  1005. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1006. )
  1007. server.AddRoutes(
  1008. rest.WithMiddlewares(
  1009. []rest.Middleware{serverCtx.Authority},
  1010. []rest.Route{
  1011. {
  1012. Method: http.MethodPost,
  1013. Path: "/chat_records/create",
  1014. Handler: chatrecords.CreateChatRecordsHandler(serverCtx),
  1015. },
  1016. {
  1017. Method: http.MethodPost,
  1018. Path: "/chat_records/update",
  1019. Handler: chatrecords.UpdateChatRecordsHandler(serverCtx),
  1020. },
  1021. {
  1022. Method: http.MethodPost,
  1023. Path: "/chat_records/delete",
  1024. Handler: chatrecords.DeleteChatRecordsHandler(serverCtx),
  1025. },
  1026. {
  1027. Method: http.MethodPost,
  1028. Path: "/chat_records/list",
  1029. Handler: chatrecords.GetChatRecordsListHandler(serverCtx),
  1030. },
  1031. {
  1032. Method: http.MethodPost,
  1033. Path: "/chat_records",
  1034. Handler: chatrecords.GetChatRecordsByIdHandler(serverCtx),
  1035. },
  1036. }...,
  1037. ),
  1038. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1039. )
  1040. server.AddRoutes(
  1041. rest.WithMiddlewares(
  1042. []rest.Middleware{serverCtx.Miniprogram},
  1043. []rest.Route{
  1044. {
  1045. Method: http.MethodPost,
  1046. Path: "/api/session/list",
  1047. Handler: chatsession.GetApiSessionListHandler(serverCtx),
  1048. },
  1049. {
  1050. Method: http.MethodPost,
  1051. Path: "/api/session/update",
  1052. Handler: chatsession.UpdateApiSessionHandler(serverCtx),
  1053. },
  1054. {
  1055. Method: http.MethodPost,
  1056. Path: "/api/session/delete",
  1057. Handler: chatsession.DeleteApiSessionHandler(serverCtx),
  1058. },
  1059. }...,
  1060. ),
  1061. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1062. )
  1063. server.AddRoutes(
  1064. rest.WithMiddlewares(
  1065. []rest.Middleware{serverCtx.Authority},
  1066. []rest.Route{
  1067. {
  1068. Method: http.MethodPost,
  1069. Path: "/chat_session/create",
  1070. Handler: chatsession.CreateChatSessionHandler(serverCtx),
  1071. },
  1072. {
  1073. Method: http.MethodPost,
  1074. Path: "/chat_session/update",
  1075. Handler: chatsession.UpdateChatSessionHandler(serverCtx),
  1076. },
  1077. {
  1078. Method: http.MethodPost,
  1079. Path: "/chat_session/delete",
  1080. Handler: chatsession.DeleteChatSessionHandler(serverCtx),
  1081. },
  1082. {
  1083. Method: http.MethodPost,
  1084. Path: "/chat_session/list",
  1085. Handler: chatsession.GetChatSessionListHandler(serverCtx),
  1086. },
  1087. {
  1088. Method: http.MethodPost,
  1089. Path: "/chat_session",
  1090. Handler: chatsession.GetChatSessionByIdHandler(serverCtx),
  1091. },
  1092. }...,
  1093. ),
  1094. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1095. )
  1096. server.AddRoutes(
  1097. rest.WithMiddlewares(
  1098. []rest.Middleware{serverCtx.Miniprogram},
  1099. []rest.Route{
  1100. {
  1101. Method: http.MethodPost,
  1102. Path: "/api/card/detail",
  1103. Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
  1104. },
  1105. }...,
  1106. ),
  1107. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1108. )
  1109. server.AddRoutes(
  1110. []rest.Route{
  1111. {
  1112. Method: http.MethodGet,
  1113. Path: "/api/card/qrcode",
  1114. Handler: wxcard.GetApiWxCardQrcodeHandler(serverCtx),
  1115. },
  1116. },
  1117. )
  1118. server.AddRoutes(
  1119. rest.WithMiddlewares(
  1120. []rest.Middleware{serverCtx.Authority},
  1121. []rest.Route{
  1122. {
  1123. Method: http.MethodPost,
  1124. Path: "/wx_card/create",
  1125. Handler: wxcard.CreateWxCardHandler(serverCtx),
  1126. },
  1127. {
  1128. Method: http.MethodPost,
  1129. Path: "/wx_card/update",
  1130. Handler: wxcard.UpdateWxCardHandler(serverCtx),
  1131. },
  1132. {
  1133. Method: http.MethodPost,
  1134. Path: "/wx_card/delete",
  1135. Handler: wxcard.DeleteWxCardHandler(serverCtx),
  1136. },
  1137. {
  1138. Method: http.MethodPost,
  1139. Path: "/wx_card/list",
  1140. Handler: wxcard.GetWxCardListHandler(serverCtx),
  1141. },
  1142. {
  1143. Method: http.MethodPost,
  1144. Path: "/wx_card",
  1145. Handler: wxcard.GetWxCardByIdHandler(serverCtx),
  1146. },
  1147. }...,
  1148. ),
  1149. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1150. )
  1151. server.AddRoutes(
  1152. rest.WithMiddlewares(
  1153. []rest.Middleware{serverCtx.Miniprogram},
  1154. []rest.Route{
  1155. {
  1156. Method: http.MethodPost,
  1157. Path: "/api/user/update",
  1158. Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
  1159. },
  1160. }...,
  1161. ),
  1162. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1163. )
  1164. server.AddRoutes(
  1165. rest.WithMiddlewares(
  1166. []rest.Middleware{serverCtx.Authority},
  1167. []rest.Route{
  1168. {
  1169. Method: http.MethodPost,
  1170. Path: "/wx_card_user/create",
  1171. Handler: wxcarduser.CreateWxCardUserHandler(serverCtx),
  1172. },
  1173. {
  1174. Method: http.MethodPost,
  1175. Path: "/wx_card_user/update",
  1176. Handler: wxcarduser.UpdateWxCardUserHandler(serverCtx),
  1177. },
  1178. {
  1179. Method: http.MethodPost,
  1180. Path: "/wx_card_user/delete",
  1181. Handler: wxcarduser.DeleteWxCardUserHandler(serverCtx),
  1182. },
  1183. {
  1184. Method: http.MethodPost,
  1185. Path: "/wx_card_user/list",
  1186. Handler: wxcarduser.GetWxCardUserListHandler(serverCtx),
  1187. },
  1188. {
  1189. Method: http.MethodPost,
  1190. Path: "/wx_card_user",
  1191. Handler: wxcarduser.GetWxCardUserByIdHandler(serverCtx),
  1192. },
  1193. }...,
  1194. ),
  1195. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1196. )
  1197. server.AddRoutes(
  1198. rest.WithMiddlewares(
  1199. []rest.Middleware{serverCtx.Miniprogram},
  1200. []rest.Route{
  1201. {
  1202. Method: http.MethodPost,
  1203. Path: "/api/card/visit",
  1204. Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
  1205. },
  1206. {
  1207. Method: http.MethodPost,
  1208. Path: "/api/card/visit/history",
  1209. Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
  1210. },
  1211. }...,
  1212. ),
  1213. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1214. )
  1215. server.AddRoutes(
  1216. rest.WithMiddlewares(
  1217. []rest.Middleware{serverCtx.Authority},
  1218. []rest.Route{
  1219. {
  1220. Method: http.MethodPost,
  1221. Path: "/wx_card_visit/create",
  1222. Handler: wxcardvisit.CreateWxCardVisitHandler(serverCtx),
  1223. },
  1224. {
  1225. Method: http.MethodPost,
  1226. Path: "/wx_card_visit/update",
  1227. Handler: wxcardvisit.UpdateWxCardVisitHandler(serverCtx),
  1228. },
  1229. {
  1230. Method: http.MethodPost,
  1231. Path: "/wx_card_visit/delete",
  1232. Handler: wxcardvisit.DeleteWxCardVisitHandler(serverCtx),
  1233. },
  1234. {
  1235. Method: http.MethodPost,
  1236. Path: "/wx_card_visit/list",
  1237. Handler: wxcardvisit.GetWxCardVisitListHandler(serverCtx),
  1238. },
  1239. {
  1240. Method: http.MethodPost,
  1241. Path: "/wx_card_visit",
  1242. Handler: wxcardvisit.GetWxCardVisitByIdHandler(serverCtx),
  1243. },
  1244. }...,
  1245. ),
  1246. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1247. )
  1248. server.AddRoutes(
  1249. rest.WithMiddlewares(
  1250. []rest.Middleware{serverCtx.Miniprogram},
  1251. []rest.Route{
  1252. {
  1253. Method: http.MethodPost,
  1254. Path: "/api/avatar/config",
  1255. Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
  1256. },
  1257. }...,
  1258. ),
  1259. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1260. )
  1261. }