feat: now user can check its topup & consume history (close #78, close #95)

This commit is contained in:
JustSong
2023-06-10 16:04:04 +08:00
parent 145bb14cb2
commit 74f508e847
8 changed files with 240 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package model
import (
"errors"
"fmt"
"one-api/common"
)
@@ -65,6 +66,7 @@ func Redeem(key string, userId int) (quota int, err error) {
if err != nil {
common.SysError("更新兑换码状态失败:" + err.Error())
}
RecordLog(userId, LogTypeTopup, fmt.Sprintf("通过兑换码充值 %d 点额度", redemption.Quota))
}()
return redemption.Quota, nil
}