Documentation ¶
Index ¶
- func CreateBalance(svc *svc.ServiceContext, userId int64) (err error)
- func UpdateBalance(svc *svc.ServiceContext, userBalance UserBalance, ...) (err error)
- func UpdatePasswordByUserId(svc *svc.ServiceContext, userId int64, password string) (err error)
- func UpdatePasswordFreeEnabledByUserId(svc *svc.ServiceContext, userId int64, isPasswordFreeEnabled bool) (err error)
- type UserBalance
- type UserBalanceLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBalance ¶
func CreateBalance(svc *svc.ServiceContext, userId int64) (err error)
func UpdateBalance ¶
func UpdateBalance(svc *svc.ServiceContext, userBalance UserBalance, userBalanceLog UserBalanceLog) (err error)
func UpdatePasswordByUserId ¶
func UpdatePasswordByUserId(svc *svc.ServiceContext, userId int64, password string) (err error)
func UpdatePasswordFreeEnabledByUserId ¶
func UpdatePasswordFreeEnabledByUserId(svc *svc.ServiceContext, userId int64, isPasswordFreeEnabled bool) (err error)
Types ¶
type UserBalance ¶
type UserBalance struct { gorm.Model UserId int64 `json:"user_id" gorm:"type:int(11);index;not null;comment:用户id"` Balance string `json:"balance" gorm:"type:decimal(10,2);default:0;comment:用户余额"` TotalRecharge string `json:"total_recharge" gorm:"type:decimal(10,2);default:0;comment:累计充值的金额"` TotalWithdrawn string `json:"total_withdrawn" gorm:"type:decimal(10,2);default:0;comment:累计提现的金额"` TotalConsumption string `json:"total_consumption" gorm:"type:decimal(10,2);default:0;comment:累计消费的金额"` Status int32 `json:"status" gorm:"type:tinyint(1);default:1;comment: 1正常 2冻结"` Password string `json:"password" gorm:"type:char(32);comment:支付密码"` IsPasswordFreeEnabled bool `json:"is_password_free_enabled" gorm:"type:tinyint(1);default:0;comment: 0不免密 1免密"` PasswordFreeLimit int32 `json:"password_free_limit" gorm:"type:tinyint(2);default:11;comment:免密次数"` }
func GetUserBalanceDetail ¶
func GetUserBalanceDetail(svc *svc.ServiceContext, userId int64) (userBalance UserBalance, err error)
type UserBalanceLog ¶
type UserBalanceLog struct { gorm.Model UserBalanceID int64 `json:"record_id" gorm:"type:int(11);not null;comment:订单金额"` UserID int64 `json:"user_id" gorm:"type:int(11);index;not null;comment:用户id"` Amount string `json:"amount" gorm:"type:decimal(10,2);comment:变动金额"` Sn string `json:"sn" gorm:"type:varchar(48);comment:充值编号"` TransactionType int32 `json:"transaction_type" gorm:"type:tinyint(1);not null;comment: 1消费 2提现 3退款 4充值"` }
func GetUserBalanceLogs ¶
func GetUserBalanceLogs(svc *svc.ServiceContext, userId int64, size, pageSize int64) (userBalanceLog []UserBalanceLog, err error)
Click to show internal directories.
Click to hide internal directories.