package request

import (
	"gin-vue-admin/model"
	"time"
)

//支付
type OrderPayReq struct {
	OrderNo       string  `json:"orderNo"`     //订单id 必传多个用,隔开
	PayMoney      float64 `json:"payMoney"`    //订单价格 单位分
	WxCode        string  `json:"wxCode"`      //微信code必传
	PayCallBack   string  `json:"payCallBack"` //微信回调地址
	Openid        string  `json:"openid"`      //wxopenid
	UserType      int     `json:"userType"`    //wxopenid
	UserCharacter int     `form:"userCharacter" json:"userCharacter"`
}

type CallBackReq struct {
	AttachInfo    string `json:"attach_info"`
	OutTradeNo    string `json:"out_trade_no"`
	TransactionId string `json:"transaction_id"`
	Type          int    `json:"type"`
}

type OpenVipReq struct {
	VipId     int    `json:"vipId"`
	Money     int    `json:"money"`
	WxCode    string `json:"wxCode"`
	Openid    string `json:"openid"`
	IsPoints  int    `json:"isPoints"`
	PointsNum int    `json:"pointsNum"`
	UserType  int    `json:"userType"`
}

type OpenVipReply struct {
}

type GetVipConfListReq struct {
	IsNewUser int `json:"isNewUser"`
}

// User register structure
type GetVipConfListReply struct {
	List          []model.VipConf `json:"list"`
	SysConfPoints SysConfPoints   `json:"confPoints"`
	Total         int64           `json:"total"`
}

type VipOrderInsertReq struct {
	OrderNo  string `json:"orderNo"`
	UserId   int    `json:"userId"`
	VipLevel int    `json:"vipLevel"`
	VipMoney int    `json:"vipMoney"`
	PayMoney int    `json:"payMoney"`
	Status   int    `json:"status"`
	Remark   string `json:"remark"`
}

type VipOrderInsertReply struct {
}

type VipOrderUpdateReq struct {
	OrderNo string `json:"orderNo"`
	Status  int    `json:"status"`
}

type VipOrderUpdateReply struct {
}

type OpenVipOwnReq struct {
	Mobile string `json:"mobile"`
	Remark string `json:"remark"`
	Day    int    `json:"day"`
}

type OpenVipOwnReply struct {
}

type GetVipOrderListReq struct {
	PageInfo
	Mobile          string `json:"mobile" form:"mobile"`
	StartCreateTime string `json:"startCreateTime" form:"startCreateTime"`
	EndCreateTime   string `json:"endCreateTime" form:"endCreateTime"`
	OrderType       string `json:"orderType" form:"orderType"`
	VipLevel        string `json:"vipLevel" form:"vipLevel"`
	UserType        string `json:"userType" form:"userType"`
}

// User register structure
type GetVipOrderListReply struct {
	List  []VipOrderList `json:"list"`
	Total int64          `json:"total"`
}

type VipOrderList struct {
	Id         int       `json:"id" form:"id" gorm:"column:id;comment:;type:int;size:10;"` // 主键ID
	UserId     int       `json:"userId" form:"userId" gorm:"column:user_id;comment:;type:int;size:10;"`
	Mobile     string    `json:"mobile" gorm:"comment:用户登录名"` // 用户登录名
	NickName   string    `json:"nickName"`
	Name       string    `json:"name"`
	OrderType  int       `json:"orderType"`
	OutTradeNo string    `json:"outTradeNo" form:"outTradeNo" gorm:"column:out_trade_no;comment:;type:varchar(255);"`
	VipDay     int       `json:"vipDay" form:"vipDay" gorm:"column:vip_day;comment:;type:int;size:10;"`
	VipLevel   int       `json:"vipLevel" form:"vipLevel" gorm:"column:vip_level;comment:;type:int;size:10;"`
	VipMoney   int       `json:"vipMoney" form:"vipMoney" gorm:"column:vip_money;comment:;type:int;size:10;"`
	PayMoney   int       `json:"payMoney" form:"payMoney" gorm:"column:pay_money;comment:;type:int;size:10;"`
	Status     int       `json:"status" form:"status" gorm:"column:status;comment:;type:int;size:10;"`
	IsPoints   int       `json:"isPoints" form:"isPoints" gorm:"column:is_points;comment:;type:int;size:10;"`
	PointsNum  int       `json:"pointsNum" form:"pointsNum" gorm:"column:points_num;comment:;type:int;size:10;"`
	Remark     string    `json:"remark" form:"remark" gorm:"column:remark;comment:;type:varchar(255);"`
	PayTime    time.Time `json:"payTime" form:"payTime" gorm:"column:pay_time;comment:;type:DATETIME;"`
	CreateTime time.Time `json:"createTime" form:"createTime" gorm:"column:create_time;comment:;type:timestamp;"`
}
