http.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. package http
  2. import (
  3. "context"
  4. "go-common/app/interface/main/creative/conf"
  5. "go-common/app/interface/main/creative/server/grpc"
  6. "go-common/app/interface/main/creative/service"
  7. "go-common/app/interface/main/creative/service/academy"
  8. "go-common/app/interface/main/creative/service/account"
  9. "go-common/app/interface/main/creative/service/ad"
  10. "go-common/app/interface/main/creative/service/app"
  11. "go-common/app/interface/main/creative/service/appeal"
  12. "go-common/app/interface/main/creative/service/archive"
  13. "go-common/app/interface/main/creative/service/article"
  14. "go-common/app/interface/main/creative/service/assist"
  15. "go-common/app/interface/main/creative/service/danmu"
  16. "go-common/app/interface/main/creative/service/data"
  17. "go-common/app/interface/main/creative/service/dynamic"
  18. "go-common/app/interface/main/creative/service/elec"
  19. "go-common/app/interface/main/creative/service/faq"
  20. "go-common/app/interface/main/creative/service/feedback"
  21. "go-common/app/interface/main/creative/service/geetest"
  22. "go-common/app/interface/main/creative/service/medal"
  23. "go-common/app/interface/main/creative/service/music"
  24. "go-common/app/interface/main/creative/service/newcomer"
  25. "go-common/app/interface/main/creative/service/operation"
  26. "go-common/app/interface/main/creative/service/pay"
  27. "go-common/app/interface/main/creative/service/reply"
  28. "go-common/app/interface/main/creative/service/resource"
  29. "go-common/app/interface/main/creative/service/staff"
  30. "go-common/app/interface/main/creative/service/template"
  31. "go-common/app/interface/main/creative/service/up"
  32. "go-common/app/interface/main/creative/service/version"
  33. "go-common/app/interface/main/creative/service/watermark"
  34. "go-common/app/interface/main/creative/service/weeklyhonor"
  35. "go-common/app/interface/main/creative/service/whitelist"
  36. "go-common/library/log"
  37. bm "go-common/library/net/http/blademaster"
  38. "go-common/library/net/http/blademaster/middleware/antispam"
  39. "go-common/library/net/http/blademaster/middleware/auth"
  40. "go-common/library/net/http/blademaster/middleware/verify"
  41. "go-common/library/net/rpc/warden"
  42. )
  43. var (
  44. //app service
  45. apSvc *appeal.Service
  46. arcSvc *archive.Service
  47. elecSvc *elec.Service
  48. dataSvc *data.Service
  49. accSvc *account.Service
  50. tplSvc *template.Service
  51. gtSvc *geetest.Service
  52. replySvc *reply.Service
  53. fdSvc *feedback.Service
  54. operSvc *operation.Service
  55. assistSvc *assist.Service
  56. artSvc *article.Service
  57. mdSvc *medal.Service
  58. wmSvc *watermark.Service
  59. appSvc *app.Service
  60. danmuSvc *danmu.Service
  61. vsSvc *version.Service
  62. whiteSvc *whitelist.Service
  63. adSvc *ad.Service
  64. musicSvc *music.Service
  65. resSvc *resource.Service
  66. rpcdaos *service.RPCDaos
  67. acaSvc *academy.Service
  68. faqSvc *faq.Service
  69. dymcSvc *dynamic.Service
  70. honorSvc *weeklyhonor.Service
  71. paySvc *pay.Service
  72. // api middleware
  73. verifySvc *verify.Verify
  74. authSvc *auth.Auth
  75. antispamSvc *antispam.Antispam
  76. dmAnti *antispam.Antispam
  77. //up service
  78. upSvc *up.Service
  79. // grpc TODO mv out http
  80. grpcSvr *warden.Server
  81. newcomerSvc *newcomer.Service
  82. pubSvc *service.Public
  83. staffSvc *staff.Service
  84. )
  85. // Init init account service.
  86. func Init(c *conf.Config) {
  87. // service
  88. initService(c)
  89. // init grpc
  90. grpcSvr = grpc.New(nil, arcSvc, newcomerSvc)
  91. engineOuter := bm.DefaultServer(c.BM.Outer)
  92. // init outer router
  93. outerRouter(engineOuter)
  94. if err := engineOuter.Start(); err != nil {
  95. log.Error("engineOuter.Start() error(%v) | config(%v)", err, c)
  96. panic(err)
  97. }
  98. }
  99. //Close for close server
  100. func Close() {
  101. grpcSvr.Shutdown(context.TODO())
  102. }
  103. func initService(c *conf.Config) {
  104. verifySvc = verify.New(nil)
  105. authSvc = auth.New(nil)
  106. antispamSvc = antispam.New(c.RouterAntispam)
  107. dmAnti = antispam.New(c.DmAntispam)
  108. // public for injection
  109. rpcdaos = service.NewRPCDaos(c)
  110. pubSvc = service.New(c, rpcdaos)
  111. // services
  112. apSvc = appeal.New(c, rpcdaos)
  113. arcSvc = archive.New(c, rpcdaos, pubSvc)
  114. elecSvc = elec.New(c, rpcdaos)
  115. dataSvc = data.New(c, rpcdaos, pubSvc)
  116. accSvc = account.New(c, rpcdaos)
  117. tplSvc = template.New(c, rpcdaos)
  118. operSvc = operation.New(c, rpcdaos)
  119. wmSvc = watermark.New(c, rpcdaos, pubSvc)
  120. gtSvc = geetest.New(c, rpcdaos)
  121. replySvc = reply.New(c, rpcdaos)
  122. fdSvc = feedback.New(c, rpcdaos)
  123. assistSvc = assist.New(c, rpcdaos)
  124. artSvc = article.New(c, rpcdaos)
  125. mdSvc = medal.New(c, rpcdaos, pubSvc)
  126. appSvc = app.New(c, rpcdaos, pubSvc)
  127. danmuSvc = danmu.New(c, rpcdaos)
  128. vsSvc = version.New(c, rpcdaos)
  129. whiteSvc = whitelist.New(c, rpcdaos)
  130. adSvc = ad.New(c, rpcdaos)
  131. musicSvc = music.New(c, rpcdaos, pubSvc)
  132. resSvc = resource.New(c, rpcdaos)
  133. acaSvc = academy.New(c, rpcdaos, pubSvc)
  134. upSvc = up.New(c, rpcdaos)
  135. faqSvc = faq.New(c, rpcdaos)
  136. dymcSvc = dynamic.New(c, rpcdaos)
  137. honorSvc = weeklyhonor.New(c, rpcdaos)
  138. paySvc = pay.New(c, rpcdaos)
  139. newcomerSvc = newcomer.New(c, rpcdaos)
  140. staffSvc = staff.New(c, rpcdaos)
  141. }
  142. func webDanmuRouter(g *bm.RouterGroup) {
  143. // manager
  144. g.GET("/danmu/list", webDmList)
  145. g.GET("/danmu/distri", webDmDistri)
  146. g.POST("/danmu/edit", dmAnti.ServeHTTP, webDmEdit)
  147. g.POST("/danmu/transfer", dmAnti.ServeHTTP, webDmTransfer)
  148. g.POST("/danmu/pool", dmAnti.ServeHTTP, webDmUpPool)
  149. // purchase
  150. g.GET("/danmu/purchases", webListDmPurchases)
  151. g.POST("/danmu/purchase/pass", dmAnti.ServeHTTP, webPassDmPurchase)
  152. g.POST("/danmu/purchase/deny", dmAnti.ServeHTTP, webDenyDmPurchase)
  153. g.POST("/danmu/purchase/cancel", dmAnti.ServeHTTP, webCancelDmPurchase)
  154. // report
  155. g.POST("/danmu/report/check", dmAnti.ServeHTTP, webDmReportCheck)
  156. g.GET("/danmu/report", webDmReport)
  157. // report
  158. g.GET("/danmu/protect/archive", webDmProtectArchive)
  159. g.GET("/danmu/protect/list", webDmProtectList)
  160. g.POST("/danmu/protect/operation", dmAnti.ServeHTTP, webDmProtectOper)
  161. }
  162. func appDanmuRouter(g *bm.RouterGroup) {
  163. g.GET("/danmu/list", authSvc.UserMobile, appDmList)
  164. g.GET("/danmu/recent", authSvc.UserMobile, appDmRecent)
  165. g.GET("/danmu/edit", authSvc.UserMobile, appDmEdit)
  166. g.POST("/danmu/edit/batch", authSvc.UserMobile, appDmEditBatch)
  167. }
  168. func academyRouter(g *bm.RouterGroup) {
  169. g.GET("/academy/archive/tags", webAcademyTags)
  170. g.GET("/academy/archive/list", webAcademyArchives)
  171. g.POST("/academy/feedback/add", webAddFeedBack)
  172. }
  173. //工单
  174. func staffRouter(g *bm.RouterGroup) {
  175. //申请单交互
  176. g.POST("/staff/apply/submit", webApplySubmit)
  177. //staff 申请解除
  178. g.POST("/staff/apply/create", webApplyCreate)
  179. }
  180. func switchRouter(g *bm.RouterGroup) {
  181. g.POST("/switch/set", setUpSwitch)
  182. g.GET("/switch", upSwitch)
  183. }
  184. func webElecRouter(g *bm.RouterGroup) {
  185. g.GET("/elec/user", webUserElec)
  186. g.GET("/elec/notify", webElecNotify)
  187. g.GET("/elec/status", webElecStatus)
  188. g.GET("/elec/rank/recent", webElecRecentRank)
  189. g.GET("/elec/rank/current", webElecCurrentRank)
  190. g.GET("/elec/rank/toltal", webElecTotalRank)
  191. g.GET("/elec/dailybill", webElecDailyBill)
  192. g.GET("/elec/balance", webElecBalance)
  193. g.POST("/elec/status/set", webElecUpStatus)
  194. g.POST("/elec/user/update", webUserElecUpdate)
  195. g.POST("/elec/arc/update", webArcElecUpdate)
  196. g.GET("/elec/remark/list", webRemarkList)
  197. g.GET("/elec/remark/detail", webRemarkDetail)
  198. g.POST("/elec/remark/reply", webRemark)
  199. g.GET("/elec/recent", webRecentElec)
  200. }
  201. func webAssistRouter(g *bm.RouterGroup) {
  202. g.GET("/assist", webAssists)
  203. g.GET("/assist/status", webAssistStatus)
  204. g.GET("/assist/logs", webAssistLogs)
  205. g.POST("/assist/add", webAssistAdd)
  206. g.POST("/assist/del", webAssistDel)
  207. g.POST("/assist/set", webAssistSet)
  208. g.POST("/assist/log/revoc", webAssistLogRevoc)
  209. }
  210. func newcomerRouter(g *bm.RouterGroup) {
  211. g.GET("/newcomer/task/list", webTaskList)
  212. g.POST("/newcomer/reward/receive/add", webRewardReceive)
  213. g.POST("/newcomer/reward/receive/activate", webRewardActivate)
  214. g.GET("/newcomer/reward/receive/list", webRewardReceiveList)
  215. g.POST("/newcomer/task/bind", webTaskBind)
  216. g.GET("/newcomer/task/makeup", webTaskMakeup)
  217. }
  218. // outerRouter init inner router.
  219. func outerRouter(e *bm.Engine) {
  220. e.GET("/monitor/ping", ping)
  221. g := e.Group("/x/web", authSvc.UserWeb)
  222. {
  223. webDanmuRouter(g)
  224. academyRouter(g)
  225. staffRouter(g)
  226. switchRouter(g)
  227. webElecRouter(g)
  228. webAssistRouter(g)
  229. newcomerRouter(g)
  230. g.GET("/ugcpay/protocol", webUgcPayProtocol)
  231. // mission
  232. g.GET("/mission/protocol", webMissionProtocol)
  233. // netsafe
  234. g.POST("/ns/md5", webNsMd5)
  235. //white
  236. g.GET("/white", webWhite)
  237. // archive.
  238. g.GET("/archive/parts", webArchVideos)
  239. g.GET("/archive/view", webViewArc)
  240. g.GET("/archives", webArchives)
  241. g.GET("/archive/staff/applies", webStaffApplies)
  242. g.GET("/archive/pre", webViewPre)
  243. g.GET("/archive/videos", webVideos)
  244. g.POST("/archive/delete", webDelArc)
  245. g.GET("/archive/tags", webTags)
  246. g.GET("/archive/desc/format", webDescFormat)
  247. // history
  248. g.GET("/archive/history/list", webHistoryList)
  249. g.GET("/archive/history/view", webHistoryView)
  250. // ad
  251. g.GET("/ad/game/list", webAdGameList)
  252. // appeal.
  253. g.GET("/appeal/list", webAppealList)
  254. g.GET("/appeal/detail", webAppealDetail)
  255. g.GET("/appeal/contact", webAppealContact)
  256. g.POST("/appeal/add", webAppealAdd)
  257. g.POST("/appeal/reply", antispamSvc.ServeHTTP, webAppealReply)
  258. g.POST("/appeal/down", webAppealDown)
  259. g.POST("/appeal/star", webAppealStar)
  260. // cover list.
  261. g.GET("/archive/covers", coverList)
  262. g.GET("/archive/recovers", webRecommandCover)
  263. // index.
  264. g.GET("/index/stat", webIndexStat)
  265. g.GET("/index/tool", webIndexTool)
  266. g.GET("/index/full", webIndexFull) //collect_arc
  267. g.GET("/index/notify", webIndexNotify)
  268. g.GET("/index/operation", webIndexOper)
  269. g.GET("/index/version", webIndexVersion)
  270. g.GET("/index/newcomer", webIndexNewcomer)
  271. // data
  272. g.GET("/data/videoquit", webVideoQuitPoints)
  273. g.GET("/data/archive", webArchive)
  274. g.GET("/data/article", webArticleData)
  275. g.GET("/data/base", base)
  276. g.GET("/data/trend", trend)
  277. g.GET("/data/action", action)
  278. g.GET("/data/survey", survey)
  279. g.GET("/data/pandect", pandect)
  280. g.GET("/data/fan", webFan)
  281. g.GET("/data/playsource", webPlaySource)
  282. g.GET("/data/playanalysis", webArcPlayAnalysis)
  283. g.GET("/data/article/thirty", webArtThirtyDay)
  284. g.GET("/data/article/rank", webArtRank)
  285. g.GET("/data/article/source", webArtReadAnalysis)
  286. // water mark
  287. g.GET("/watermark", waterMark)
  288. g.POST("/watermark/set", waterMarkSet)
  289. // feedback
  290. g.GET("/feedbacks", webFeedbacks)
  291. g.GET("/feedback/detail", webFeedbackDetail)
  292. g.GET("/feedback/tags", webFeedbackTags)
  293. g.GET("/feedback/newtags", webFeedbackNewTags)
  294. g.POST("/feedback/add", webFeedbackAdd)
  295. g.POST("/feedback/close", webFeedbackClose)
  296. // reply
  297. g.GET("/replies", replyList)
  298. // template.
  299. g.GET("/tpls", webTemplates)
  300. g.POST("/tpl/add", webAddTpl)
  301. g.POST("/tpl/update", webUpdateTpl)
  302. g.POST("/tpl/delete", webDelTpl)
  303. // fans medal
  304. g.GET("/medal/status", webMedalStatus)
  305. g.GET("/medal/recent", webRecentFans)
  306. g.POST("/medal/open", webMedalOpen)
  307. g.POST("/medal/check", webMedalCheck)
  308. g.GET("/medal/rank", webMedalRank)
  309. g.POST("/medal/rename", webMedalRename)
  310. g.GET("/medal/fans", webFansMedal)
  311. // article.
  312. g.GET("/article/author", webAuthor)
  313. g.GET("/article/view", webArticle)
  314. g.GET("/article/list", webArticleList)
  315. g.GET("/article/pre", webArticlePre)
  316. g.POST("/article/submit", webSubArticle)
  317. g.POST("/article/update", webUpdateArticle)
  318. g.POST("/article/delete", webDelArticle)
  319. g.POST("/article/withdraw", webWithDrawArticle)
  320. g.POST("/article/upcover", antispamSvc.ServeHTTP, webArticleUpCover)
  321. g.GET("/draft/view", webDraft)
  322. g.GET("/draft/list", webDraftList)
  323. g.POST("/draft/addupdate", webSubmitDraft)
  324. g.POST("/draft/delete", webDeleteDraft)
  325. g.POST("/article/capture", antispamSvc.ServeHTTP, webArticleCapture)
  326. // cm
  327. g.GET("/cm/oasis/stat", webCmOasisStat)
  328. // common
  329. g.GET("/user/mid", webUserMid)
  330. g.GET("/user/search", webUserSearch)
  331. //viewpoint
  332. g.GET("/viewpoints", webViewPoints)
  333. //g.POST("/viewpoints/edit", webViewPointsEdit)
  334. }
  335. h5 := e.Group("/x/h5")
  336. {
  337. // app h5 cooperate pager
  338. h5.GET("/cooperate/pre", authSvc.User, appCooperatePre)
  339. // bgm
  340. h5.GET("/bgm/ext", authSvc.User, appBgmExt)
  341. // faq
  342. h5.GET("/faq/editor", authSvc.User, appH5FaqEditor)
  343. h5.POST("/bgm/feedback", authSvc.User, appH5BgmFeedback)
  344. h5.GET("/elec/bill", authSvc.User, appElecBill)
  345. h5.GET("/elec/rank/recent", authSvc.User, appElecRecentRank)
  346. h5.GET("/medal/status", authSvc.User, appMedalStatus)
  347. h5.POST("/medal/check", authSvc.User, appMedalCheck)
  348. h5.POST("/medal/open", authSvc.User, appMedalOpen)
  349. h5.POST("/medal/rename", authSvc.User, appMedalRename)
  350. //academy
  351. h5.POST("/academy/play/add", authSvc.Guest, h5AddPlay) //添加播放
  352. h5.POST("/academy/play/del", authSvc.Guest, h5DelPlay) //删除播放
  353. h5.GET("/academy/play/list", authSvc.User, h5PlayList) //我的课程
  354. h5.GET("/academy/play/view", authSvc.User, h5ViewPlay) //查看我的课程
  355. h5.GET("/academy/theme/dir", h5ThemeDir) //主题课程目录 对应职业列表
  356. h5.GET("/academy/newb/course", h5NewbCourse) //新人课程
  357. h5.GET("/academy/tag", h5Tags) //标签目录
  358. h5.GET("/academy/archive", h5Archive) //课程列表
  359. h5.GET("/academy/feature", h5Feature) //精选课程
  360. h5.GET("/academy/recommend/v2", authSvc.Guest, h5RecommendV2) //推荐课程v2
  361. h5.GET("/academy/theme/course/v2", h5ThemeCousreV2) //技能树(主题课程)v2
  362. h5.GET("/academy/keywords", h5Keywords) //搜索关键词提示
  363. // data center
  364. h5.GET("/data/archive", authSvc.User, appDataArc)
  365. h5.GET("/data/videoquit", authSvc.User, appDataVideoQuit)
  366. h5.GET("/data/fan", authSvc.User, appFan) //粉丝用户信息分析总览
  367. h5.GET("/data/fan/rank", authSvc.User, appFanRank) //新粉丝排行榜
  368. h5.GET("/data/overview", authSvc.User, appOverView) //新数据概览
  369. h5.GET("/data/archive/analyze", authSvc.User, appArchiveAnalyze) //新稿件数据分析
  370. h5.GET("/data/video/retention", authSvc.User, appVideoRetention) //新视频播放完成度
  371. h5.GET("/data/article", authSvc.User, appDataArticle)
  372. h5.GET("/archives/simple", authSvc.User, appSimpleArcVideos)
  373. // watermark
  374. h5.GET("/watermark", authSvc.User, waterMark)
  375. h5.POST("/watermark/set", authSvc.User, waterMarkSet)
  376. // up weekly honor
  377. h5.GET("/weeklyhonor", authSvc.Guest, weeklyHonor)
  378. // switch weekly honor subscribe
  379. h5.POST("/weeklyhonor/subscribe", authSvc.User, weeklyHonorSubSwitch)
  380. // task system
  381. h5.POST("/task/bind", authSvc.User, h5TaskBind)
  382. h5.GET("/task/list", authSvc.User, h5TaskList)
  383. h5.POST("/task/reward/receive", authSvc.User, h5RewardReceive)
  384. h5.POST("/task/reward/activate", authSvc.User, h5RewardActivate)
  385. h5.GET("/task/reward/list", authSvc.User, h5RewardReceiveList)
  386. h5.GET("/task/pub/list", authSvc.User, taskPubList) //其他业务方查看任务列表
  387. }
  388. app := e.Group("/x/app")
  389. {
  390. appDanmuRouter(app)
  391. // h5
  392. app.GET("/h5/pre", authSvc.User, appH5Pre)
  393. app.GET("/h5/mission/type", authSvc.User, appH5MissionByType)
  394. app.GET("/h5/archive/tags", authSvc.User, appH5ArcTags)
  395. app.GET("/h5/archive/tag/info", authSvc.User, appH5ArcTagInfo)
  396. app.GET("/banner", authSvc.User, appBanner)
  397. // archive
  398. app.GET("/mission/type", authSvc.UserMobile, appMissionByType)
  399. app.GET("/index", authSvc.User, appIndex)
  400. app.GET("/archives", authSvc.UserMobile, appArchives)
  401. app.GET("/archives/simple", authSvc.UserMobile, appSimpleArcVideos)
  402. app.GET("/up/info", authSvc.UserMobile, appUpInfo)
  403. // main app features
  404. app.GET("/pre", authSvc.User, appPre)
  405. app.GET("/archive/pre", authSvc.User, appArchivePre)
  406. app.GET("/archive/desc/format", authSvc.UserMobile, appArcDescFormat)
  407. app.GET("/archive/view", authSvc.UserMobile, appArcView)
  408. app.POST("/archive/delete", authSvc.UserMobile, appArcDel)
  409. // reply.
  410. app.GET("/replies", authSvc.UserMobile, appReplyList)
  411. // data
  412. app.GET("/data/archive", authSvc.UserMobile, appDataArc)
  413. app.GET("/data/videoquit", authSvc.UserMobile, appDataVideoQuit)
  414. app.GET("/data/fan", authSvc.UserMobile, appFan)
  415. app.GET("/data/fan/rank", authSvc.UserMobile, appFanRank) //新粉丝排行榜
  416. app.GET("/data/overview", authSvc.UserMobile, appOverView) //新数据概览
  417. app.GET("/data/archive/analyze", authSvc.UserMobile, appArchiveAnalyze) //新稿件数据分析
  418. app.GET("/data/video/retention", authSvc.UserMobile, appVideoRetention) //新视频播放完成度
  419. app.GET("/data/article", authSvc.UserMobile, appDataArticle)
  420. // elec
  421. app.GET("/elec/bill", authSvc.UserMobile, appElecBill)
  422. app.GET("/elec/rank/recent", authSvc.UserMobile, appElecRecentRank)
  423. // fans medal
  424. app.GET("/medal/status", authSvc.UserMobile, appMedalStatus)
  425. app.POST("/medal/check", authSvc.UserMobile, appMedalCheck)
  426. app.POST("/medal/open", authSvc.UserMobile, appMedalOpen)
  427. app.POST("/medal/rename", authSvc.UserMobile, appMedalRename)
  428. // article
  429. app.GET("/article/list", authSvc.UserMobile, appArticleList)
  430. // material
  431. app.GET("/material/pre", authSvc.UserMobile, appMaterialPre)
  432. app.GET("/material/view", authSvc.UserMobile, appMaterial)
  433. // bgm
  434. app.GET("/bgm/pre", authSvc.UserMobile, appBgmPre)
  435. app.GET("/bgm/list", authSvc.UserMobile, appBgmList)
  436. app.GET("/bgm/view", authSvc.UserMobile, appBgmView)
  437. app.GET("/bgm/search", authSvc.UserMobile, appBgmSearch)
  438. app.GET("/cooperate/view", authSvc.User, appCooperate)
  439. // task
  440. app.POST("/newcomer/task/bind", authSvc.UserMobile, appTaskBind)
  441. }
  442. cli := e.Group("/x/client", authSvc.User)
  443. {
  444. // archive.
  445. cli.GET("/archives", clientArchives)
  446. cli.GET("/archive/search", clientArchiveSearch)
  447. cli.GET("/archive/view", clientViewArc)
  448. cli.POST("/archive/delete", clientDelArc)
  449. cli.GET("/archive/pre", clientPre)
  450. cli.GET("/archive/tags", clientTags)
  451. // template.
  452. cli.GET("/tpls", clientTemplates)
  453. cli.POST("/tpl/add", clientAddTpl)
  454. cli.POST("/tpl/update", clientUpdateTpl)
  455. cli.POST("/tpl/delete", clientDelTpl)
  456. // cover list.
  457. cli.GET("/archive/covers", coverList)
  458. }
  459. geeg := e.Group("/x/geetest", authSvc.UserWeb)
  460. {
  461. // geetest.
  462. geeg.GET("/pre", gtPreProcess)
  463. geeg.POST("/validate", gtValidate)
  464. geeg.GET("/pre/add", gtPreProcessAdd)
  465. }
  466. creator := e.Group("/x/creator", authSvc.UserMobile)
  467. {
  468. // index
  469. creator.GET("/my", creatorMy)
  470. creator.GET("/index", creatorIndex)
  471. creator.GET("/earnings", creatorEarnings)
  472. creator.GET("/banner", creatorBanner)
  473. creator.GET("/replies", creatorReplyList)
  474. //archive
  475. creator.GET("/archives", creatorArchives)
  476. creator.GET("/archive/tag/info", creatorArcTagInfo)
  477. creator.GET("/archive/view", creatorViewArc)
  478. creator.GET("/archive/videoquit", creatorVideoQuit)
  479. creator.GET("/archive/data", creatorArchiveData)
  480. creator.POST("/archive/delete", creatorDelArc)
  481. creator.GET("/archive/pre", creatorPre)
  482. creator.GET("/archive/tags", creatorPredictTag)
  483. creator.GET("/archive/desc/format", creatorDescFormat)
  484. // article
  485. creator.GET("/article/pre", creatorArticlePre)
  486. creator.GET("/article/list", creatorArticleList)
  487. creator.GET("/article/view", creatorArticle)
  488. creator.POST("/article/delete", creatorDelArticle)
  489. creator.POST("/article/withdraw", creatorWithDrawArticle)
  490. creator.GET("/draft/list", creatorDraftList)
  491. // danmu
  492. creator.GET("/danmu/list", creatorDmList)
  493. creator.GET("/danmu/recent", creatorDmRecent)
  494. creator.POST("/danmu/edit", creatorDmEdit)
  495. creator.POST("/danmu/edit/batch", creatorDmEditBatch)
  496. //data
  497. creator.GET("/data/archive", creatorDataArchive)
  498. creator.GET("/data/article", creatorDataArticle)
  499. }
  500. i := e.Group("/x/internal/creative", verifySvc.Verify)
  501. {
  502. // TODO deprecated
  503. i.GET("/porder", upPorder)
  504. // for main app
  505. i.GET("/app/pre", appNewPre)
  506. // get order game info for app
  507. i.GET("/arc/commercial", arcCommercial)
  508. i.POST("/watermark/set", waterMarkSetInternal)
  509. i.GET("/order/game", arcOrderGameInfo)
  510. i.POST("/upload/material", uploadMaterial)
  511. i.POST("/join/growup/account", growAccountStateInternal)
  512. i.GET("/video/viewpoints", videoViewPoints)
  513. i.GET("/archive/bgm", arcBgmList)
  514. i.GET("/archive/staff", arcStaff)
  515. i.GET("/archive/vote", voteAcsByTime)
  516. //联合投稿配置
  517. i.GET("/staff/config", staffConfig)
  518. // data
  519. i.GET("/data/videoquit", setContextMid, webVideoQuitPoints)
  520. i.GET("/data/archive", setContextMid, webArchive)
  521. i.GET("/data/article", setContextMid, webArticleData)
  522. i.GET("/data/base", setContextMid, base)
  523. i.GET("/data/trend", setContextMid, trend)
  524. i.GET("/data/action", setContextMid, action)
  525. i.GET("/data/survey", setContextMid, survey)
  526. i.GET("/data/pandect", setContextMid, pandect)
  527. i.GET("/data/fan", setContextMid, webFan)
  528. i.GET("/data/playsource", setContextMid, webPlaySource)
  529. i.GET("/data/playanalysis", setContextMid, webArcPlayAnalysis)
  530. i.GET("/data/article/thirty", setContextMid, webArtThirtyDay)
  531. i.GET("/data/article/rank", setContextMid, webArtRank)
  532. i.GET("/data/article/source", setContextMid, webArtReadAnalysis)
  533. // archive
  534. i.GET("/archives", setContextMid, webArchives)
  535. // videos
  536. i.GET("/archive/videos", setContextMid, webVideos)
  537. // history
  538. i.GET("/archive/history/list", setContextMid, webHistoryList)
  539. // danmu
  540. i.GET("/danmu/distri", setContextMid, webDmDistri)
  541. // up weekly honor
  542. i.GET("/task/pub/list", setContextMid, taskPubList) //其他业务方查看任务列表
  543. }
  544. }