feat: 新增统一模型网关与模型管理工作区
- 新增 OpenAI 兼容统一模型调用链路、模型发布配置与批量发布能力 - 重构模型管理页面入口与统一网关工作区,更新服务商 logo 资源与模型 ID 文案 - 收口全新库初始化脚本,仅保留服务商种子并整理统一网关 migration
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import tech.easyflow.ai.dto.ModelInvokeConfigDtos;
|
||||
import tech.easyflow.ai.entity.Model;
|
||||
import tech.easyflow.ai.entity.ModelProvider;
|
||||
import tech.easyflow.ai.entity.table.ModelTableDef;
|
||||
@@ -69,6 +70,12 @@ public class ModelController extends BaseCurdController<ModelService, Model> {
|
||||
return Result.ok(modelService.getList(entity));
|
||||
}
|
||||
|
||||
@GetMapping("invokeList")
|
||||
@SaCheckPermission("/api/v1/model/query")
|
||||
public Result<List<Model>> invokeList() {
|
||||
return Result.ok(modelService.listInvokeModels());
|
||||
}
|
||||
|
||||
@PostMapping("/addAiLlm")
|
||||
@SaCheckPermission("/api/v1/model/save")
|
||||
public Result<Boolean> addAiLlm(Model entity) {
|
||||
@@ -92,6 +99,31 @@ public class ModelController extends BaseCurdController<ModelService, Model> {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/updateInvokeConfig")
|
||||
@SaCheckPermission("/api/v1/model/save")
|
||||
public Result<Model> updateInvokeConfig(@RequestBody ModelInvokeConfigDtos.UpdateRequest request) {
|
||||
return Result.ok(modelService.updateInvokeConfig(
|
||||
request.getId(),
|
||||
request.getInvokeCode(),
|
||||
request.getPublishEnabled()
|
||||
));
|
||||
}
|
||||
|
||||
@PostMapping("/batchUpdateInvokePublishStatus")
|
||||
@SaCheckPermission("/api/v1/model/save")
|
||||
public Result<List<Model>> batchUpdateInvokePublishStatus(@RequestBody ModelInvokeConfigDtos.BatchPublishRequest request) {
|
||||
return Result.ok(modelService.batchUpdateInvokePublishStatus(
|
||||
request.getIds(),
|
||||
request.getPublishEnabled()
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Result<?> onSaveOrUpdateBefore(Model entity, boolean isSave) {
|
||||
modelService.validateForSaveOrUpdate(entity, isSave);
|
||||
return super.onSaveOrUpdateBefore(entity, isSave);
|
||||
}
|
||||
|
||||
@GetMapping("/selectLlmByProviderCategory")
|
||||
@SaCheckPermission("/api/v1/model/query")
|
||||
public Result<Map<String, List<Model>>> selectLlmByProviderCategory(Model entity, String sortKey, String sortType) {
|
||||
|
||||
Reference in New Issue
Block a user