routes.go 31 KB

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