routes.go 35 KB

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