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

@@ -244,6 +244,8 @@ func relayHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
if err != nil {
common.SysError("Error consuming token remain quota: " + err.Error())
}
userId := c.GetInt("id")
model.RecordLog(userId, model.LogTypeConsume, fmt.Sprintf("使用模型 %s 消耗 %d 点额度", textRequest.Model, quota))
}
}()