重命名数据表

This commit is contained in:
RockYang
2025-09-01 07:35:37 +08:00
parent 9a4239290b
commit 3531c7f356
31 changed files with 133 additions and 60 deletions

View File

@@ -6,13 +6,13 @@ import (
// ApiKey OpenAI API 模型
type ApiKey struct {
Id uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Id uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Name string `gorm:"column:name;type:varchar(30);comment:名称" json:"name"`
Value string `gorm:"column:value;type:varchar(255);not null;comment:API KEY value" json:"value"`
Type string `gorm:"column:type;type:varchar(10);default:chat;not null;comment:用途chat=>聊天img=>图片)" json:"type"`
LastUsedAt int64 `gorm:"column:last_used_at;type:int;not null;comment:最后使用时间" json:"last_used_at"`
LastUsedAt int64 `gorm:"column:last_used_at;type:int;not null;comment:最后使用时间" json:"last_used_at"`
ApiURL string `gorm:"column:api_url;type:varchar(255);comment:API 地址" json:"api_url"`
Enabled bool `gorm:"column:enabled;type:tinyint(1);comment:是否启用" json:"enabled"`
Enabled bool `gorm:"column:enabled;type:tinyint(1);comment:是否启用" json:"enabled"`
ProxyURL string `gorm:"column:proxy_url;type:varchar(100);comment:代理地址" json:"proxy_url"`
CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null" json:"updated_at"`
@@ -20,5 +20,5 @@ type ApiKey struct {
// TableName 表名
func (m *ApiKey) TableName() string {
return "chatgpt_api_keys"
return "geekai_api_keys"
}