routes.go 53 KB

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