2 Star 0 Fork 0

BOBO/创想视频核心服务

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
video_episodes.go 934 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhouyp 提交于 2024-07-30 15:54 . fix:修复视频BUG
package validate
import (
"context"
"gitee.com/bobo-rs/innovideo-services/framework/service"
"gitee.com/bobo-rs/innovideo-services/library/exception"
"github.com/gogf/gf/v2/util/gvalid"
)
// RuleEpisodesExistsById 通过剧集ID检测视频剧集是否存在
func RuleEpisodesExistsById(ctx context.Context, in gvalid.RuleFuncInput) error {
if in.Value.Uint() == 0 {
return nil
}
// 视频剧集
if b, _ := service.Video().EpisodesModel().ExistsPri(ctx, in.Value.Uint()); !b {
return exception.New(`视频剧集不存在`)
}
return nil
}
// RuleResolutionExistsById 通过清晰度ID检测视频清晰度是否存在
func RuleResolutionExistsById(ctx context.Context, in gvalid.RuleFuncInput) error {
if in.Value.Uint() == 0 {
return nil
}
// 视频清晰度
if b, _ := service.Video().ResolutionModel().ExistsPri(ctx, in.Value.Uint()); !b {
return exception.New(`清晰度数据不存在`)
}
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/bobo-rs/innovideo-services.git
git@gitee.com:bobo-rs/innovideo-services.git
bobo-rs
innovideo-services
创想视频核心服务
v1.0.19

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385