routes.go 40 KB

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