feat: implements image function replace Mj with DALL-E-3

This commit is contained in:
RockYang
2023-11-26 20:37:48 +08:00
parent 599ce0eade
commit f4fbe67db9
17 changed files with 227 additions and 181 deletions

View File

@@ -27,6 +27,7 @@ func (h *ApiKeyHandler) Save(c *gin.Context) {
var data struct {
Id uint `json:"id"`
Platform string `json:"platform"`
Type string `json:"type"`
Value string `json:"value"`
}
if err := c.ShouldBindJSON(&data); err != nil {
@@ -40,7 +41,8 @@ func (h *ApiKeyHandler) Save(c *gin.Context) {
}
apiKey.Platform = data.Platform
apiKey.Value = data.Value
res := h.db.Debug().Save(&apiKey)
apiKey.Type = data.Type
res := h.db.Save(&apiKey)
if res.Error != nil {
resp.ERROR(c, "更新数据库失败!")
return