|
|
|
@ -6,6 +6,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceStatus;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TbPermission;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TbRole;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.model.DyLineTreeListModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.PermissionModel;
|
|
|
|
@ -48,7 +49,7 @@ public class RoleController extends BaseController {
|
|
|
|
|
@ApiOperation("更新")
|
|
|
|
|
public ResponseReult<String> update(@Validated @RequestBody TbRole item) throws Exception {
|
|
|
|
|
if (item.getId() == null) {
|
|
|
|
|
throw new Exception("ID不能为空!");
|
|
|
|
|
throw new ApiException("id不能为空!");
|
|
|
|
|
}
|
|
|
|
|
service.update(item);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
@ -56,14 +57,17 @@ public class RoleController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@PostMapping("delete")
|
|
|
|
|
@ApiOperation("删除")
|
|
|
|
|
public ResponseReult<String> delete(@Validated @NotNull(message = "ID不能为空!") Integer id) throws Exception {
|
|
|
|
|
public ResponseReult<String> delete(@Validated @NotNull(message = "id不能为空!") Integer id) throws Exception {
|
|
|
|
|
if (id == null) {
|
|
|
|
|
throw new ApiException("id不能为空!");
|
|
|
|
|
}
|
|
|
|
|
service.delete(id);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("getPermission")
|
|
|
|
|
@ApiOperation("查询权限")
|
|
|
|
|
public ResponseReult<List<TbPermission>> getPermission(@Validated @NotNull(message = "ID不能为空!") Integer id) throws Exception {
|
|
|
|
|
public ResponseReult<List<TbPermission>> getPermission(@Validated @NotNull(message = "id不能为空!") Integer id) throws Exception {
|
|
|
|
|
List<TbPermission> result = service.getPermission(id);
|
|
|
|
|
return ResponseReult.success(result);
|
|
|
|
|
}
|
|
|
|
|