🎨 新增余额记录功能

This commit is contained in:
2025-09-10 00:33:06 +08:00
parent c588e9efe7
commit b8b859f890
7 changed files with 122 additions and 4 deletions

15
model/app/balance_log.go Normal file
View File

@@ -0,0 +1,15 @@
package app
import "git.echol.cn/loser/lckt/global"
type BalanceLog struct {
global.GVA_MODEL
UserID uint `json:"userId" form:"userId" gorm:"comment:用户ID"`
ChangeType int `json:"changeType" form:"changeType" gorm:"comment:变动类型 1 增加 2 减少"`
ChangeValue float64 `json:"changeValue" form:"changeValue" gorm:"comment:变动值"`
Balance float64 `json:"balance" form:"balance" gorm:"comment:变动后余额"`
}
func (BalanceLog) TableName() string {
return "app_balance_log"
}

View File

@@ -51,8 +51,9 @@ type GetUserListReq struct {
}
type SetBalanceReq struct {
Id int `json:"id" form:"id" vd:"@:len($)>0; msg:'用户ID不能为空'"`
Balance float32 `json:"balance" form:"balance" vd:"@:len($)>0; msg:'余额不能为空'"`
Id int `json:"id" form:"id" vd:"@:len($)>0; msg:'用户ID不能为空'"`
Balance float64 `json:"balance" form:"balance" vd:"@:len($)>0; msg:'余额不能为空'"`
ChangeType int `json:"change_type" form:"change_type" vd:"@:len($)>0; msg:'变动类型不能为空'"` // 1 增加 2 减少
}
type PwdLoginReq struct {