mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-12 17:13:43 +08:00
适配dall-e-3
This commit is contained in:
@@ -17,6 +17,7 @@ type Redemption struct {
|
||||
CreatedTime int64 `json:"created_time" gorm:"bigint"`
|
||||
RedeemedTime int64 `json:"redeemed_time" gorm:"bigint"`
|
||||
Count int `json:"count" gorm:"-:all"` // only for api request
|
||||
UsedUserId int `json:"used_user_id"`
|
||||
}
|
||||
|
||||
func GetAllRedemptions(startIdx int, num int) ([]*Redemption, error) {
|
||||
@@ -69,6 +70,7 @@ func Redeem(key string, userId int) (quota int, err error) {
|
||||
}
|
||||
redemption.RedeemedTime = common.GetTimestamp()
|
||||
redemption.Status = common.RedemptionCodeStatusUsed
|
||||
redemption.UsedUserId = userId
|
||||
err = tx.Save(redemption).Error
|
||||
return err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user