将“管理员”销毁仿真的接口从之前的清理仿真接口里独立出来,清理仿真接口仅用于仿真创建者退出时销毁仿真用
This commit is contained in:
parent
3974e96c99
commit
59cb703042
@ -261,6 +261,15 @@ public class SimulationV1Controller {
|
||||
this.groupSimulationService.clearSimulation(group, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁仿真。
|
||||
* 由系统管理员或老师在仿真监管功能中使用
|
||||
*/
|
||||
@DeleteMapping("/{simulationId}/destroy")
|
||||
public void destroySimulation(@PathVariable String simulationId) {
|
||||
this.groupSimulationService.clearSimulation(simulationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载剧本并扮演成员(已发布的剧本)
|
||||
*/
|
||||
|
@ -510,8 +510,7 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
|
||||
log.warn("清除的仿真[{}]不存在", group);
|
||||
return;
|
||||
}
|
||||
if (Objects.equals(simulation.getBuildParams().getUser().getId(), user.getId()) ||
|
||||
user.isAdmin()) { // 是仿真创建者或管理员,可以清理
|
||||
if (Objects.equals(simulation.getBuildParams().getUser().getId(), user.getId())) { // 是仿真创建者,可以清理
|
||||
// this.simulationLifeCycleService.destroy(simulation);
|
||||
// simulationManager.destroy(simulation.getId());
|
||||
clearSimulation(group);
|
||||
|
Loading…
Reference in New Issue
Block a user