mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 12:13:46 +08:00
支持微模型绑定 Dalle 绘图的 API KEY
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"geekai/store/vo"
|
||||
"geekai/utils"
|
||||
"geekai/utils/resp"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
@@ -71,16 +72,18 @@ func (h *ApiKeyHandler) Save(c *gin.Context) {
|
||||
resp.SUCCESS(c, keyVo)
|
||||
}
|
||||
|
||||
// List 获取 API KEY 列表
|
||||
func (h *ApiKeyHandler) List(c *gin.Context) {
|
||||
status := h.GetBool(c, "status")
|
||||
t := h.GetTrim(c, "type")
|
||||
t := c.Query("type")
|
||||
|
||||
session := h.DB.Session(&gorm.Session{})
|
||||
if status {
|
||||
session = session.Where("enabled", true)
|
||||
}
|
||||
if t != "" {
|
||||
session = session.Where("type", t)
|
||||
types := strings.Split(t, "|")
|
||||
session = session.Where("type IN ?", types)
|
||||
}
|
||||
|
||||
var items []model.ApiKey
|
||||
|
||||
Reference in New Issue
Block a user