mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 18:53:43 +08:00
add redeem code function
This commit is contained in:
16
api/store/model/redeem.go
Normal file
16
api/store/model/redeem.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 兑换码
|
||||
|
||||
type Redeem struct {
|
||||
Id uint `gorm:"primarykey;column:id"`
|
||||
UserId uint // 用户 ID
|
||||
Name string // 名称
|
||||
Power int // 算力
|
||||
Code string // 兑换码
|
||||
Enabled bool // 启用状态
|
||||
RedeemedAt int64 // 兑换时间
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package model
|
||||
|
||||
// 用户打赏
|
||||
|
||||
type Reward struct {
|
||||
BaseModel
|
||||
UserId uint // 用户 ID
|
||||
TxId string // 交易ID
|
||||
Amount float64 // 打赏金额
|
||||
Remark string // 打赏备注
|
||||
Status bool // 核销状态
|
||||
Exchange string // 众筹兑换详情,JSON
|
||||
}
|
||||
13
api/store/vo/redeem.go
Normal file
13
api/store/vo/redeem.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package vo
|
||||
|
||||
type Redeem struct {
|
||||
Id uint `json:"id"`
|
||||
UserId uint `json:"user_id"` // 用户 ID
|
||||
Name string `json:"name"`
|
||||
Username string `json:"username"`
|
||||
Power int `json:"power"` // 算力
|
||||
Code string `json:"code"` // 兑换码
|
||||
Enabled bool `json:"enabled"`
|
||||
RedeemedAt int64 `json:"redeemed_at"` // 兑换时间
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package vo
|
||||
|
||||
type Reward struct {
|
||||
BaseVo
|
||||
UserId uint `json:"user_id"` // 用户 ID
|
||||
Username string `json:"username"`
|
||||
TxId string `json:"tx_id"` // 交易ID
|
||||
Amount float64 `json:"amount"` // 打赏金额
|
||||
Remark string `json:"remark"` // 打赏备注
|
||||
Status bool `json:"status"` // 核销状态
|
||||
Exchange RewardExchange `json:"exchange"`
|
||||
}
|
||||
|
||||
type RewardExchange struct {
|
||||
Power int `json:"power"`
|
||||
}
|
||||
Reference in New Issue
Block a user