@@ -0,0 +1,91 @@
|
||||
package aichangefacevidmod
|
||||
|
||||
import (
|
||||
"91porn-server/models/commod"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type ListRequest struct {
|
||||
Status *int `form:"status" json:"status"`
|
||||
ModuleType *int `form:"moduleType" json:"moduleType"` // 模块属性
|
||||
commod.Page
|
||||
}
|
||||
|
||||
type AddAiChangeFaceVidReq struct {
|
||||
Title string `json:"title"` // 视频标题
|
||||
SourceURL string `json:"sourceURL"` // 视频资源地址
|
||||
Status int `json:"status"` // 状态,0 未激活 1 激活
|
||||
PlayTime uint `json:"playTime"` // 影片长度
|
||||
Cover string `json:"cover"` // 封面大图
|
||||
NewUrl string `json:"newUrl" bson:"newUrl"` // 生成后链接
|
||||
ModuleType int `json:"moduleType" bson:"moduleType"` // 模块属性
|
||||
HotValue int `json:"hotValue" bson:"hotValue"` // 热门值
|
||||
HotMark string `json:"hotMark" bson:"hotMark"` // 热门标签
|
||||
Type string `json:"type"` // 类型
|
||||
StyleType int `json:"styleType" bson:"styleType"` // 风格类型
|
||||
Coin uint `json:"coin"` // 模版价格
|
||||
Sort int `json:"sort" bson:"sort"` // 排序
|
||||
VipCoin uint `json:"vipCoin"` // 模版会员价格
|
||||
SceneType int `json:"sceneType" form:"sceneType"` // 场景类型
|
||||
}
|
||||
|
||||
type EditAiChangeFaceVid struct {
|
||||
ID primitive.ObjectID `json:"id" binding:"required"`
|
||||
Title *string `json:"title"` // 视频标题
|
||||
SourceURL *string `json:"sourceURL"` // 视频资源地址
|
||||
Status *int `json:"status"` // 状态,0 未激活 1 激活
|
||||
PlayTime *uint `json:"playTime"` // 影片长度
|
||||
Cover *string `json:"cover"` // 封面大图
|
||||
ModuleType *int `json:"moduleType" bson:"moduleType"` // 模块属性
|
||||
StyleType *int `json:"styleType" bson:"styleType"` // 风格类型
|
||||
NewUrl *string `json:"newUrl" bson:"newUrl"` // 生成后链接
|
||||
HotValue *int `json:"hotValue" bson:"hotValue"` // 热门值
|
||||
HotMark *string `json:"hotMark" bson:"hotMark"` // 热门标签
|
||||
Type *string `json:"type"` // 类型
|
||||
Coin *uint `json:"coin"` // 模版价格
|
||||
Sort *int `json:"sort" bson:"sort"` // 排序
|
||||
VipCoin *uint `json:"vipCoin"` // 模版会员价格
|
||||
SceneType *int `json:"sceneType" form:"sceneType"` // 场景类型
|
||||
}
|
||||
|
||||
func AddAiChangeFaceVid(afvm AiChangeFaceVidMod) error {
|
||||
_, err := coll(nil).InsertOne(afvm)
|
||||
return err
|
||||
}
|
||||
|
||||
func UpdateAiChangeFaceVid(id primitive.ObjectID, set bson.M) error {
|
||||
_, err := coll(nil).UpdateOne(bson.M{"_id": id}, set)
|
||||
return err
|
||||
}
|
||||
|
||||
type WebListRequest struct {
|
||||
Status *int `form:"status" json:"status" bson:"status"` // 状态
|
||||
ModuleType *int `form:"moduleType" json:"moduleType" bson:"moduleType"` // 模块属性
|
||||
PageNumber int64 `form:"pageNumber" json:"pageNumber"` // 第几页
|
||||
PageSize int64 `form:"pageSize" json:"pageSize"` // 每页数量
|
||||
}
|
||||
|
||||
func (receiver *WebListRequest) Filter() primitive.M {
|
||||
filter := bson.M{}
|
||||
if receiver.Status != nil {
|
||||
filter["status"] = receiver.Status
|
||||
}
|
||||
if receiver.ModuleType != nil {
|
||||
filter["moduleType"] = receiver.ModuleType
|
||||
}
|
||||
return filter
|
||||
}
|
||||
func (receiver *WebListRequest) Options() *options.FindOptions {
|
||||
return options.Find().SetSkip((receiver.PageNumber - 1) * receiver.PageSize).SetLimit(receiver.PageSize + 1).SetSort(bson.D{{Key: "sort", Value: -1}, {Key: "createdAt", Value: -1}})
|
||||
}
|
||||
|
||||
// 换脸订单回调请求
|
||||
type CallbackReq struct {
|
||||
ImgUrl string `json:"imgUrl"` //脱衣后地址
|
||||
AppOrderNum string `json:"appOrderNum"` //app订单号
|
||||
Msg string `json:"msg"` //消息
|
||||
}
|
||||
Reference in New Issue
Block a user