routes.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  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. base "wechat-api/internal/handler/base"
  14. batch_msg "wechat-api/internal/handler/batch_msg"
  15. category "wechat-api/internal/handler/category"
  16. contact "wechat-api/internal/handler/contact"
  17. employee "wechat-api/internal/handler/employee"
  18. employee_config "wechat-api/internal/handler/employee_config"
  19. label "wechat-api/internal/handler/label"
  20. label_relationship "wechat-api/internal/handler/label_relationship"
  21. message_records "wechat-api/internal/handler/message_records"
  22. openapi "wechat-api/internal/handler/openapi"
  23. sop_node "wechat-api/internal/handler/sop_node"
  24. sop_stage "wechat-api/internal/handler/sop_stage"
  25. sop_task "wechat-api/internal/handler/sop_task"
  26. token "wechat-api/internal/handler/token"
  27. tutorial "wechat-api/internal/handler/tutorial"
  28. work_experience "wechat-api/internal/handler/work_experience"
  29. "wechat-api/internal/svc"
  30. "github.com/zeromicro/go-zero/rest"
  31. )
  32. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  33. server.AddRoutes(
  34. []rest.Route{
  35. {
  36. Method: http.MethodGet,
  37. Path: "/init/database",
  38. Handler: base.InitDatabaseHandler(serverCtx),
  39. },
  40. },
  41. )
  42. server.AddRoutes(
  43. rest.WithMiddlewares(
  44. []rest.Middleware{serverCtx.Authority},
  45. []rest.Route{
  46. {
  47. Method: http.MethodPost,
  48. Path: "/server/create",
  49. Handler: WechatServer.CreateServerHandler(serverCtx),
  50. },
  51. {
  52. Method: http.MethodPost,
  53. Path: "/server/update",
  54. Handler: WechatServer.UpdateServerHandler(serverCtx),
  55. },
  56. {
  57. Method: http.MethodPost,
  58. Path: "/server/delete",
  59. Handler: WechatServer.DeleteServerHandler(serverCtx),
  60. },
  61. {
  62. Method: http.MethodPost,
  63. Path: "/server/list",
  64. Handler: WechatServer.GetServerListHandler(serverCtx),
  65. },
  66. {
  67. Method: http.MethodPost,
  68. Path: "/server",
  69. Handler: WechatServer.GetServerByIdHandler(serverCtx),
  70. },
  71. }...,
  72. ),
  73. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  74. )
  75. server.AddRoutes(
  76. rest.WithMiddlewares(
  77. []rest.Middleware{serverCtx.Authority},
  78. []rest.Route{
  79. {
  80. Method: http.MethodPost,
  81. Path: "/wx/create",
  82. Handler: Wx.CreateWxHandler(serverCtx),
  83. },
  84. {
  85. Method: http.MethodPost,
  86. Path: "/wx/check",
  87. Handler: Wx.CheckWxHandler(serverCtx),
  88. },
  89. {
  90. Method: http.MethodPost,
  91. Path: "/wx/update",
  92. Handler: Wx.UpdateWxHandler(serverCtx),
  93. },
  94. {
  95. Method: http.MethodPost,
  96. Path: "/wx/updateBlockAndAllowList",
  97. Handler: Wx.UpdateBlockAndAllowListHandler(serverCtx),
  98. },
  99. {
  100. Method: http.MethodPost,
  101. Path: "/wx/delete",
  102. Handler: Wx.DeleteWxHandler(serverCtx),
  103. },
  104. {
  105. Method: http.MethodPost,
  106. Path: "/wx/list",
  107. Handler: Wx.GetWxListHandler(serverCtx),
  108. },
  109. {
  110. Method: http.MethodPost,
  111. Path: "/wx/getWxAllowBlockList",
  112. Handler: Wx.GetWxAllowBlockListHandler(serverCtx),
  113. },
  114. {
  115. Method: http.MethodPost,
  116. Path: "/wx",
  117. Handler: Wx.GetWxByIdHandler(serverCtx),
  118. },
  119. }...,
  120. ),
  121. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  122. )
  123. server.AddRoutes(
  124. rest.WithMiddlewares(
  125. []rest.Middleware{serverCtx.Authority},
  126. []rest.Route{
  127. {
  128. Method: http.MethodPost,
  129. Path: "/agent/create",
  130. Handler: agent.CreateAgentHandler(serverCtx),
  131. },
  132. {
  133. Method: http.MethodPost,
  134. Path: "/agent/update",
  135. Handler: agent.UpdateAgentHandler(serverCtx),
  136. },
  137. {
  138. Method: http.MethodPost,
  139. Path: "/agent/delete",
  140. Handler: agent.DeleteAgentHandler(serverCtx),
  141. },
  142. {
  143. Method: http.MethodPost,
  144. Path: "/agent/list",
  145. Handler: agent.GetAgentListHandler(serverCtx),
  146. },
  147. {
  148. Method: http.MethodPost,
  149. Path: "/agent",
  150. Handler: agent.GetAgentByIdHandler(serverCtx),
  151. },
  152. {
  153. Method: http.MethodPost,
  154. Path: "/agent/collection/list",
  155. Handler: agent.GetAgentCollectionListHandler(serverCtx),
  156. },
  157. {
  158. Method: http.MethodPost,
  159. Path: "/agent/collection/detail",
  160. Handler: agent.GetAgentCollectionInfoHandler(serverCtx),
  161. },
  162. {
  163. Method: http.MethodPost,
  164. Path: "/agent/data/list",
  165. Handler: agent.GetAgentDataListHandler(serverCtx),
  166. },
  167. {
  168. Method: http.MethodPost,
  169. Path: "/agent/data/detail",
  170. Handler: agent.GetAgentDataDetailHandler(serverCtx),
  171. },
  172. {
  173. Method: http.MethodPost,
  174. Path: "/agent/data/create",
  175. Handler: agent.CreateAgentDataHandler(serverCtx),
  176. },
  177. {
  178. Method: http.MethodPost,
  179. Path: "/agent/data/update",
  180. Handler: agent.UpdateAgentDataHandler(serverCtx),
  181. },
  182. {
  183. Method: http.MethodPost,
  184. Path: "/agent/data/delete",
  185. Handler: agent.DeleteAgentDataHandler(serverCtx),
  186. },
  187. }...,
  188. ),
  189. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  190. )
  191. server.AddRoutes(
  192. rest.WithMiddlewares(
  193. []rest.Middleware{serverCtx.Authority},
  194. []rest.Route{
  195. {
  196. Method: http.MethodPost,
  197. Path: "/label_relationship/create",
  198. Handler: label_relationship.CreateLabelRelationshipHandler(serverCtx),
  199. },
  200. {
  201. Method: http.MethodPost,
  202. Path: "/label_relationship/update",
  203. Handler: label_relationship.UpdateLabelRelationshipHandler(serverCtx),
  204. },
  205. {
  206. Method: http.MethodPost,
  207. Path: "/label_relationship/update_contact_labels",
  208. Handler: label_relationship.UpdateLabelRelationshipsHandler(serverCtx),
  209. },
  210. {
  211. Method: http.MethodPost,
  212. Path: "/label_relationship/batch_update_contact_labels",
  213. Handler: label_relationship.BatchUpdateLabelRelationshipsHandler(serverCtx),
  214. },
  215. {
  216. Method: http.MethodPost,
  217. Path: "/label_relationship/delete",
  218. Handler: label_relationship.DeleteLabelRelationshipHandler(serverCtx),
  219. },
  220. {
  221. Method: http.MethodPost,
  222. Path: "/label_relationship/list",
  223. Handler: label_relationship.GetLabelRelationshipListHandler(serverCtx),
  224. },
  225. {
  226. Method: http.MethodPost,
  227. Path: "/label_relationship",
  228. Handler: label_relationship.GetLabelRelationshipByIdHandler(serverCtx),
  229. },
  230. }...,
  231. ),
  232. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  233. )
  234. server.AddRoutes(
  235. []rest.Route{
  236. {
  237. Method: http.MethodPost,
  238. Path: "/wxhook/sendTextMsg",
  239. Handler: Wxhook.SendTextMsgHandler(serverCtx),
  240. },
  241. },
  242. )
  243. server.AddRoutes(
  244. rest.WithMiddlewares(
  245. []rest.Middleware{serverCtx.Authority},
  246. []rest.Route{
  247. {
  248. Method: http.MethodPost,
  249. Path: "/wxhook/refreshLoginQR",
  250. Handler: Wxhook.RefreshLoginQRHandler(serverCtx),
  251. },
  252. {
  253. Method: http.MethodPost,
  254. Path: "/wxhook/logout",
  255. Handler: Wxhook.LogoutHandler(serverCtx),
  256. },
  257. {
  258. Method: http.MethodPost,
  259. Path: "/wxhook/terminateThisWeChat",
  260. Handler: Wxhook.TerminateThisWeChatHandler(serverCtx),
  261. },
  262. {
  263. Method: http.MethodPost,
  264. Path: "/wxhook/getFriendsAndGroups",
  265. Handler: Wxhook.GetFriendsAndGroupsHandler(serverCtx),
  266. },
  267. {
  268. Method: http.MethodPost,
  269. Path: "/wxhook/sendPicMsg",
  270. Handler: Wxhook.SendPicMsgHandler(serverCtx),
  271. },
  272. {
  273. Method: http.MethodPost,
  274. Path: "/wxhook/sendPicMsgLocal",
  275. Handler: Wxhook.SendPicMsgLocalHandler(serverCtx),
  276. },
  277. }...,
  278. ),
  279. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  280. )
  281. server.AddRoutes(
  282. rest.WithMiddlewares(
  283. []rest.Middleware{serverCtx.Authority},
  284. []rest.Route{
  285. {
  286. Method: http.MethodPost,
  287. Path: "/contact/create",
  288. Handler: contact.CreateContactHandler(serverCtx),
  289. },
  290. {
  291. Method: http.MethodPost,
  292. Path: "/contact/update",
  293. Handler: contact.UpdateContactHandler(serverCtx),
  294. },
  295. {
  296. Method: http.MethodPost,
  297. Path: "/contact/delete",
  298. Handler: contact.DeleteContactHandler(serverCtx),
  299. },
  300. {
  301. Method: http.MethodPost,
  302. Path: "/contact/list",
  303. Handler: contact.GetContactListHandler(serverCtx),
  304. },
  305. {
  306. Method: http.MethodPost,
  307. Path: "/contact",
  308. Handler: contact.GetContactByIdHandler(serverCtx),
  309. },
  310. {
  311. Method: http.MethodPost,
  312. Path: "/contact/addNewFriend",
  313. Handler: contact.AddNewFriendHandler(serverCtx),
  314. },
  315. }...,
  316. ),
  317. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  318. )
  319. server.AddRoutes(
  320. rest.WithMiddlewares(
  321. []rest.Middleware{serverCtx.Authority},
  322. []rest.Route{
  323. {
  324. Method: http.MethodPost,
  325. Path: "/message/create",
  326. Handler: Message.CreateMessageHandler(serverCtx),
  327. },
  328. {
  329. Method: http.MethodPost,
  330. Path: "/message/update",
  331. Handler: Message.UpdateMessageHandler(serverCtx),
  332. },
  333. {
  334. Method: http.MethodPost,
  335. Path: "/message/delete",
  336. Handler: Message.DeleteMessageHandler(serverCtx),
  337. },
  338. {
  339. Method: http.MethodPost,
  340. Path: "/message/list",
  341. Handler: Message.GetMessageListHandler(serverCtx),
  342. },
  343. {
  344. Method: http.MethodPost,
  345. Path: "/message",
  346. Handler: Message.GetMessageByIdHandler(serverCtx),
  347. },
  348. }...,
  349. ),
  350. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  351. )
  352. server.AddRoutes(
  353. rest.WithMiddlewares(
  354. []rest.Middleware{serverCtx.Authority},
  355. []rest.Route{
  356. {
  357. Method: http.MethodPost,
  358. Path: "/label/create",
  359. Handler: label.CreateLabelHandler(serverCtx),
  360. },
  361. {
  362. Method: http.MethodPost,
  363. Path: "/label/update",
  364. Handler: label.UpdateLabelHandler(serverCtx),
  365. },
  366. {
  367. Method: http.MethodPost,
  368. Path: "/label/delete",
  369. Handler: label.DeleteLabelHandler(serverCtx),
  370. },
  371. {
  372. Method: http.MethodPost,
  373. Path: "/label/list",
  374. Handler: label.GetLabelListHandler(serverCtx),
  375. },
  376. {
  377. Method: http.MethodPost,
  378. Path: "/label/select_list",
  379. Handler: label.GetLabelSelectListHandler(serverCtx),
  380. },
  381. {
  382. Method: http.MethodPost,
  383. Path: "/label/batch_select_list",
  384. Handler: label.GetLabelBatchSelectListHandler(serverCtx),
  385. },
  386. {
  387. Method: http.MethodPost,
  388. Path: "/label/contacts",
  389. Handler: label.GetLabelContactsHandler(serverCtx),
  390. },
  391. {
  392. Method: http.MethodPost,
  393. Path: "/label",
  394. Handler: label.GetLabelByIdHandler(serverCtx),
  395. },
  396. }...,
  397. ),
  398. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  399. )
  400. server.AddRoutes(
  401. rest.WithMiddlewares(
  402. []rest.Middleware{serverCtx.Authority},
  403. []rest.Route{
  404. {
  405. Method: http.MethodPost,
  406. Path: "/sop_task/create",
  407. Handler: sop_task.CreateSopTaskHandler(serverCtx),
  408. },
  409. {
  410. Method: http.MethodPost,
  411. Path: "/sop_task/update",
  412. Handler: sop_task.UpdateSopTaskHandler(serverCtx),
  413. },
  414. {
  415. Method: http.MethodPost,
  416. Path: "/sop_task/delete",
  417. Handler: sop_task.DeleteSopTaskHandler(serverCtx),
  418. },
  419. {
  420. Method: http.MethodPost,
  421. Path: "/sop_task/list",
  422. Handler: sop_task.GetSopTaskListHandler(serverCtx),
  423. },
  424. {
  425. Method: http.MethodPost,
  426. Path: "/sop_task/record_list",
  427. Handler: sop_task.GetSopTaskRecordListHandler(serverCtx),
  428. },
  429. {
  430. Method: http.MethodPost,
  431. Path: "/sop_task",
  432. Handler: sop_task.GetSopTaskByIdHandler(serverCtx),
  433. },
  434. {
  435. Method: http.MethodPost,
  436. Path: "/sop_task/detail",
  437. Handler: sop_task.GetSopTaskDetailHandler(serverCtx),
  438. },
  439. {
  440. Method: http.MethodPost,
  441. Path: "/sop_task/publish",
  442. Handler: sop_task.PublishSopTaskHandler(serverCtx),
  443. },
  444. {
  445. Method: http.MethodPost,
  446. Path: "/sop_task/start",
  447. Handler: sop_task.SopTaskStartHandler(serverCtx),
  448. },
  449. {
  450. Method: http.MethodPost,
  451. Path: "/sop_task/stop",
  452. Handler: sop_task.SopTaskStopHandler(serverCtx),
  453. },
  454. }...,
  455. ),
  456. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  457. )
  458. server.AddRoutes(
  459. rest.WithMiddlewares(
  460. []rest.Middleware{serverCtx.Authority},
  461. []rest.Route{
  462. {
  463. Method: http.MethodPost,
  464. Path: "/sop_stage/create",
  465. Handler: sop_stage.CreateSopStageHandler(serverCtx),
  466. },
  467. {
  468. Method: http.MethodPost,
  469. Path: "/sop_stage/update",
  470. Handler: sop_stage.UpdateSopStageHandler(serverCtx),
  471. },
  472. {
  473. Method: http.MethodPost,
  474. Path: "/sop_stage/delete",
  475. Handler: sop_stage.DeleteSopStageHandler(serverCtx),
  476. },
  477. {
  478. Method: http.MethodPost,
  479. Path: "/sop_stage/list",
  480. Handler: sop_stage.GetSopStageListHandler(serverCtx),
  481. },
  482. {
  483. Method: http.MethodPost,
  484. Path: "/sop_stage",
  485. Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
  486. },
  487. {
  488. Method: http.MethodPost,
  489. Path: "/sop_stage/detail",
  490. Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
  491. },
  492. {
  493. Method: http.MethodPost,
  494. Path: "/sop_stage/move",
  495. Handler: sop_stage.MoveSopStageHandler(serverCtx),
  496. },
  497. }...,
  498. ),
  499. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  500. )
  501. server.AddRoutes(
  502. rest.WithMiddlewares(
  503. []rest.Middleware{serverCtx.Authority},
  504. []rest.Route{
  505. {
  506. Method: http.MethodPost,
  507. Path: "/sop_node/create",
  508. Handler: sop_node.CreateSopNodeHandler(serverCtx),
  509. },
  510. {
  511. Method: http.MethodPost,
  512. Path: "/sop_node/update",
  513. Handler: sop_node.UpdateSopNodeHandler(serverCtx),
  514. },
  515. {
  516. Method: http.MethodPost,
  517. Path: "/sop_node/delete",
  518. Handler: sop_node.DeleteSopNodeHandler(serverCtx),
  519. },
  520. {
  521. Method: http.MethodPost,
  522. Path: "/sop_node/list",
  523. Handler: sop_node.GetSopNodeListHandler(serverCtx),
  524. },
  525. {
  526. Method: http.MethodPost,
  527. Path: "/sop_node/detail",
  528. Handler: sop_node.GetSopNodeDetailHandler(serverCtx),
  529. },
  530. }...,
  531. ),
  532. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  533. )
  534. server.AddRoutes(
  535. rest.WithMiddlewares(
  536. []rest.Middleware{serverCtx.Authority},
  537. []rest.Route{
  538. {
  539. Method: http.MethodPost,
  540. Path: "/message_records/create",
  541. Handler: message_records.CreateMessageRecordsHandler(serverCtx),
  542. },
  543. {
  544. Method: http.MethodPost,
  545. Path: "/message_records/update",
  546. Handler: message_records.UpdateMessageRecordsHandler(serverCtx),
  547. },
  548. {
  549. Method: http.MethodPost,
  550. Path: "/message_records/delete",
  551. Handler: message_records.DeleteMessageRecordsHandler(serverCtx),
  552. },
  553. {
  554. Method: http.MethodPost,
  555. Path: "/message_records/list",
  556. Handler: message_records.GetMessageRecordsListHandler(serverCtx),
  557. },
  558. {
  559. Method: http.MethodPost,
  560. Path: "/message_records",
  561. Handler: message_records.GetMessageRecordsByIdHandler(serverCtx),
  562. },
  563. }...,
  564. ),
  565. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  566. )
  567. server.AddRoutes(
  568. rest.WithMiddlewares(
  569. []rest.Middleware{serverCtx.Authority},
  570. []rest.Route{
  571. {
  572. Method: http.MethodPost,
  573. Path: "/chatroom_member/list",
  574. Handler: ChatRoomMember.GetChatroomMemberListHandler(serverCtx),
  575. },
  576. }...,
  577. ),
  578. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  579. )
  580. server.AddRoutes(
  581. rest.WithMiddlewares(
  582. []rest.Middleware{serverCtx.Authority},
  583. []rest.Route{
  584. {
  585. Method: http.MethodGet,
  586. Path: "/user/info",
  587. Handler: User.GetUserInfoHandler(serverCtx),
  588. },
  589. }...,
  590. ),
  591. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  592. )
  593. server.AddRoutes(
  594. []rest.Route{
  595. {
  596. Method: http.MethodPost,
  597. Path: "/contact/getContactByWxid",
  598. Handler: openapi.OpenapiGetContactByWxidHandler(serverCtx),
  599. },
  600. {
  601. Method: http.MethodPost,
  602. Path: "/contact/getContactList",
  603. Handler: openapi.OpenapiGetContactListHandler(serverCtx),
  604. },
  605. },
  606. rest.WithPrefix("/openapi"),
  607. )
  608. server.AddRoutes(
  609. rest.WithMiddlewares(
  610. []rest.Middleware{serverCtx.Authority},
  611. []rest.Route{
  612. {
  613. Method: http.MethodPost,
  614. Path: "/batch_msg/create",
  615. Handler: batch_msg.CreateBatchMsgHandler(serverCtx),
  616. },
  617. {
  618. Method: http.MethodPost,
  619. Path: "/batch_msg/update",
  620. Handler: batch_msg.UpdateBatchMsgHandler(serverCtx),
  621. },
  622. {
  623. Method: http.MethodPost,
  624. Path: "/batch_msg/delete",
  625. Handler: batch_msg.DeleteBatchMsgHandler(serverCtx),
  626. },
  627. {
  628. Method: http.MethodPost,
  629. Path: "/batch_msg/list",
  630. Handler: batch_msg.GetBatchMsgListHandler(serverCtx),
  631. },
  632. {
  633. Method: http.MethodPost,
  634. Path: "/batch_msg",
  635. Handler: batch_msg.GetBatchMsgByIdHandler(serverCtx),
  636. },
  637. {
  638. Method: http.MethodPost,
  639. Path: "/batch_msg/stop",
  640. Handler: batch_msg.StopBatchMsgHandler(serverCtx),
  641. },
  642. }...,
  643. ),
  644. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  645. )
  646. server.AddRoutes(
  647. rest.WithMiddlewares(
  648. []rest.Middleware{serverCtx.Authority},
  649. []rest.Route{
  650. {
  651. Method: http.MethodPost,
  652. Path: "/msg/create",
  653. Handler: Msg.CreateMsgHandler(serverCtx),
  654. },
  655. {
  656. Method: http.MethodPost,
  657. Path: "/msg/update",
  658. Handler: Msg.UpdateMsgHandler(serverCtx),
  659. },
  660. {
  661. Method: http.MethodPost,
  662. Path: "/msg/delete",
  663. Handler: Msg.DeleteMsgHandler(serverCtx),
  664. },
  665. {
  666. Method: http.MethodPost,
  667. Path: "/msg/list",
  668. Handler: Msg.GetMsgListHandler(serverCtx),
  669. },
  670. {
  671. Method: http.MethodPost,
  672. Path: "/msg",
  673. Handler: Msg.GetMsgByIdHandler(serverCtx),
  674. },
  675. }...,
  676. ),
  677. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  678. )
  679. server.AddRoutes(
  680. []rest.Route{
  681. {
  682. Method: http.MethodPost,
  683. Path: "/employee/search",
  684. Handler: employee.GetEmployeeSearchHandler(serverCtx),
  685. },
  686. {
  687. Method: http.MethodPost,
  688. Path: "/employee/search/test",
  689. Handler: employee.GetEmployeeSearchTestHandler(serverCtx),
  690. },
  691. {
  692. Method: http.MethodPost,
  693. Path: "/employee/detail",
  694. Handler: employee.GetEmployeeDetailHandler(serverCtx),
  695. },
  696. },
  697. )
  698. server.AddRoutes(
  699. rest.WithMiddlewares(
  700. []rest.Middleware{serverCtx.Authority},
  701. []rest.Route{
  702. {
  703. Method: http.MethodPost,
  704. Path: "/employee/create",
  705. Handler: employee.CreateEmployeeHandler(serverCtx),
  706. },
  707. {
  708. Method: http.MethodPost,
  709. Path: "/employee/update",
  710. Handler: employee.UpdateEmployeeHandler(serverCtx),
  711. },
  712. {
  713. Method: http.MethodPost,
  714. Path: "/employee/delete",
  715. Handler: employee.DeleteEmployeeHandler(serverCtx),
  716. },
  717. {
  718. Method: http.MethodPost,
  719. Path: "/employee/list",
  720. Handler: employee.GetEmployeeListHandler(serverCtx),
  721. },
  722. {
  723. Method: http.MethodPost,
  724. Path: "/employee",
  725. Handler: employee.GetEmployeeByIdHandler(serverCtx),
  726. },
  727. }...,
  728. ),
  729. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  730. )
  731. server.AddRoutes(
  732. rest.WithMiddlewares(
  733. []rest.Middleware{serverCtx.Authority},
  734. []rest.Route{
  735. {
  736. Method: http.MethodPost,
  737. Path: "/work_experience/create",
  738. Handler: work_experience.CreateWorkExperienceHandler(serverCtx),
  739. },
  740. {
  741. Method: http.MethodPost,
  742. Path: "/work_experience/update",
  743. Handler: work_experience.UpdateWorkExperienceHandler(serverCtx),
  744. },
  745. {
  746. Method: http.MethodPost,
  747. Path: "/work_experience/delete",
  748. Handler: work_experience.DeleteWorkExperienceHandler(serverCtx),
  749. },
  750. {
  751. Method: http.MethodPost,
  752. Path: "/work_experience/list",
  753. Handler: work_experience.GetWorkExperienceListHandler(serverCtx),
  754. },
  755. {
  756. Method: http.MethodPost,
  757. Path: "/work_experience",
  758. Handler: work_experience.GetWorkExperienceByIdHandler(serverCtx),
  759. },
  760. }...,
  761. ),
  762. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  763. )
  764. server.AddRoutes(
  765. rest.WithMiddlewares(
  766. []rest.Middleware{serverCtx.Authority},
  767. []rest.Route{
  768. {
  769. Method: http.MethodPost,
  770. Path: "/tutorial/create",
  771. Handler: tutorial.CreateTutorialHandler(serverCtx),
  772. },
  773. {
  774. Method: http.MethodPost,
  775. Path: "/tutorial/update",
  776. Handler: tutorial.UpdateTutorialHandler(serverCtx),
  777. },
  778. {
  779. Method: http.MethodPost,
  780. Path: "/tutorial/delete",
  781. Handler: tutorial.DeleteTutorialHandler(serverCtx),
  782. },
  783. {
  784. Method: http.MethodPost,
  785. Path: "/tutorial/list",
  786. Handler: tutorial.GetTutorialListHandler(serverCtx),
  787. },
  788. {
  789. Method: http.MethodPost,
  790. Path: "/tutorial",
  791. Handler: tutorial.GetTutorialByIdHandler(serverCtx),
  792. },
  793. }...,
  794. ),
  795. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  796. )
  797. server.AddRoutes(
  798. rest.WithMiddlewares(
  799. []rest.Middleware{serverCtx.Authority},
  800. []rest.Route{
  801. {
  802. Method: http.MethodGet,
  803. Path: "/employee_config/list",
  804. Handler: employee_config.GetEmployeeListConfigHandler(serverCtx),
  805. },
  806. }...,
  807. ),
  808. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  809. )
  810. server.AddRoutes(
  811. []rest.Route{
  812. {
  813. Method: http.MethodPost,
  814. Path: "/token/check",
  815. Handler: token.CheckTokenHandler(serverCtx),
  816. },
  817. },
  818. )
  819. server.AddRoutes(
  820. rest.WithMiddlewares(
  821. []rest.Middleware{serverCtx.Authority},
  822. []rest.Route{
  823. {
  824. Method: http.MethodPost,
  825. Path: "/token/third/create",
  826. Handler: token.CreateTokenHandler(serverCtx),
  827. },
  828. {
  829. Method: http.MethodPost,
  830. Path: "/token/third/update",
  831. Handler: token.UpdateTokenHandler(serverCtx),
  832. },
  833. {
  834. Method: http.MethodPost,
  835. Path: "/token/third/delete",
  836. Handler: token.DeleteTokenHandler(serverCtx),
  837. },
  838. {
  839. Method: http.MethodPost,
  840. Path: "/token/third/list",
  841. Handler: token.GetTokenListHandler(serverCtx),
  842. },
  843. {
  844. Method: http.MethodPost,
  845. Path: "/token/third/detail",
  846. Handler: token.GetTokenByIdHandler(serverCtx),
  847. },
  848. }...,
  849. ),
  850. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  851. )
  852. server.AddRoutes(
  853. []rest.Route{
  854. {
  855. Method: http.MethodPost,
  856. Path: "/category/list",
  857. Handler: category.GetCategoryListHandler(serverCtx),
  858. },
  859. {
  860. Method: http.MethodPost,
  861. Path: "/category",
  862. Handler: category.GetCategoryByIdHandler(serverCtx),
  863. },
  864. },
  865. )
  866. server.AddRoutes(
  867. rest.WithMiddlewares(
  868. []rest.Middleware{serverCtx.Authority},
  869. []rest.Route{
  870. {
  871. Method: http.MethodPost,
  872. Path: "/category/create",
  873. Handler: category.CreateCategoryHandler(serverCtx),
  874. },
  875. {
  876. Method: http.MethodPost,
  877. Path: "/category/update",
  878. Handler: category.UpdateCategoryHandler(serverCtx),
  879. },
  880. {
  881. Method: http.MethodPost,
  882. Path: "/category/delete",
  883. Handler: category.DeleteCategoryHandler(serverCtx),
  884. },
  885. }...,
  886. ),
  887. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  888. )
  889. }