feat: update api key last_use_time after dalle3 call

This commit is contained in:
RockYang
2024-01-04 18:15:00 +08:00
parent ea3301c75c
commit 1ddd05302b
6 changed files with 39 additions and 61 deletions

View File

@@ -262,6 +262,8 @@ func (h *FunctionHandler) Dall3(c *gin.Context) {
resp.ERROR(c, "请求 OpenAI API 失败: "+errRes.Error.Message)
return
}
// 更新 API KEY 的最后使用时间
h.db.Model(&apiKey).UpdateColumn("last_used_at", time.Now().Unix())
// 存储图片
imgURL, err := h.uploadManager.GetUploadHandler().PutImg(res.Data[0].Url, false)
if err != nil {