routes.go 51 KB

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