Merge pull request #2942 from xinnan-tech/perf-manager-api-modelConfig

perf:新增关闭模型配置相关逻辑判断
This commit is contained in:
wengzh 2026-02-04 11:42:38 +08:00 committed by GitHub
commit fa523dc615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,6 +129,10 @@ public class ModelController {
if (entity == null) {
return new Result<Void>().error("模型配置不存在");
}
// 不能关闭默认模型
if (status == 0 && entity.getIsDefault() > 0) {
return new Result<Void>().error("默认模型配置不允许关闭");
}
// 不更新ConfigJson字段
entity.setConfigJson(null);
entity.setIsEnabled(status);