routes.go 36 KB

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