Initial commit
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_announcement"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func announcementRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/announcement")
|
||||
{
|
||||
group.POST("/list", web_announcement.AnnouncementList)
|
||||
group.POST("/add", web_announcement.AnnouncementAdd)
|
||||
group.POST("/del", web_announcement.AnnouncementDel)
|
||||
group.POST("/update", web_announcement.AnnouncementUpdate)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
webanalytics "videoweb/web/api/web_analytics"
|
||||
"videoweb/web/api/web_cfg"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func syscfgRouter(router *gin.RouterGroup) {
|
||||
system := router.Group("/syscfg")
|
||||
{
|
||||
system.GET("/get", web_cfg.GetCfg)
|
||||
system.POST("/update", web_cfg.UpdateCfg)
|
||||
}
|
||||
|
||||
stat := router.Group("/stat")
|
||||
{
|
||||
stat.GET("/analytics", webanalytics.GetAnalyticsStat)
|
||||
stat.GET("/daily/analytics", webanalytics.GetAnalyticsDailyStat)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_card"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func cardRouter(router *gin.RouterGroup) {
|
||||
card := router.Group("/card")
|
||||
{
|
||||
card.POST("/order/list", web_card.GetOrders)
|
||||
card.POST("/order/district/sync", web_card.SyncDistrictCode)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_coin"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func coinRouter(router *gin.RouterGroup) {
|
||||
coin := router.Group("/coin")
|
||||
{
|
||||
coin.POST("/trans", web_coin.GetCoinTrans)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_commend"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func commentRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/post")
|
||||
{
|
||||
group.POST("/comment/list", web_commend.SearchManyCommend)
|
||||
group.POST("/comment/replay", web_commend.ReplayPostComment)
|
||||
group.POST("/comment/del", web_commend.DelCommend)
|
||||
group.POST("/comment/user/del", web_commend.DelUserCommend)
|
||||
group.POST("/comment/reviewBatch", web_commend.ReviewCommendBatch)
|
||||
group.POST("/comment/review", web_commend.ReviewComment)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_contactus"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func contactUsRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/contactus")
|
||||
{
|
||||
group.GET("/list", web_contactus.List)
|
||||
group.POST("/handle", web_contactus.Handle)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_detailnav"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func detailNavRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/detailnav")
|
||||
{
|
||||
group.POST("/list", web_detailnav.DetailNavList)
|
||||
group.POST("/add", web_detailnav.DetailNavAdd)
|
||||
group.POST("/del", web_detailnav.DetailNavDel)
|
||||
group.POST("/update", web_detailnav.DetailNavUpdate)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_feedback"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func feedbackRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/feedback")
|
||||
{
|
||||
group.GET("/list", web_feedback.List)
|
||||
group.POST("/handle", web_feedback.Handle)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_file"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func fileRouter(router *gin.RouterGroup) {
|
||||
// 文件上传
|
||||
file := router.Group("/file")
|
||||
{
|
||||
file.POST("/uploadImg", web_file.UploadImage)
|
||||
file.POST("/uploadImgs", web_file.UploadImages)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"videoweb/pub/common/errors"
|
||||
"videoweb/pub/common/log"
|
||||
"videoweb/web/middleware/auth"
|
||||
"videoweb/web/middleware/cors"
|
||||
"videoweb/web/middleware/ipblacklist"
|
||||
"videoweb/web/middleware/limitHandler"
|
||||
"videoweb/web/webg"
|
||||
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
|
||||
"github.com/DeanThompson/ginpprof"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
_ "videoweb/web/docs"
|
||||
)
|
||||
|
||||
func Init() (engine *gin.Engine) {
|
||||
|
||||
// 设置启动模式
|
||||
switch webg.Conf.RunMod {
|
||||
case "dev":
|
||||
gin.SetMode(gin.DebugMode)
|
||||
case "test":
|
||||
gin.SetMode(gin.TestMode)
|
||||
case "prod":
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
default:
|
||||
gin.SetMode(gin.DebugMode)
|
||||
}
|
||||
|
||||
// 初始化gin引擎
|
||||
engine = gin.Default()
|
||||
engine.HandleMethodNotAllowed = true
|
||||
engine.MaxMultipartMemory = 60 << 20
|
||||
|
||||
engine.NoMethod(noMethod)
|
||||
engine.NoRoute(noRoute)
|
||||
|
||||
// 注册中间件
|
||||
registeMiddleware(engine)
|
||||
wbVideoDataRouter(engine)
|
||||
registerRouter(engine)
|
||||
log.Info("setGinSwaggerxxxxx")
|
||||
|
||||
if webg.Conf.RunMod != "prod" {
|
||||
log.Info("setGinSwagger")
|
||||
setGinSwagger(engine)
|
||||
log.Info("setGinSwagger end")
|
||||
}
|
||||
|
||||
// 是否开启监控服务
|
||||
if webg.Conf.Pprof {
|
||||
ginpprof.Wrap(engine)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func noMethod(c *gin.Context) {
|
||||
c.JSON(http.StatusMethodNotAllowed, errors.MakeWithMsg(errors.MethodNotFound, "MethodNotFound"))
|
||||
}
|
||||
|
||||
func noRoute(c *gin.Context) {
|
||||
c.JSON(http.StatusNotFound, errors.MakeWithMsg(errors.ApiNotFound, "ApiNotFound"))
|
||||
}
|
||||
|
||||
func registeMiddleware(engine *gin.Engine) {
|
||||
engine.Use(gin.Recovery())
|
||||
engine.Use(cors.Cors(&cors.Options{
|
||||
Origin: nil, // "*"
|
||||
Methods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodHead, http.MethodDelete},
|
||||
AllowedHeaders: []string{"Content-Length", "Content-Type", "Authorization", "X-User-Agent"},
|
||||
ExposedHeaders: []string{"Content-Disposition", "Refresh-Authorization"},
|
||||
OptionsSuccessStatus: http.StatusOK,
|
||||
}))
|
||||
engine.Use(ipblacklist.IpBlackListMiddleware)
|
||||
engine.Use(auth.Auth)
|
||||
engine.Use(limitHandler.LoginLimit)
|
||||
engine.Use(auth.OperateLog)
|
||||
}
|
||||
|
||||
// 设置swag 接口信息
|
||||
func setGinSwagger(router *gin.Engine) {
|
||||
url := ginSwagger.URL(fmt.Sprintf("http://%s:%s/swagger/doc.json", webg.Conf.Host, webg.Conf.ListenAddr))
|
||||
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
|
||||
}
|
||||
|
||||
func registerRouter(router *gin.Engine) {
|
||||
rootRouter := router.Group("/api/web")
|
||||
{
|
||||
MainWebRouter(rootRouter)
|
||||
syscfgRouter(rootRouter)
|
||||
fileRouter(rootRouter)
|
||||
videoRouter(rootRouter)
|
||||
richTextContent(rootRouter)
|
||||
commentRouter(rootRouter)
|
||||
ipBlackRouter(rootRouter)
|
||||
detailNavRouter(rootRouter)
|
||||
announcementRouter(rootRouter)
|
||||
cardRouter(rootRouter)
|
||||
coinRouter(rootRouter)
|
||||
rechargePackageRouter(rootRouter)
|
||||
userRouter(rootRouter)
|
||||
translationRouter(rootRouter)
|
||||
mediaResourceRouter(rootRouter)
|
||||
playletRouter(rootRouter)
|
||||
homeBannerRouter(rootRouter)
|
||||
feedbackRouter(rootRouter)
|
||||
contactUsRouter(rootRouter)
|
||||
}
|
||||
// 第三方回调路由(免鉴权,挂在 engine 上而非 /api/web 分组)
|
||||
thirdRouter(router)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_homebanner"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func homeBannerRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/home/banner")
|
||||
{
|
||||
group.GET("/list", web_homebanner.List)
|
||||
group.POST("/add", web_homebanner.Add)
|
||||
group.POST("/update", web_homebanner.Update)
|
||||
group.POST("/del", web_homebanner.Del)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"videoweb/web/api/web_ipblack"
|
||||
)
|
||||
|
||||
func ipBlackRouter(router *gin.RouterGroup) {
|
||||
// 文件上传
|
||||
group := router.Group("/ipblack")
|
||||
{
|
||||
group.POST("/list", web_ipblack.IpBlackList)
|
||||
group.POST("/add", web_ipblack.IpBlackAdd)
|
||||
group.POST("/del", web_ipblack.IpBlackDel)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_mediaresource"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func mediaResourceRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/resource")
|
||||
{
|
||||
group.GET("/list", web_mediaresource.ResourceList)
|
||||
group.GET("/jh/list", web_mediaresource.ResourceJHList)
|
||||
group.GET("/jh/chapters", web_mediaresource.ResourceJHChapters)
|
||||
group.POST("/jh/import", web_mediaresource.ResourceJHImport)
|
||||
group.GET("/chapters", web_mediaresource.ResourceChapters)
|
||||
group.POST("/import", web_mediaresource.ResourceImport)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_playlet"
|
||||
"videoweb/web/api/web_playletcategory"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func playletRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/playlet")
|
||||
{
|
||||
group.GET("/list", web_playlet.List)
|
||||
group.POST("/add", web_playlet.Add)
|
||||
group.POST("/update", web_playlet.Update)
|
||||
group.POST("/status/set", web_playlet.SetStatus)
|
||||
group.POST("/online-at/fill", web_playlet.FillOnlineAt)
|
||||
group.POST("/recommend/set", web_playlet.SetRecommend)
|
||||
group.POST("/featured/set", web_playlet.SetFeatured)
|
||||
group.POST("/operate-type/set", web_playlet.SetOperateType)
|
||||
group.POST("/banner/set", web_playlet.SetBanner)
|
||||
group.POST("/theme/set", web_playlet.SetTheme)
|
||||
group.POST("/category/set", web_playlet.SetCategory)
|
||||
group.POST("/tag/set", web_playlet.SetTag)
|
||||
group.POST("/like/virtual/set", web_playlet.SetVirtualLike)
|
||||
group.POST("/pay-type/set", web_playlet.SetPayType)
|
||||
group.POST("/watermark/reset", web_playlet.ResetWatermark)
|
||||
group.POST("/slug/sync", web_playlet.SyncSlug)
|
||||
group.GET("/chapter/list", web_playlet.ChapterList)
|
||||
group.POST("/chapter/add", web_playlet.ChapterAdd)
|
||||
group.POST("/chapter/update", web_playlet.ChapterUpdate)
|
||||
group.POST("/chapter/del", web_playlet.ChapterDel)
|
||||
group.POST("/chapter/pay-type/set", web_playlet.ChapterSetPayType)
|
||||
group.POST("/chapter/sync", web_playlet.ChapterSync)
|
||||
group.GET("/category/list", web_playletcategory.List)
|
||||
group.POST("/category/add", web_playletcategory.Add)
|
||||
group.POST("/category/update", web_playletcategory.Update)
|
||||
group.POST("/category/del", web_playletcategory.Del)
|
||||
group.GET("/theme/list", web_playlet.ThemeList)
|
||||
group.POST("/theme/add", web_playlet.ThemeAdd)
|
||||
group.POST("/theme/update", web_playlet.ThemeUpdate)
|
||||
group.POST("/theme/recommend/set", web_playlet.SetThemeRecommend)
|
||||
group.POST("/theme/del", web_playlet.ThemeDel)
|
||||
group.GET("/tag/list", web_playlet.TagList)
|
||||
group.POST("/tag/add", web_playlet.TagAdd)
|
||||
group.POST("/tag/update", web_playlet.TagUpdate)
|
||||
group.POST("/tag/del", web_playlet.TagDel)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_rechargepackage"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func rechargePackageRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("/recharge/package")
|
||||
{
|
||||
group.POST("/list", web_rechargepackage.List)
|
||||
group.POST("/vip/list", web_rechargepackage.VipList)
|
||||
group.POST("/add", web_rechargepackage.Add)
|
||||
group.POST("/update", web_rechargepackage.Update)
|
||||
group.POST("/del", web_rechargepackage.Delete)
|
||||
group.POST("/status/set", web_rechargepackage.SetStatus)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"videoweb/web/api/web_richtextcontent"
|
||||
)
|
||||
|
||||
func richTextContent(router *gin.RouterGroup) {
|
||||
// 文件上传
|
||||
file := router.Group("/richtextcontent")
|
||||
{
|
||||
file.POST("/list", web_richtextcontent.List)
|
||||
file.POST("/add", web_richtextcontent.Add)
|
||||
file.POST("/del", web_richtextcontent.Del)
|
||||
file.POST("/update", web_richtextcontent.Update)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_acc"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 主后台路由
|
||||
func MainWebRouter(router *gin.RouterGroup) {
|
||||
login := router.Group("/login")
|
||||
{
|
||||
login.POST("/acc", web_acc.AccLogin)
|
||||
login.POST("/bind", web_acc.BindQurl)
|
||||
login.POST("/slogin", web_acc.SLogin)
|
||||
}
|
||||
|
||||
role := router.Group("/role")
|
||||
{
|
||||
role.GET("/list", web_acc.RoleGetList)
|
||||
role.POST("/add", web_acc.RoleAdd)
|
||||
role.POST("/del", web_acc.RoleDel)
|
||||
role.GET("/getinfo", web_acc.RoleGetInfo)
|
||||
role.POST("/up", web_acc.RoleUp)
|
||||
role.POST("/enable", web_acc.RoleEnable)
|
||||
role.POST("/drop", web_acc.RoleGetDrop)
|
||||
role.GET("/getauth", web_acc.RoleGetAuth)
|
||||
role.POST("/upauth", web_acc.RoleUpAuth)
|
||||
}
|
||||
acc := router.Group("/acc")
|
||||
{
|
||||
acc.GET("/list", web_acc.AccGetList)
|
||||
acc.POST("/add", web_acc.AccAdd)
|
||||
acc.POST("/del", web_acc.AccDel)
|
||||
acc.GET("/getinfo", web_acc.AccGetInfo)
|
||||
acc.POST("/up", web_acc.AccUp)
|
||||
acc.GET("/getstatus", web_acc.AccGetStatus)
|
||||
acc.POST("/savestatus", web_acc.AccSaveStatus)
|
||||
acc.POST("/ops", web_acc.GetAccOpRecords)
|
||||
acc.POST("/uppwd", web_acc.AccUpdatePwd)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_recharge"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func thirdRouter(r *gin.Engine) {
|
||||
thirdGroup := r.Group("/api/web/third")
|
||||
{
|
||||
paycenterGroup := thirdGroup.Group("/paycenter")
|
||||
{
|
||||
paycenterGroup.POST("/bill/callback", web_recharge.PayCenterBillCallback)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_translation"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func translationRouter(router *gin.RouterGroup) {
|
||||
translation := router.Group("/translation")
|
||||
{
|
||||
translation.POST("/list", web_translation.GetTranslation)
|
||||
translation.POST("/update", web_translation.UpdateOnetTranslation)
|
||||
translation.POST("/del", web_translation.DelOnetTranslation)
|
||||
translation.POST("/add", web_translation.AddOnetTranslation)
|
||||
}
|
||||
translationcategory := router.Group("/translationcategory")
|
||||
{
|
||||
translationcategory.POST("/list", web_translation.GetTranslationCategory)
|
||||
translationcategory.POST("/update", web_translation.UpdateOnetTranslationCategory)
|
||||
translationcategory.POST("/del", web_translation.DelOnetTranslationCategory)
|
||||
translationcategory.POST("/add", web_translation.AddOnetTranslationCategory)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_user"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func userRouter(router *gin.RouterGroup) {
|
||||
user := router.Group("/user")
|
||||
{
|
||||
user.POST("/list", web_user.GetUserList)
|
||||
user.POST("/update", web_user.UpdateUser)
|
||||
user.POST("/giftcoin", web_user.GiftCoin)
|
||||
user.POST("/vip/update", web_user.UpdateVip)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_video"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func videoRouter(router *gin.RouterGroup) {
|
||||
advitise := router.Group("/videoinfo")
|
||||
{
|
||||
advitise.POST("/list", web_video.GetVideoInfo)
|
||||
advitise.POST("/update", web_video.UpdateOneVideoInfo)
|
||||
advitise.POST("/del", web_video.DelOneVideoInfo)
|
||||
advitise.POST("/sync", web_video.SyncVideoInfo)
|
||||
advitise.POST("/addcoll", web_video.AddOneVideoCollection)
|
||||
advitise.POST("/setFakeWatchTimes", web_video.SetVideoFakeWatchTimes)
|
||||
advitise.POST("/transcode", web_video.TranscodeVideo)
|
||||
}
|
||||
videocategory := router.Group("/videocategory")
|
||||
{
|
||||
videocategory.POST("/list", web_video.GetVideoCategory)
|
||||
videocategory.POST("/update", web_video.UpdateOneVideoCategory)
|
||||
videocategory.POST("/del", web_video.DelOneVideoCategory)
|
||||
videocategory.POST("/add", web_video.AddOneVideoCategory)
|
||||
}
|
||||
videotag := router.Group("/videotag")
|
||||
{
|
||||
videotag.POST("/list", web_video.GetVideoTagInfo)
|
||||
videotag.POST("/update", web_video.UpdateOneVideoTagInfo)
|
||||
videotag.POST("/del", web_video.DelOneVideoTagInfo)
|
||||
videotag.POST("/add", web_video.AddOneVideoTagInfo)
|
||||
}
|
||||
|
||||
videocreater := router.Group("/videocreater")
|
||||
{
|
||||
videocreater.POST("/list", web_video.GetVideoCreater)
|
||||
videocreater.POST("/update", web_video.UpdateOneVideoCreater)
|
||||
videocreater.POST("/del", web_video.DelOneVideoCreater)
|
||||
videocreater.POST("/add", web_video.AddOneVideoCreater)
|
||||
}
|
||||
videoTopic := router.Group("/videotopic")
|
||||
{
|
||||
videoTopic.POST("/list", web_video.GetVideoTopic)
|
||||
videoTopic.POST("/update", web_video.UpdateOneVideoTopic)
|
||||
videoTopic.POST("/del", web_video.DelOneVideoTopic)
|
||||
videoTopic.POST("/add", web_video.AddOneVideoTopic)
|
||||
}
|
||||
|
||||
router.GET("/m3u8/*key", web_video.Play)
|
||||
router.GET("/transm3u8/*key", web_video.TranscodeM3u8)
|
||||
router.GET("/enkey", web_video.Enkey)
|
||||
router.GET("/newenkey", web_video.NewEnkey)
|
||||
router.GET("/lsjenkey", web_video.LsjEnkey)
|
||||
router.GET("/videotag/hottag", web_video.GetVideoPlayData)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"videoweb/web/api/web_recharge"
|
||||
"videoweb/web/api/web_video"
|
||||
"videoweb/web/middleware/apilimitHandler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func wbVideoDataRouter(r *gin.Engine) {
|
||||
limiter := apilimitHandler.NewRouteHourlyLimiter(100)
|
||||
router := r.Group("/wbapi/hgdj")
|
||||
{
|
||||
router.Use(limiter.Middleware())
|
||||
//router.GET("/hottag", web_video.GetHotTagByPlayData)
|
||||
router.GET("/ipstat", web_video.GetIpStatData)
|
||||
router.GET("/recharge/summary", web_recharge.RechargeSummary)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user