routes.go 39 KB

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