Commit 0cefa4b3 by HlQ

[chg] 权限修改

1 parent c1e946f1
...@@ -45,20 +45,20 @@ public class DictionaryController { ...@@ -45,20 +45,20 @@ public class DictionaryController {
} }
@GetMapping("/dictionaryTypes") @GetMapping("/dictionaryTypes")
@SaCheckPermission("dict:type:list") @SaCheckPermission(value = "dict:type:list", orRole = "admin")
public Page<DictionaryType> getDictionaryTypeList(DictionaryTypeDTO data) { public Page<DictionaryType> getDictionaryTypeList(DictionaryTypeDTO data) {
return dictionaryTypeService.lambdaQuery(converter.convert(data, new DictionaryType())) return dictionaryTypeService.lambdaQuery(converter.convert(data, new DictionaryType()))
.page(Page.of(data.getPageNum(), data.getPageSize())); .page(Page.of(data.getPageNum(), data.getPageSize()));
} }
@GetMapping("/dictionaryType") @GetMapping("/dictionaryType")
@SaCheckPermission("dict:type:query") @SaCheckPermission(value = "dict:type:query", orRole = "admin")
public Object getDictionaryTypeByID(@RequestParam Integer id) { public Object getDictionaryTypeByID(@RequestParam Integer id) {
return dictionaryTypeService.getById(id); return dictionaryTypeService.getById(id);
} }
@PostMapping("/dictionaryType") @PostMapping("/dictionaryType")
@SaCheckPermission("dict:type:editAndSave") @SaCheckPermission(value = "dict:type:editAndSave", orRole = "admin")
public String saveOrUpdateDictionaryType(@RequestBody DictionaryTypeDTO data) { public String saveOrUpdateDictionaryType(@RequestBody DictionaryTypeDTO data) {
DictionaryType dictionaryType = converter.convert(data, new DictionaryType()); DictionaryType dictionaryType = converter.convert(data, new DictionaryType());
return dictionaryTypeService.saveOrUpdate(dictionaryType) ? "成功" : "失败"; return dictionaryTypeService.saveOrUpdate(dictionaryType) ? "成功" : "失败";
......
...@@ -26,7 +26,7 @@ public class RRoleResourceController { ...@@ -26,7 +26,7 @@ public class RRoleResourceController {
private final Converter converter; private final Converter converter;
@PostMapping("/rRoleRes") @PostMapping("/rRoleRes")
@SaCheckPermission("role:resource:edit") @SaCheckPermission(value = "role:resource:edit", orRole = "admin")
public String saveOrUpdateRUserRole(@RequestBody List<RRoleResourceDTO> dto) { public String saveOrUpdateRUserRole(@RequestBody List<RRoleResourceDTO> dto) {
List<Long> roleIdList = dto.stream().map(RRoleResourceDTO::getRoleId).collect(Collectors.toList()); List<Long> roleIdList = dto.stream().map(RRoleResourceDTO::getRoleId).collect(Collectors.toList());
roleResourceService.lambdaUpdate().in(RRoleResource::getRoleId, roleIdList).remove(); roleResourceService.lambdaUpdate().in(RRoleResource::getRoleId, roleIdList).remove();
......
...@@ -23,7 +23,7 @@ public class RUserRoleController { ...@@ -23,7 +23,7 @@ public class RUserRoleController {
private final Converter converter; private final Converter converter;
@PostMapping("/rUserRole") @PostMapping("/rUserRole")
@SaCheckPermission("user:role:edit") @SaCheckPermission(value = "user:role:edit", orRole = "admin")
public String saveOrUpdateRUserRole(@RequestBody List<RUserRoleDTO> dto) { public String saveOrUpdateRUserRole(@RequestBody List<RUserRoleDTO> dto) {
List<Long> userIdList = dto.stream().map(RUserRoleDTO::getUserId).collect(Collectors.toList()); List<Long> userIdList = dto.stream().map(RUserRoleDTO::getUserId).collect(Collectors.toList());
rUserRoleService.lambdaUpdate().in(RUserRole::getUserId, userIdList).remove(); rUserRoleService.lambdaUpdate().in(RUserRole::getUserId, userIdList).remove();
......
...@@ -42,7 +42,7 @@ public class TaskController { ...@@ -42,7 +42,7 @@ public class TaskController {
} }
@GetMapping("/faultLogs") @GetMapping("/faultLogs")
@SaCheckPermission("task:log:list") @SaCheckPermission(value = "task:log:list", orRole = "admin")
public List<FaultLog> getFaultLogById(Integer storeId, Integer taskId) { public List<FaultLog> getFaultLogById(Integer storeId, Integer taskId) {
return faultLogService.lambdaQuery() return faultLogService.lambdaQuery()
.eq(FaultLog::getStoreId, storeId) .eq(FaultLog::getStoreId, storeId)
......
...@@ -64,7 +64,7 @@ public class UserController { ...@@ -64,7 +64,7 @@ public class UserController {
return Opt.ofEmptyAble(data).map(userService::updateBatchById).orElse(false) ? "更新成功" : "更新失败"; return Opt.ofEmptyAble(data).map(userService::updateBatchById).orElse(false) ? "更新成功" : "更新失败";
} }
@GetMapping("/user/{token}") @GetMapping("/user/{token}")
@SaCheckPermission("user:token:query") @SaCheckPermission(value = "user:token:query", orRole = "admin")
public UserVO getUserByToken(@PathVariable String token) { public UserVO getUserByToken(@PathVariable String token) {
return Global.USERNAME_MAP.get(token); return Global.USERNAME_MAP.get(token);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!