routes.go 57 KB

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