@@ -0,0 +1,105 @@
|
||||
package aiUnDressmod
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"91porn-server/models/commod"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
// RechargeUpdateReq 修改参数
|
||||
type RechargeUpdateReq struct {
|
||||
StatusDesc *string `json:"statusDesc" bson:"statusDesc"` // 状态描述
|
||||
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"` // 更新时间
|
||||
}
|
||||
|
||||
type RchgQueryReq struct {
|
||||
ID *string `form:"id" json:"_id,omitempty" bson:"_id"` // 流水id
|
||||
UID *uint64 `form:"uid" json:"uid,omitempty" bson:"uid"` // 用户id
|
||||
Status *int `form:"status" json:"status,omitempty" bson:"status"` // 1、进行中 2、生成成功 3、生成失败 4、已经退款
|
||||
}
|
||||
|
||||
type WebListRequest struct {
|
||||
Status *int `form:"status" json:"status" bson:"status"` // 1、进行中 2、生成成功 3、生成失败 4、已经退款
|
||||
UID *uint64 `form:"uid" json:"uid,omitempty" bson:"uid"` // 用户id
|
||||
ID *string `form:"id" json:"_id,omitempty" bson:"_id"` // 流水id
|
||||
commod.Page
|
||||
}
|
||||
|
||||
func (receiver *WebListRequest) Filter() primitive.M {
|
||||
filter := bson.M{}
|
||||
if receiver.Status != nil {
|
||||
filter["status"] = receiver.Status
|
||||
}
|
||||
if receiver.UID != nil {
|
||||
filter["uid"] = receiver.UID
|
||||
}
|
||||
if receiver.ID != nil {
|
||||
id, _ := primitive.ObjectIDFromHex(*receiver.ID)
|
||||
filter["_id"] = id
|
||||
}
|
||||
return filter
|
||||
}
|
||||
|
||||
func (receiver *WebListRequest) Options() *options.FindOptions {
|
||||
return options.Find().SetSkip(int64(receiver.Skip())).SetLimit(int64(receiver.Limit() + 1)).SetSort(bson.M{"updatedAt": -1})
|
||||
}
|
||||
|
||||
type EditCond struct {
|
||||
ID string `json:"id" binding:"required"` // 文档
|
||||
NewPic *[]string `json:"newPic" bson:"newPic"` // 脱衣后新图
|
||||
Status *int `json:"status" bson:"status"` // 状态 1、进行中 2、生成成功 3、生成失败
|
||||
Remark *string `json:"remark" bson:"remark"` // 拒绝理由
|
||||
}
|
||||
|
||||
type AutoCond struct {
|
||||
ID string `json:"id" binding:"required"` // 文档
|
||||
}
|
||||
|
||||
type AutoBatchCond struct {
|
||||
IDs []string `json:"ids" from:"ids" binding:"required"` // 文档
|
||||
Pass bool `json:"pass" from:"pass"` // 是否通过
|
||||
Remark string `json:"remark" from:"remark"` // 拒绝理由
|
||||
}
|
||||
|
||||
func (receiver *EditCond) Filter() bson.M {
|
||||
objID, _ := primitive.ObjectIDFromHex(receiver.ID)
|
||||
return bson.M{"_id": objID}
|
||||
}
|
||||
|
||||
func (receiver *EditCond) Update(updateAct string) bson.M {
|
||||
var update = bson.M{}
|
||||
if receiver.NewPic != nil {
|
||||
update["newPic"] = receiver.NewPic
|
||||
}
|
||||
if receiver.Status != nil {
|
||||
update["status"] = receiver.Status
|
||||
}
|
||||
if receiver.Remark != nil {
|
||||
update["remark"] = receiver.Remark
|
||||
}
|
||||
update["updateAct"] = updateAct
|
||||
update["updatedAt"] = time.Now()
|
||||
return bson.M{"$set": update}
|
||||
}
|
||||
|
||||
type AiUndressOrderReq struct {
|
||||
AppId int `json:"appId"`
|
||||
FileUrl []string `json:"fileUrl"` //base64存的文件服地址
|
||||
UserId string `json:"userId"` //用户id
|
||||
AppOrderNum string `json:"appOrderNum"` //app中生成的订单号
|
||||
NotifyUrl string `json:"notifyUrl"` //回调产品地址
|
||||
}
|
||||
|
||||
type AiUndressOrderResp struct {
|
||||
Code int `json:"code"`
|
||||
}
|
||||
|
||||
type CallBackReq struct {
|
||||
ImgUrl []string `json:"imgUrl"` //脱衣后地址
|
||||
AppOrderNum string `json:"appOrderNum"` //app订单号
|
||||
Msg string `json:"msg"` //消息
|
||||
}
|
||||
Reference in New Issue
Block a user