service/dbstruct/vas_mongo.go

64 lines
2.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dbstruct
import "math"
// 用户增值信息
const (
UserVasLockTypeOpen = 0 // 公开
UserVasLockTypeLock = 1 // 私密
)
type UserVasInfo struct {
Mid int64 `json:"mid" bson:"_id"`
WechatLockType int32 `json:"wechat_lock_type" bson:"wechat_lock_type"` // 上锁方式见UserVasLockType*
WechatContact string `json:"wechat_contact" bson:"wechat_contact"` // 微信联系方式
WechatCoinPrice int64 `json:"wechat_coin_price" bson:"wechat_coin_price"` // 微信联系方式价格
WechatUt int64 `json:"wechat_ut" bson:"wechat_ut"` // 微信联系方式更新时间
}
func (p UserVasInfo) GetH5WechatCoinPrice() int64 {
return int64(math.Ceil(float64(p.WechatCoinPrice)/9)) * 10
}
// 金币订单oplog
const (
OrderOpLogActionAdd = "add"
OrderOpLogActionUpdate = "update"
)
const (
OrderOpLogOperatorTypeUser = "user" // 用户
OrderOpLogOperatorTypeOp = "op" // 运营
)
const (
OrderOpLogResultFail = "fail" // 结果失败
OrderOpLogResultOk = "ok" // 结果成功
)
type OplogCoinOrder struct {
OrderId string `json:"order_id" bson:"order_id"`
Mid int64 `json:"mid" bson:"mid"`
Ct int64 `json:"ct" bson:"ct"`
Action string `json:"action" bson:"action"` // 动作
OperatorType string `json:"operator_type" bson:"operator_type"` // 操作人类型见CoinOrderOpLogOperatorType*
Operator string `json:"operator" bson:"operator"` // 操作人
Detail string `json:"detail" bson:"detail"` // 操作详情
Result string `json:"result" bson:"result"` // 结果
BeforeStatus int32 `json:"before_status" bson:"before_status"`
AfterStatus int32 `json:"after_status" bson:"after_status"`
}
type OplogOrder struct {
OrderId string `json:"order_id" bson:"order_id"`
Mid int64 `json:"mid" bson:"mid"`
Ct int64 `json:"ct" bson:"ct"`
Action string `json:"action" bson:"action"` // 动作
OperatorType string `json:"operator_type" bson:"operator_type"` // 操作人类型见CoinOrderOpLogOperatorType*
Operator string `json:"operator" bson:"operator"` // 操作人
Detail string `json:"detail" bson:"detail"` // 操作详情
Result string `json:"result" bson:"result"` // 结果
BeforeStatus int32 `json:"before_status" bson:"before_status"`
AfterStatus int32 `json:"after_status" bson:"after_status"`
}