routes.go 19 KB

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