routes.go 48 KB

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