routes.go 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  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.Route{
  979. {
  980. Method: http.MethodPost,
  981. Path: "/api/chat/create",
  982. Handler: chatrecords.SubmitApiChatHandler(serverCtx),
  983. },
  984. {
  985. Method: http.MethodPost,
  986. Path: "/api/chat/list",
  987. Handler: chatrecords.GetApiChatListHandler(serverCtx),
  988. },
  989. {
  990. Method: http.MethodPost,
  991. Path: "/api/chat/save",
  992. Handler: chatrecords.SaveApiChatHandler(serverCtx),
  993. },
  994. },
  995. )
  996. server.AddRoutes(
  997. rest.WithMiddlewares(
  998. []rest.Middleware{serverCtx.Authority},
  999. []rest.Route{
  1000. {
  1001. Method: http.MethodPost,
  1002. Path: "/chat_records/create",
  1003. Handler: chatrecords.CreateChatRecordsHandler(serverCtx),
  1004. },
  1005. {
  1006. Method: http.MethodPost,
  1007. Path: "/chat_records/update",
  1008. Handler: chatrecords.UpdateChatRecordsHandler(serverCtx),
  1009. },
  1010. {
  1011. Method: http.MethodPost,
  1012. Path: "/chat_records/delete",
  1013. Handler: chatrecords.DeleteChatRecordsHandler(serverCtx),
  1014. },
  1015. {
  1016. Method: http.MethodPost,
  1017. Path: "/chat_records/list",
  1018. Handler: chatrecords.GetChatRecordsListHandler(serverCtx),
  1019. },
  1020. {
  1021. Method: http.MethodPost,
  1022. Path: "/chat_records",
  1023. Handler: chatrecords.GetChatRecordsByIdHandler(serverCtx),
  1024. },
  1025. }...,
  1026. ),
  1027. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1028. )
  1029. server.AddRoutes(
  1030. []rest.Route{
  1031. {
  1032. Method: http.MethodPost,
  1033. Path: "/api/session/list",
  1034. Handler: chatsession.GetApiSessionListHandler(serverCtx),
  1035. },
  1036. {
  1037. Method: http.MethodPost,
  1038. Path: "/api/session/update",
  1039. Handler: chatsession.UpdateApiSessionHandler(serverCtx),
  1040. },
  1041. {
  1042. Method: http.MethodPost,
  1043. Path: "/api/session/delete",
  1044. Handler: chatsession.DeleteApiSessionHandler(serverCtx),
  1045. },
  1046. },
  1047. )
  1048. server.AddRoutes(
  1049. rest.WithMiddlewares(
  1050. []rest.Middleware{serverCtx.Authority},
  1051. []rest.Route{
  1052. {
  1053. Method: http.MethodPost,
  1054. Path: "/chat_session/create",
  1055. Handler: chatsession.CreateChatSessionHandler(serverCtx),
  1056. },
  1057. {
  1058. Method: http.MethodPost,
  1059. Path: "/chat_session/update",
  1060. Handler: chatsession.UpdateChatSessionHandler(serverCtx),
  1061. },
  1062. {
  1063. Method: http.MethodPost,
  1064. Path: "/chat_session/delete",
  1065. Handler: chatsession.DeleteChatSessionHandler(serverCtx),
  1066. },
  1067. {
  1068. Method: http.MethodPost,
  1069. Path: "/chat_session/list",
  1070. Handler: chatsession.GetChatSessionListHandler(serverCtx),
  1071. },
  1072. {
  1073. Method: http.MethodPost,
  1074. Path: "/chat_session",
  1075. Handler: chatsession.GetChatSessionByIdHandler(serverCtx),
  1076. },
  1077. }...,
  1078. ),
  1079. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1080. )
  1081. server.AddRoutes(
  1082. []rest.Route{
  1083. {
  1084. Method: http.MethodPost,
  1085. Path: "/api/card/detail",
  1086. Handler: wxcard.GetApiWxCardDetailHandler(serverCtx),
  1087. },
  1088. },
  1089. )
  1090. server.AddRoutes(
  1091. rest.WithMiddlewares(
  1092. []rest.Middleware{serverCtx.Authority},
  1093. []rest.Route{
  1094. {
  1095. Method: http.MethodPost,
  1096. Path: "/wx_card/create",
  1097. Handler: wxcard.CreateWxCardHandler(serverCtx),
  1098. },
  1099. {
  1100. Method: http.MethodPost,
  1101. Path: "/wx_card/update",
  1102. Handler: wxcard.UpdateWxCardHandler(serverCtx),
  1103. },
  1104. {
  1105. Method: http.MethodPost,
  1106. Path: "/wx_card/delete",
  1107. Handler: wxcard.DeleteWxCardHandler(serverCtx),
  1108. },
  1109. {
  1110. Method: http.MethodPost,
  1111. Path: "/wx_card/list",
  1112. Handler: wxcard.GetWxCardListHandler(serverCtx),
  1113. },
  1114. {
  1115. Method: http.MethodPost,
  1116. Path: "/wx_card",
  1117. Handler: wxcard.GetWxCardByIdHandler(serverCtx),
  1118. },
  1119. }...,
  1120. ),
  1121. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1122. )
  1123. server.AddRoutes(
  1124. []rest.Route{
  1125. {
  1126. Method: http.MethodPost,
  1127. Path: "/api/user/update",
  1128. Handler: wxcarduser.UpdateApiWxCardUserHandler(serverCtx),
  1129. },
  1130. },
  1131. )
  1132. server.AddRoutes(
  1133. rest.WithMiddlewares(
  1134. []rest.Middleware{serverCtx.Authority},
  1135. []rest.Route{
  1136. {
  1137. Method: http.MethodPost,
  1138. Path: "/wx_card_user/create",
  1139. Handler: wxcarduser.CreateWxCardUserHandler(serverCtx),
  1140. },
  1141. {
  1142. Method: http.MethodPost,
  1143. Path: "/wx_card_user/update",
  1144. Handler: wxcarduser.UpdateWxCardUserHandler(serverCtx),
  1145. },
  1146. {
  1147. Method: http.MethodPost,
  1148. Path: "/wx_card_user/delete",
  1149. Handler: wxcarduser.DeleteWxCardUserHandler(serverCtx),
  1150. },
  1151. {
  1152. Method: http.MethodPost,
  1153. Path: "/wx_card_user/list",
  1154. Handler: wxcarduser.GetWxCardUserListHandler(serverCtx),
  1155. },
  1156. {
  1157. Method: http.MethodPost,
  1158. Path: "/wx_card_user",
  1159. Handler: wxcarduser.GetWxCardUserByIdHandler(serverCtx),
  1160. },
  1161. }...,
  1162. ),
  1163. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1164. )
  1165. server.AddRoutes(
  1166. []rest.Route{
  1167. {
  1168. Method: http.MethodPost,
  1169. Path: "/api/card/visit",
  1170. Handler: wxcardvisit.SubmitApiWxCardVisitHandler(serverCtx),
  1171. },
  1172. {
  1173. Method: http.MethodPost,
  1174. Path: "/api/card/visit/history",
  1175. Handler: wxcardvisit.GetApiWxCardVisitListHandler(serverCtx),
  1176. },
  1177. },
  1178. )
  1179. server.AddRoutes(
  1180. rest.WithMiddlewares(
  1181. []rest.Middleware{serverCtx.Authority},
  1182. []rest.Route{
  1183. {
  1184. Method: http.MethodPost,
  1185. Path: "/wx_card_visit/create",
  1186. Handler: wxcardvisit.CreateWxCardVisitHandler(serverCtx),
  1187. },
  1188. {
  1189. Method: http.MethodPost,
  1190. Path: "/wx_card_visit/update",
  1191. Handler: wxcardvisit.UpdateWxCardVisitHandler(serverCtx),
  1192. },
  1193. {
  1194. Method: http.MethodPost,
  1195. Path: "/wx_card_visit/delete",
  1196. Handler: wxcardvisit.DeleteWxCardVisitHandler(serverCtx),
  1197. },
  1198. {
  1199. Method: http.MethodPost,
  1200. Path: "/wx_card_visit/list",
  1201. Handler: wxcardvisit.GetWxCardVisitListHandler(serverCtx),
  1202. },
  1203. {
  1204. Method: http.MethodPost,
  1205. Path: "/wx_card_visit",
  1206. Handler: wxcardvisit.GetWxCardVisitByIdHandler(serverCtx),
  1207. },
  1208. }...,
  1209. ),
  1210. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1211. )
  1212. server.AddRoutes(
  1213. rest.WithMiddlewares(
  1214. []rest.Middleware{serverCtx.Miniprogram},
  1215. []rest.Route{
  1216. {
  1217. Method: http.MethodPost,
  1218. Path: "/api/avatar/config",
  1219. Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
  1220. },
  1221. }...,
  1222. ),
  1223. rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
  1224. )
  1225. }