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