新增关闭模型配置相关逻辑判断

This commit is contained in:
DaGou12138
2026-02-04 11:32:10 +08:00
parent 39124d4930
commit 8718a07c7e
@@ -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);