routes.go 54 KB

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