mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
Merge pull request #2942 from xinnan-tech/perf-manager-api-modelConfig
perf:新增关闭模型配置相关逻辑判断
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user