routes.go 56 KB

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