routes.go 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  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.Route{
  506. {
  507. Method: http.MethodPost,
  508. Path: "/sop_stage/create",
  509. Handler: sop_stage.CreateSopStageHandler(serverCtx),
  510. },
  511. {
  512. Method: http.MethodPost,
  513. Path: "/sop_stage/update",
  514. Handler: sop_stage.UpdateSopStageHandler(serverCtx),
  515. },
  516. {
  517. Method: http.MethodPost,
  518. Path: "/sop_stage/delete",
  519. Handler: sop_stage.DeleteSopStageHandler(serverCtx),
  520. },
  521. {
  522. Method: http.MethodPost,
  523. Path: "/sop_stage/list",
  524. Handler: sop_stage.GetSopStageListHandler(serverCtx),
  525. },
  526. {
  527. Method: http.MethodPost,
  528. Path: "/sop_stage",
  529. Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
  530. },
  531. {
  532. Method: http.MethodPost,
  533. Path: "/sop_stage/detail",
  534. Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
  535. },
  536. {
  537. Method: http.MethodPost,
  538. Path: "/sop_stage/move",
  539. Handler: sop_stage.MoveSopStageHandler(serverCtx),
  540. },
  541. },
  542. )
  543. server.AddRoutes(
  544. []rest.Route{
  545. {
  546. Method: http.MethodPost,
  547. Path: "/api/sop_node/list",
  548. Handler: sop_node.GetApiSopNodeListHandler(serverCtx),
  549. },
  550. },
  551. )
  552. server.AddRoutes(
  553. rest.WithMiddlewares(
  554. []rest.Middleware{serverCtx.Authority},
  555. []rest.Route{
  556. {
  557. Method: http.MethodPost,
  558. Path: "/sop_node/create",
  559. Handler: sop_node.CreateSopNodeHandler(serverCtx),
  560. },
  561. {
  562. Method: http.MethodPost,
  563. Path: "/sop_node/update",
  564. Handler: sop_node.UpdateSopNodeHandler(serverCtx),
  565. },
  566. {
  567. Method: http.MethodPost,
  568. Path: "/sop_node/delete",
  569. Handler: sop_node.DeleteSopNodeHandler(serverCtx),
  570. },
  571. {
  572. Method: http.MethodPost,
  573. Path: "/sop_node/list",
  574. Handler: sop_node.GetSopNodeListHandler(serverCtx),
  575. },
  576. {
  577. Method: http.MethodPost,
  578. Path: "/sop_node/detail",
  579. Handler: sop_node.GetSopNodeDetailHandler(serverCtx),
  580. },
  581. }...,
  582. ),
  583. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  584. )
  585. server.AddRoutes(
  586. rest.WithMiddlewares(
  587. []rest.Middleware{serverCtx.Authority},
  588. []rest.Route{
  589. {
  590. Method: http.MethodPost,
  591. Path: "/message_records/create",
  592. Handler: message_records.CreateMessageRecordsHandler(serverCtx),
  593. },
  594. {
  595. Method: http.MethodPost,
  596. Path: "/message_records/update",
  597. Handler: message_records.UpdateMessageRecordsHandler(serverCtx),
  598. },
  599. {
  600. Method: http.MethodPost,
  601. Path: "/message_records/delete",
  602. Handler: message_records.DeleteMessageRecordsHandler(serverCtx),
  603. },
  604. {
  605. Method: http.MethodPost,
  606. Path: "/message_records/list",
  607. Handler: message_records.GetMessageRecordsListHandler(serverCtx),
  608. },
  609. {
  610. Method: http.MethodPost,
  611. Path: "/message_records",
  612. Handler: message_records.GetMessageRecordsByIdHandler(serverCtx),
  613. },
  614. }...,
  615. ),
  616. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  617. )
  618. server.AddRoutes(
  619. rest.WithMiddlewares(
  620. []rest.Middleware{serverCtx.Authority},
  621. []rest.Route{
  622. {
  623. Method: http.MethodPost,
  624. Path: "/chatroom_member/list",
  625. Handler: ChatRoomMember.GetChatroomMemberListHandler(serverCtx),
  626. },
  627. }...,
  628. ),
  629. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  630. )
  631. server.AddRoutes(
  632. []rest.Route{
  633. {
  634. Method: http.MethodPost,
  635. Path: "/api/user/login",
  636. Handler: User.DoApiUserLoginHandler(serverCtx),
  637. },
  638. },
  639. )
  640. server.AddRoutes(
  641. rest.WithMiddlewares(
  642. []rest.Middleware{serverCtx.Miniprogram},
  643. []rest.Route{
  644. {
  645. Method: http.MethodPost,
  646. Path: "/api/user/vip",
  647. Handler: User.GetApiUserVipHandler(serverCtx),
  648. },
  649. }...,
  650. ),
  651. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  652. )
  653. server.AddRoutes(
  654. rest.WithMiddlewares(
  655. []rest.Middleware{serverCtx.Authority},
  656. []rest.Route{
  657. {
  658. Method: http.MethodGet,
  659. Path: "/user/info",
  660. Handler: User.GetUserInfoHandler(serverCtx),
  661. },
  662. }...,
  663. ),
  664. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  665. )
  666. server.AddRoutes(
  667. []rest.Route{
  668. {
  669. Method: http.MethodPost,
  670. Path: "/contact/getContactByWxid",
  671. Handler: openapi.OpenapiGetContactByWxidHandler(serverCtx),
  672. },
  673. {
  674. Method: http.MethodPost,
  675. Path: "/contact/getContactList",
  676. Handler: openapi.OpenapiGetContactListHandler(serverCtx),
  677. },
  678. },
  679. rest.WithPrefix("/openapi"),
  680. )
  681. server.AddRoutes(
  682. rest.WithMiddlewares(
  683. []rest.Middleware{serverCtx.Authority},
  684. []rest.Route{
  685. {
  686. Method: http.MethodPost,
  687. Path: "/batch_msg/create",
  688. Handler: batch_msg.CreateBatchMsgHandler(serverCtx),
  689. },
  690. {
  691. Method: http.MethodPost,
  692. Path: "/batch_msg/update",
  693. Handler: batch_msg.UpdateBatchMsgHandler(serverCtx),
  694. },
  695. {
  696. Method: http.MethodPost,
  697. Path: "/batch_msg/delete",
  698. Handler: batch_msg.DeleteBatchMsgHandler(serverCtx),
  699. },
  700. {
  701. Method: http.MethodPost,
  702. Path: "/batch_msg/list",
  703. Handler: batch_msg.GetBatchMsgListHandler(serverCtx),
  704. },
  705. {
  706. Method: http.MethodPost,
  707. Path: "/batch_msg",
  708. Handler: batch_msg.GetBatchMsgByIdHandler(serverCtx),
  709. },
  710. {
  711. Method: http.MethodPost,
  712. Path: "/batch_msg/stop",
  713. Handler: batch_msg.StopBatchMsgHandler(serverCtx),
  714. },
  715. }...,
  716. ),
  717. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  718. )
  719. server.AddRoutes(
  720. rest.WithMiddlewares(
  721. []rest.Middleware{serverCtx.Authority},
  722. []rest.Route{
  723. {
  724. Method: http.MethodPost,
  725. Path: "/msg/create",
  726. Handler: Msg.CreateMsgHandler(serverCtx),
  727. },
  728. {
  729. Method: http.MethodPost,
  730. Path: "/msg/update",
  731. Handler: Msg.UpdateMsgHandler(serverCtx),
  732. },
  733. {
  734. Method: http.MethodPost,
  735. Path: "/msg/delete",
  736. Handler: Msg.DeleteMsgHandler(serverCtx),
  737. },
  738. {
  739. Method: http.MethodPost,
  740. Path: "/msg/list",
  741. Handler: Msg.GetMsgListHandler(serverCtx),
  742. },
  743. {
  744. Method: http.MethodPost,
  745. Path: "/msg",
  746. Handler: Msg.GetMsgByIdHandler(serverCtx),
  747. },
  748. }...,
  749. ),
  750. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  751. )
  752. server.AddRoutes(
  753. []rest.Route{
  754. {
  755. Method: http.MethodPost,
  756. Path: "/api/employee/list",
  757. Handler: employee.GetApiEmployeeListHandler(serverCtx),
  758. },
  759. {
  760. Method: http.MethodPost,
  761. Path: "/api/employee/detail",
  762. Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
  763. },
  764. },
  765. )
  766. server.AddRoutes(
  767. []rest.Route{
  768. {
  769. Method: http.MethodPost,
  770. Path: "/employee/search",
  771. Handler: employee.GetEmployeeSearchHandler(serverCtx),
  772. },
  773. {
  774. Method: http.MethodPost,
  775. Path: "/employee/search/test",
  776. Handler: employee.GetEmployeeSearchTestHandler(serverCtx),
  777. },
  778. {
  779. Method: http.MethodPost,
  780. Path: "/employee/detail",
  781. Handler: employee.GetEmployeeDetailHandler(serverCtx),
  782. },
  783. },
  784. )
  785. server.AddRoutes(
  786. rest.WithMiddlewares(
  787. []rest.Middleware{serverCtx.Authority},
  788. []rest.Route{
  789. {
  790. Method: http.MethodPost,
  791. Path: "/employee/create",
  792. Handler: employee.CreateEmployeeHandler(serverCtx),
  793. },
  794. {
  795. Method: http.MethodPost,
  796. Path: "/employee/update",
  797. Handler: employee.UpdateEmployeeHandler(serverCtx),
  798. },
  799. {
  800. Method: http.MethodPost,
  801. Path: "/employee/delete",
  802. Handler: employee.DeleteEmployeeHandler(serverCtx),
  803. },
  804. {
  805. Method: http.MethodPost,
  806. Path: "/employee/list",
  807. Handler: employee.GetEmployeeListHandler(serverCtx),
  808. },
  809. {
  810. Method: http.MethodPost,
  811. Path: "/employee",
  812. Handler: employee.GetEmployeeByIdHandler(serverCtx),
  813. },
  814. }...,
  815. ),
  816. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  817. )
  818. server.AddRoutes(
  819. rest.WithMiddlewares(
  820. []rest.Middleware{serverCtx.Authority},
  821. []rest.Route{
  822. {
  823. Method: http.MethodPost,
  824. Path: "/work_experience/create",
  825. Handler: work_experience.CreateWorkExperienceHandler(serverCtx),
  826. },
  827. {
  828. Method: http.MethodPost,
  829. Path: "/work_experience/update",
  830. Handler: work_experience.UpdateWorkExperienceHandler(serverCtx),
  831. },
  832. {
  833. Method: http.MethodPost,
  834. Path: "/work_experience/delete",
  835. Handler: work_experience.DeleteWorkExperienceHandler(serverCtx),
  836. },
  837. {
  838. Method: http.MethodPost,
  839. Path: "/work_experience/list",
  840. Handler: work_experience.GetWorkExperienceListHandler(serverCtx),
  841. },
  842. {
  843. Method: http.MethodPost,
  844. Path: "/work_experience",
  845. Handler: work_experience.GetWorkExperienceByIdHandler(serverCtx),
  846. },
  847. }...,
  848. ),
  849. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  850. )
  851. server.AddRoutes(
  852. rest.WithMiddlewares(
  853. []rest.Middleware{serverCtx.Authority},
  854. []rest.Route{
  855. {
  856. Method: http.MethodPost,
  857. Path: "/tutorial/create",
  858. Handler: tutorial.CreateTutorialHandler(serverCtx),
  859. },
  860. {
  861. Method: http.MethodPost,
  862. Path: "/tutorial/update",
  863. Handler: tutorial.UpdateTutorialHandler(serverCtx),
  864. },
  865. {
  866. Method: http.MethodPost,
  867. Path: "/tutorial/delete",
  868. Handler: tutorial.DeleteTutorialHandler(serverCtx),
  869. },
  870. {
  871. Method: http.MethodPost,
  872. Path: "/tutorial/list",
  873. Handler: tutorial.GetTutorialListHandler(serverCtx),
  874. },
  875. {
  876. Method: http.MethodPost,
  877. Path: "/tutorial",
  878. Handler: tutorial.GetTutorialByIdHandler(serverCtx),
  879. },
  880. }...,
  881. ),
  882. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  883. )
  884. server.AddRoutes(
  885. rest.WithMiddlewares(
  886. []rest.Middleware{serverCtx.Authority},
  887. []rest.Route{
  888. {
  889. Method: http.MethodGet,
  890. Path: "/employee_config/list",
  891. Handler: employee_config.GetEmployeeListConfigHandler(serverCtx),
  892. },
  893. }...,
  894. ),
  895. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  896. )
  897. server.AddRoutes(
  898. []rest.Route{
  899. {
  900. Method: http.MethodPost,
  901. Path: "/token/check",
  902. Handler: token.CheckTokenHandler(serverCtx),
  903. },
  904. },
  905. )
  906. server.AddRoutes(
  907. rest.WithMiddlewares(
  908. []rest.Middleware{serverCtx.Authority},
  909. []rest.Route{
  910. {
  911. Method: http.MethodPost,
  912. Path: "/token/third/create",
  913. Handler: token.CreateTokenHandler(serverCtx),
  914. },
  915. {
  916. Method: http.MethodPost,
  917. Path: "/token/third/update",
  918. Handler: token.UpdateTokenHandler(serverCtx),
  919. },
  920. {
  921. Method: http.MethodPost,
  922. Path: "/token/third/delete",
  923. Handler: token.DeleteTokenHandler(serverCtx),
  924. },
  925. {
  926. Method: http.MethodPost,
  927. Path: "/token/third/list",
  928. Handler: token.GetTokenListHandler(serverCtx),
  929. },
  930. {
  931. Method: http.MethodPost,
  932. Path: "/token/third/detail",
  933. Handler: token.GetTokenByIdHandler(serverCtx),
  934. },
  935. }...,
  936. ),
  937. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  938. )
  939. server.AddRoutes(
  940. []rest.Route{
  941. {
  942. Method: http.MethodPost,
  943. Path: "/category/list",
  944. Handler: category.GetCategoryListHandler(serverCtx),
  945. },
  946. {
  947. Method: http.MethodPost,
  948. Path: "/category",
  949. Handler: category.GetCategoryByIdHandler(serverCtx),
  950. },
  951. {
  952. Method: http.MethodPost,
  953. Path: "/api/category/list",
  954. Handler: category.GetApiCategoryListHandler(serverCtx),
  955. },
  956. },
  957. )
  958. server.AddRoutes(
  959. rest.WithMiddlewares(
  960. []rest.Middleware{serverCtx.Authority},
  961. []rest.Route{
  962. {
  963. Method: http.MethodPost,
  964. Path: "/category/create",
  965. Handler: category.CreateCategoryHandler(serverCtx),
  966. },
  967. {
  968. Method: http.MethodPost,
  969. Path: "/category/update",
  970. Handler: category.UpdateCategoryHandler(serverCtx),
  971. },
  972. {
  973. Method: http.MethodPost,
  974. Path: "/category/delete",
  975. Handler: category.DeleteCategoryHandler(serverCtx),
  976. },
  977. }...,
  978. ),
  979. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  980. )
  981. server.AddRoutes(
  982. rest.WithMiddlewares(
  983. []rest.Middleware{serverCtx.Authority},
  984. []rest.Route{
  985. {
  986. Method: http.MethodPost,
  987. Path: "/agent_base/create",
  988. Handler: agent_base.CreateAgentBaseHandler(serverCtx),
  989. },
  990. {
  991. Method: http.MethodPost,
  992. Path: "/agent_base/update",
  993. Handler: agent_base.UpdateAgentBaseHandler(serverCtx),
  994. },
  995. {
  996. Method: http.MethodPost,
  997. Path: "/agent_base/delete",
  998. Handler: agent_base.DeleteAgentBaseHandler(serverCtx),
  999. },
  1000. {
  1001. Method: http.MethodPost,
  1002. Path: "/agent_base/list",
  1003. Handler: agent_base.GetAgentBaseListHandler(serverCtx),
  1004. },
  1005. {
  1006. Method: http.MethodPost,
  1007. Path: "/agent_base",
  1008. Handler: agent_base.GetAgentBaseByIdHandler(serverCtx),
  1009. },
  1010. }...,
  1011. ),
  1012. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1013. )
  1014. server.AddRoutes(
  1015. rest.WithMiddlewares(
  1016. []rest.Middleware{serverCtx.Miniprogram},
  1017. []rest.Route{
  1018. {
  1019. Method: http.MethodPost,
  1020. Path: "/api/chat/create",
  1021. Handler: chatrecords.SubmitApiChatHandler(serverCtx),
  1022. },
  1023. {
  1024. Method: http.MethodPost,
  1025. Path: "/api/chat/answer",
  1026. Handler: chatrecords.AnswerApiChatHandler(serverCtx),
  1027. },
  1028. {
  1029. Method: http.MethodPost,
  1030. Path: "/api/chat/list",
  1031. Handler: chatrecords.GetApiChatListHandler(serverCtx),
  1032. },
  1033. {
  1034. Method: http.MethodPost,
  1035. Path: "/api/chat/recommmend",
  1036. Handler: chatrecords.GetApiRecommendChatHandler(serverCtx),
  1037. },
  1038. }...,
  1039. ),
  1040. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1041. )
  1042. server.AddRoutes(
  1043. rest.WithMiddlewares(
  1044. []rest.Middleware{serverCtx.Authority},
  1045. []rest.Route{
  1046. {
  1047. Method: http.MethodPost,
  1048. Path: "/chat_records/create",
  1049. Handler: chatrecords.CreateChatRecordsHandler(serverCtx),
  1050. },
  1051. {
  1052. Method: http.MethodPost,
  1053. Path: "/chat_records/update",
  1054. Handler: chatrecords.UpdateChatRecordsHandler(serverCtx),
  1055. },
  1056. {
  1057. Method: http.MethodPost,
  1058. Path: "/chat_records/delete",
  1059. Handler: chatrecords.DeleteChatRecordsHandler(serverCtx),
  1060. },
  1061. {
  1062. Method: http.MethodPost,
  1063. Path: "/chat_records/list",
  1064. Handler: chatrecords.GetChatRecordsListHandler(serverCtx),
  1065. },
  1066. {
  1067. Method: http.MethodPost,
  1068. Path: "/chat_records",
  1069. Handler: chatrecords.GetChatRecordsByIdHandler(serverCtx),
  1070. },
  1071. }...,
  1072. ),
  1073. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1074. )
  1075. server.AddRoutes(
  1076. rest.WithMiddlewares(
  1077. []rest.Middleware{serverCtx.Miniprogram},
  1078. []rest.Route{
  1079. {
  1080. Method: http.MethodPost,
  1081. Path: "/api/session/list",
  1082. Handler: chatsession.GetApiSessionListHandler(serverCtx),
  1083. },
  1084. {
  1085. Method: http.MethodPost,
  1086. Path: "/api/session/update",
  1087. Handler: chatsession.UpdateApiSessionHandler(serverCtx),
  1088. },
  1089. {
  1090. Method: http.MethodPost,
  1091. Path: "/api/session/delete",
  1092. Handler: chatsession.DeleteApiSessionHandler(serverCtx),
  1093. },
  1094. }...,
  1095. ),
  1096. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1097. )
  1098. server.AddRoutes(
  1099. rest.WithMiddlewares(
  1100. []rest.Middleware{serverCtx.Authority},
  1101. []rest.Route{
  1102. {
  1103. Method: http.MethodPost,
  1104. Path: "/chat_session/create",
  1105. Handler: chatsession.CreateChatSessionHandler(serverCtx),
  1106. },
  1107. {
  1108. Method: http.MethodPost,
  1109. Path: "/chat_session/update",
  1110. Handler: chatsession.UpdateChatSessionHandler(serverCtx),
  1111. },
  1112. {
  1113. Method: http.MethodPost,
  1114. Path: "/chat_session/delete",
  1115. Handler: chatsession.DeleteChatSessionHandler(serverCtx),
  1116. },
  1117. {
  1118. Method: http.MethodPost,
  1119. Path: "/chat_session/list",
  1120. Handler: chatsession.GetChatSessionListHandler(serverCtx),
  1121. },
  1122. {
  1123. Method: http.MethodPost,
  1124. Path: "/chat_session",
  1125. Handler: chatsession.GetChatSessionByIdHandler(serverCtx),
  1126. },
  1127. }...,
  1128. ),
  1129. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1130. )
  1131. server.AddRoutes(
  1132. rest.WithMiddlewares(
  1133. []rest.Middleware{serverCtx.Miniprogram},
  1134. []rest.Route{
  1135. {
  1136. Method: http.MethodPost,
  1137. Path: "/api/card/detail",
  1138. Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
  1139. },
  1140. }...,
  1141. ),
  1142. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1143. )
  1144. server.AddRoutes(
  1145. []rest.Route{
  1146. {
  1147. Method: http.MethodGet,
  1148. Path: "/api/card/qrcode",
  1149. Handler: wxcard.GetApiWxCardQrcodeHandler(serverCtx),
  1150. },
  1151. },
  1152. )
  1153. server.AddRoutes(
  1154. rest.WithMiddlewares(
  1155. []rest.Middleware{serverCtx.Authority},
  1156. []rest.Route{
  1157. {
  1158. Method: http.MethodPost,
  1159. Path: "/wx_card/create",
  1160. Handler: wxcard.CreateWxCardHandler(serverCtx),
  1161. },
  1162. {
  1163. Method: http.MethodPost,
  1164. Path: "/wx_card/update",
  1165. Handler: wxcard.UpdateWxCardHandler(serverCtx),
  1166. },
  1167. {
  1168. Method: http.MethodPost,
  1169. Path: "/wx_card/delete",
  1170. Handler: wxcard.DeleteWxCardHandler(serverCtx),
  1171. },
  1172. {
  1173. Method: http.MethodPost,
  1174. Path: "/wx_card/list",
  1175. Handler: wxcard.GetWxCardListHandler(serverCtx),
  1176. },
  1177. {
  1178. Method: http.MethodPost,
  1179. Path: "/wx_card",
  1180. Handler: wxcard.GetWxCardByIdHandler(serverCtx),
  1181. },
  1182. }...,
  1183. ),
  1184. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1185. )
  1186. server.AddRoutes(
  1187. rest.WithMiddlewares(
  1188. []rest.Middleware{serverCtx.Miniprogram},
  1189. []rest.Route{
  1190. {
  1191. Method: http.MethodPost,
  1192. Path: "/api/user/update",
  1193. Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
  1194. },
  1195. }...,
  1196. ),
  1197. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1198. )
  1199. server.AddRoutes(
  1200. rest.WithMiddlewares(
  1201. []rest.Middleware{serverCtx.Authority},
  1202. []rest.Route{
  1203. {
  1204. Method: http.MethodPost,
  1205. Path: "/wx_card_user/create",
  1206. Handler: wxcarduser.CreateWxCardUserHandler(serverCtx),
  1207. },
  1208. {
  1209. Method: http.MethodPost,
  1210. Path: "/wx_card_user/update",
  1211. Handler: wxcarduser.UpdateWxCardUserHandler(serverCtx),
  1212. },
  1213. {
  1214. Method: http.MethodPost,
  1215. Path: "/wx_card_user/delete",
  1216. Handler: wxcarduser.DeleteWxCardUserHandler(serverCtx),
  1217. },
  1218. {
  1219. Method: http.MethodPost,
  1220. Path: "/wx_card_user/list",
  1221. Handler: wxcarduser.GetWxCardUserListHandler(serverCtx),
  1222. },
  1223. {
  1224. Method: http.MethodPost,
  1225. Path: "/wx_card_user",
  1226. Handler: wxcarduser.GetWxCardUserByIdHandler(serverCtx),
  1227. },
  1228. }...,
  1229. ),
  1230. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1231. )
  1232. server.AddRoutes(
  1233. rest.WithMiddlewares(
  1234. []rest.Middleware{serverCtx.Miniprogram},
  1235. []rest.Route{
  1236. {
  1237. Method: http.MethodPost,
  1238. Path: "/api/card/visit",
  1239. Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
  1240. },
  1241. {
  1242. Method: http.MethodPost,
  1243. Path: "/api/card/visit/history",
  1244. Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
  1245. },
  1246. }...,
  1247. ),
  1248. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1249. )
  1250. server.AddRoutes(
  1251. rest.WithMiddlewares(
  1252. []rest.Middleware{serverCtx.Authority},
  1253. []rest.Route{
  1254. {
  1255. Method: http.MethodPost,
  1256. Path: "/wx_card_visit/create",
  1257. Handler: wxcardvisit.CreateWxCardVisitHandler(serverCtx),
  1258. },
  1259. {
  1260. Method: http.MethodPost,
  1261. Path: "/wx_card_visit/update",
  1262. Handler: wxcardvisit.UpdateWxCardVisitHandler(serverCtx),
  1263. },
  1264. {
  1265. Method: http.MethodPost,
  1266. Path: "/wx_card_visit/delete",
  1267. Handler: wxcardvisit.DeleteWxCardVisitHandler(serverCtx),
  1268. },
  1269. {
  1270. Method: http.MethodPost,
  1271. Path: "/wx_card_visit/list",
  1272. Handler: wxcardvisit.GetWxCardVisitListHandler(serverCtx),
  1273. },
  1274. {
  1275. Method: http.MethodPost,
  1276. Path: "/wx_card_visit",
  1277. Handler: wxcardvisit.GetWxCardVisitByIdHandler(serverCtx),
  1278. },
  1279. }...,
  1280. ),
  1281. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1282. )
  1283. server.AddRoutes(
  1284. rest.WithMiddlewares(
  1285. []rest.Middleware{serverCtx.Miniprogram},
  1286. []rest.Route{
  1287. {
  1288. Method: http.MethodPost,
  1289. Path: "/api/avatar/config",
  1290. Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
  1291. },
  1292. {
  1293. Method: http.MethodPost,
  1294. Path: "/api/avatar/sendText",
  1295. Handler: avatar.SendApiAvatarTextHandler(serverCtx),
  1296. },
  1297. {
  1298. Method: http.MethodPost,
  1299. Path: "/api/avatar/stop",
  1300. Handler: avatar.StopApiAvatarHandler(serverCtx),
  1301. },
  1302. {
  1303. Method: http.MethodPost,
  1304. Path: "/api/avatar/sts",
  1305. Handler: avatar.GetAcsResponseHandler(serverCtx),
  1306. },
  1307. {
  1308. Method: http.MethodPost,
  1309. Path: "/api/avatar/signature",
  1310. Handler: avatar.GetSignatureResponseHandler(serverCtx),
  1311. },
  1312. }...,
  1313. ),
  1314. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1315. )
  1316. server.AddRoutes(
  1317. rest.WithMiddlewares(
  1318. []rest.Middleware{serverCtx.Authority},
  1319. []rest.Route{
  1320. {
  1321. Method: http.MethodPost,
  1322. Path: "/aliyun_avatar/create",
  1323. Handler: aliyun_avatar.CreateAliyunAvatarHandler(serverCtx),
  1324. },
  1325. {
  1326. Method: http.MethodPost,
  1327. Path: "/aliyun_avatar/update",
  1328. Handler: aliyun_avatar.UpdateAliyunAvatarHandler(serverCtx),
  1329. },
  1330. {
  1331. Method: http.MethodPost,
  1332. Path: "/aliyun_avatar/delete",
  1333. Handler: aliyun_avatar.DeleteAliyunAvatarHandler(serverCtx),
  1334. },
  1335. {
  1336. Method: http.MethodPost,
  1337. Path: "/aliyun_avatar/list",
  1338. Handler: aliyun_avatar.GetAliyunAvatarListHandler(serverCtx),
  1339. },
  1340. {
  1341. Method: http.MethodPost,
  1342. Path: "/aliyun_avatar",
  1343. Handler: aliyun_avatar.GetAliyunAvatarByIdHandler(serverCtx),
  1344. },
  1345. }...,
  1346. ),
  1347. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1348. )
  1349. }