finish baidu ai model api implementation

This commit is contained in:
RockYang
2023-10-11 14:21:16 +08:00
parent 4fc01f3f7b
commit ba206bb387
9 changed files with 171 additions and 62 deletions

View File

@@ -36,11 +36,11 @@ func (h *ApiKeyHandler) Save(c *gin.Context) {
apiKey := model.ApiKey{}
if data.Id > 0 {
h.db.Find(&apiKey)
h.db.Find(&apiKey, data.Id)
}
apiKey.Platform = data.Platform
apiKey.Value = data.Value
res := h.db.Save(&apiKey)
res := h.db.Debug().Save(&apiKey)
if res.Error != nil {
resp.ERROR(c, "更新数据库失败!")
return