60 lines
1.8 KiB
Go
60 lines
1.8 KiB
Go
package synccdnctrl
|
|
|
|
import (
|
|
"91porn-server/common"
|
|
"91porn-server/common/stderr"
|
|
"91porn-server/models/l/synccdnmod"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// SyncCdn doc
|
|
// @Summary
|
|
// @Description 同步m3u8到cdn节点
|
|
// @Tags WEB-uploaddown
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Param token formData string true "调用此接口的token""
|
|
// @Param pageSize formData integer true "视频来源"
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /web/admin/vid/syncCdn [post]
|
|
func SyncCdn(ctx *gin.Context) {
|
|
param := synccdnmod.SyncReq{}
|
|
if err := ctx.ShouldBind(¶m); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
|
return
|
|
}
|
|
if param.Token != "NS@33E7r4GUW0Op3" {
|
|
common.ServeJSON(ctx, stderr.ErrNoToken, nil)
|
|
return
|
|
}
|
|
//code, data := synccdnser.SyncCdn()
|
|
common.ServeJSON(ctx, stderr.Failure, "")
|
|
}
|
|
|
|
// SyncWithOptions doc
|
|
// @Summary
|
|
// @Description SyncWithOptions 预热cdn
|
|
// @Tags WEB-uploaddown
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Param cdn formData string true "cdn名字"
|
|
// @Param token formData string true "调用此接口的token""
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /web/admin/vid/SyncWithOptions [post]
|
|
func SyncWithOptions(ctx *gin.Context) {
|
|
param := synccdnmod.SyncReq{}
|
|
if err := ctx.ShouldBind(¶m); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
|
return
|
|
}
|
|
if param.Token != "seFMthomcQegB513" {
|
|
common.ServeJSON(ctx, stderr.ErrNoToken, nil)
|
|
return
|
|
}
|
|
//code, data := synccdnser.SyncWithOptions(param.Cdn, param.FilePath)
|
|
common.ServeJSON(ctx, stderr.Failure, "")
|
|
}
|