mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-26 04:39:53 +01:00
新增关闭模型配置相关逻辑判断
This commit is contained in:
parent
39124d4930
commit
8718a07c7e
1 changed files with 4 additions and 0 deletions
|
|
@ -129,6 +129,10 @@ public class ModelController {
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return new Result<Void>().error("模型配置不存在");
|
return new Result<Void>().error("模型配置不存在");
|
||||||
}
|
}
|
||||||
|
// 不能关闭默认模型
|
||||||
|
if (status == 0 && entity.getIsDefault() > 0) {
|
||||||
|
return new Result<Void>().error("默认模型配置不允许关闭");
|
||||||
|
}
|
||||||
// 不更新ConfigJson字段
|
// 不更新ConfigJson字段
|
||||||
entity.setConfigJson(null);
|
entity.setConfigJson(null);
|
||||||
entity.setIsEnabled(status);
|
entity.setIsEnabled(status);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue