perf: 模型管理界面重做

This commit is contained in:
2026-03-11 20:33:04 +08:00
parent 219fa566ef
commit 373d7f8201
37 changed files with 4120 additions and 2108 deletions

View File

@@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.handler.FastjsonTypeHandler;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Map;
@@ -103,12 +104,6 @@ public class ModelBase implements Serializable {
@Column(comment = "模型类型: chatModel/embeddingModel/rerankModel/orc..")
private String modelType;
/**
* 是否使用
*/
@Column(comment = "是否使用")
private Boolean withUsed;
/**
* 是否支持推理
*/
@@ -277,14 +272,6 @@ public class ModelBase implements Serializable {
this.modelType = modelType;
}
public Boolean getWithUsed() {
return withUsed;
}
public void setWithUsed(Boolean withUsed) {
this.withUsed = withUsed;
}
public Boolean getSupportThinking() {
return supportThinking;
}

View File

@@ -1,8 +1,7 @@
package tech.easyflow.ai.service;
import tech.easyflow.ai.entity.Model;
import com.mybatisflex.core.service.IService;
import tech.easyflow.common.domain.Result;
import tech.easyflow.ai.entity.Model;
import java.math.BigInteger;
import java.util.List;
@@ -25,6 +24,4 @@ public interface ModelService extends IService<Model> {
void removeByEntity(Model entity);
Model getModelInstance(BigInteger modelId);
void updateByEntity(Model entity);
}

View File

@@ -2,13 +2,13 @@
package tech.easyflow.ai.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alicp.jetcache.Cache;
import com.easyagents.core.document.Document;
import com.easyagents.core.model.chat.ChatModel;
import com.easyagents.core.model.chat.ChatOptions;
import com.easyagents.core.model.embedding.EmbeddingModel;
import com.easyagents.core.model.rerank.RerankModel;
import com.easyagents.core.store.VectorData;
import com.alicp.jetcache.Cache;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.slf4j.Logger;
@@ -21,7 +21,6 @@ import tech.easyflow.ai.entity.ModelProvider;
import tech.easyflow.ai.mapper.ModelMapper;
import tech.easyflow.ai.service.ModelProviderService;
import tech.easyflow.ai.service.ModelService;
import tech.easyflow.common.domain.Result;
import tech.easyflow.common.web.exceptions.BusinessException;
import javax.annotation.Resource;
@@ -92,7 +91,6 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper, Model> implements
QueryWrapper queryWrapper = new QueryWrapper()
.eq(Model::getProviderId, entity.getProviderId());
queryWrapper.eq(Model::getWithUsed, entity.getWithUsed());
List<Model> totalList = modelMapper.selectListWithRelationsByQuery(queryWrapper);
for (String modelType : Model.MODEL_TYPES) {
Map<String, List<Model>> groupMap = groupLlmByGroupName(totalList, modelType);
@@ -212,13 +210,4 @@ public class ModelServiceImpl extends ServiceImpl<ModelMapper, Model> implements
return model;
}
@Override
public void updateByEntity(Model entity) {
QueryWrapper queryWrapper = QueryWrapper.create().eq(Model::getProviderId, entity.getProviderId())
.eq(Model::getGroupName, entity.getGroupName());
Model model = new Model();
model.setWithUsed(entity.getWithUsed());
modelMapper.updateByQuery(model, queryWrapper);
}
}