mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 09:33:55 +08:00
新增关闭模型配置相关逻辑判断
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user