routes.go 53 KB

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