增加自动迁移数据表代码

This commit is contained in:
RockYang
2025-04-29 22:55:30 +08:00
parent d1c9fd6eba
commit 8a2d2f66b5
89 changed files with 484 additions and 406 deletions

View File

@@ -69,7 +69,7 @@ func (h *ChatModelHandler) Save(c *gin.Context) {
item.Description = data.Description
item.Category = data.Category
item.Temperature = data.Temperature
item.KeyId = data.KeyId
item.KeyId = uint(data.KeyId)
item.Type = data.Type
item.Options = utils.JsonEncode(data.Options)
var res *gorm.DB
@@ -117,7 +117,7 @@ func (h *ChatModelHandler) List(c *gin.Context) {
// initialize key name
keyIds := make([]int, 0)
for _, v := range items {
keyIds = append(keyIds, v.KeyId)
keyIds = append(keyIds, int(v.KeyId))
}
var keys []model.ApiKey
keyMap := make(map[uint]string)