routes.go 36 KB

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