routes.go 35 KB

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