routes.go 43 KB

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