routes.go 52 KB

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