routes.go 53 KB

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