routes.go 43 KB

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