routes.go 38 KB

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