|
@@ -1,5 +1,7 @@
|
|
|
package com.gis.web.controller;
|
|
|
|
|
|
+import com.gis.common.exception.BaseRuntimeException;
|
|
|
+import com.gis.common.service.IBaseService;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.PageDto;
|
|
|
import com.gis.domain.entity.WorkEntity;
|
|
@@ -21,6 +23,9 @@ public class AgeController {
|
|
|
@Autowired
|
|
|
WorkService workService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IBaseService iBaseService;
|
|
|
/**
|
|
|
* 获取所有场景
|
|
|
* 使用超级管理员权限的
|
|
@@ -30,12 +35,16 @@ public class AgeController {
|
|
|
@ApiOperation(value = "场景-列表", notes = "超级管理员权限token")
|
|
|
@PostMapping("/list")
|
|
|
public Result<WorkEntity> list(@RequestBody PageDto param) {
|
|
|
- return workService.search(param);
|
|
|
+ Integer isAdmin = iBaseService.getIsAdmin();
|
|
|
+ BaseRuntimeException.isTrue(isAdmin != 1, 3100, "非法用户");
|
|
|
+ return workService.search(param, true);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "场景-删除")
|
|
|
@PostMapping("/remove/{id}")
|
|
|
public Result remove( @PathVariable String id) {
|
|
|
+ Integer isAdmin = iBaseService.getIsAdmin();
|
|
|
+ BaseRuntimeException.isTrue(isAdmin != 1, 3100, "非法用户");
|
|
|
return workService.remove(id);
|
|
|
}
|
|
|
|