fix: ai deploy bug

This commit is contained in:
Liujian
2025-02-17 00:37:25 +08:00
parent 35b25289bd
commit 94d5ed0773
14 changed files with 227 additions and 44 deletions
+15
View File
@@ -149,3 +149,18 @@ func (i *LocalModelPackage) TableName() string {
func (i *LocalModelPackage) IdValue() int64 {
return i.Id
}
type LocalModelCache struct {
Id int64 `gorm:"column:id;type:BIGINT(20);AUTO_INCREMENT;NOT NULL;comment:id;primary_key;comment:主键ID;"`
Model string `gorm:"type:varchar(100);not null;column:model;comment:模型ID"`
Target string `gorm:"type:varchar(100);not null;column:target;comment:目标"`
Type int `gorm:"type:tinyint(1);not null;column:type;comment:类型,0: 服务"`
}
func (i *LocalModelCache) TableName() string {
return "ai_local_model_cache"
}
func (i *LocalModelCache) IdValue() int64 {
return i.Id
}
+12
View File
@@ -63,6 +63,14 @@ type imlLocalModelInstallStateStore struct {
store.SearchStore[LocalModelInstallState]
}
type ILocalModelCacheStore interface {
store.IBaseStore[LocalModelCache]
}
type imlLocalModelCacheStore struct {
store.Store[LocalModelCache]
}
func init() {
autowire.Auto[IProviderStore](func() reflect.Value {
return reflect.ValueOf(new(imlProviderStore))
@@ -91,4 +99,8 @@ func init() {
autowire.Auto[ILocalModelInstallStateStore](func() reflect.Value {
return reflect.ValueOf(new(imlLocalModelInstallStateStore))
})
autowire.Auto[ILocalModelCacheStore](func() reflect.Value {
return reflect.ValueOf(new(imlLocalModelCacheStore))
})
}