mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-08 12:57:13 +08:00
refactor: 统一命名风格 (名词 + 动词 + 类型)
This commit is contained in:
@@ -25,7 +25,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import top.continew.admin.system.model.query.OptionQuery;
|
||||
import top.continew.admin.system.model.req.OptionReq;
|
||||
import top.continew.admin.system.model.req.OptionResetValueReq;
|
||||
import top.continew.admin.system.model.req.OptionValueResetReq;
|
||||
import top.continew.admin.system.model.resp.OptionResp;
|
||||
import top.continew.admin.system.service.OptionService;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class OptionController {
|
||||
@SaCheckPermission(value = {"system:siteConfig:update", "system:securityConfig:update", "system:loginConfig:update",
|
||||
"system:mailConfig:update"}, mode = SaMode.OR)
|
||||
@PatchMapping("/value")
|
||||
public void resetValue(@RequestBody @Valid OptionResetValueReq req) {
|
||||
public void resetValue(@RequestBody @Valid OptionValueResetReq req) {
|
||||
baseService.resetValue(req);
|
||||
}
|
||||
}
|
@@ -32,7 +32,7 @@ import top.continew.admin.common.base.controller.BaseController;
|
||||
import top.continew.admin.system.model.query.RoleQuery;
|
||||
import top.continew.admin.system.model.query.RoleUserQuery;
|
||||
import top.continew.admin.system.model.req.RoleReq;
|
||||
import top.continew.admin.system.model.req.RoleUpdatePermissionReq;
|
||||
import top.continew.admin.system.model.req.RolePermissionUpdateReq;
|
||||
import top.continew.admin.system.model.resp.role.RoleDetailResp;
|
||||
import top.continew.admin.system.model.resp.role.RolePermissionResp;
|
||||
import top.continew.admin.system.model.resp.role.RoleResp;
|
||||
@@ -75,7 +75,7 @@ public class RoleController extends BaseController<RoleService, RoleResp, RoleDe
|
||||
@Operation(summary = "修改权限", description = "修改角色的功能权限")
|
||||
@SaCheckPermission("system:role:updatePermission")
|
||||
@PutMapping("/{id}/permission")
|
||||
public void updatePermission(@PathVariable("id") Long id, @RequestBody @Valid RoleUpdatePermissionReq req) {
|
||||
public void updatePermission(@PathVariable("id") Long id, @RequestBody @Valid RolePermissionUpdateReq req) {
|
||||
baseService.updatePermission(id, req);
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "参数重置请求参数")
|
||||
public class OptionResetValueReq implements Serializable {
|
||||
public class OptionValueResetReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "角色功能权限修改请求参数")
|
||||
public class RoleUpdatePermissionReq implements Serializable {
|
||||
public class RolePermissionUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
@@ -19,7 +19,7 @@ package top.continew.admin.system.service;
|
||||
import top.continew.admin.system.enums.OptionCategoryEnum;
|
||||
import top.continew.admin.system.model.query.OptionQuery;
|
||||
import top.continew.admin.system.model.req.OptionReq;
|
||||
import top.continew.admin.system.model.req.OptionResetValueReq;
|
||||
import top.continew.admin.system.model.req.OptionValueResetReq;
|
||||
import top.continew.admin.system.model.resp.OptionResp;
|
||||
|
||||
import java.util.List;
|
||||
@@ -62,7 +62,7 @@ public interface OptionService {
|
||||
*
|
||||
* @param req 重置信息
|
||||
*/
|
||||
void resetValue(OptionResetValueReq req);
|
||||
void resetValue(OptionValueResetReq req);
|
||||
|
||||
/**
|
||||
* 根据编码查询参数值
|
||||
|
@@ -21,7 +21,7 @@ import top.continew.admin.common.context.RoleContext;
|
||||
import top.continew.admin.system.model.entity.RoleDO;
|
||||
import top.continew.admin.system.model.query.RoleQuery;
|
||||
import top.continew.admin.system.model.req.RoleReq;
|
||||
import top.continew.admin.system.model.req.RoleUpdatePermissionReq;
|
||||
import top.continew.admin.system.model.req.RolePermissionUpdateReq;
|
||||
import top.continew.admin.system.model.resp.role.RoleDetailResp;
|
||||
import top.continew.admin.system.model.resp.role.RoleResp;
|
||||
import top.continew.starter.data.service.IService;
|
||||
@@ -43,7 +43,7 @@ public interface RoleService extends BaseService<RoleResp, RoleDetailResp, RoleQ
|
||||
* @param id 角色 ID
|
||||
* @param req 请求参数
|
||||
*/
|
||||
void updatePermission(Long id, RoleUpdatePermissionReq req);
|
||||
void updatePermission(Long id, RolePermissionUpdateReq req);
|
||||
|
||||
/**
|
||||
* 分配角色给用户
|
||||
|
@@ -32,7 +32,7 @@ import top.continew.admin.system.mapper.OptionMapper;
|
||||
import top.continew.admin.system.model.entity.OptionDO;
|
||||
import top.continew.admin.system.model.query.OptionQuery;
|
||||
import top.continew.admin.system.model.req.OptionReq;
|
||||
import top.continew.admin.system.model.req.OptionResetValueReq;
|
||||
import top.continew.admin.system.model.req.OptionValueResetReq;
|
||||
import top.continew.admin.system.model.resp.OptionResp;
|
||||
import top.continew.admin.system.service.OptionService;
|
||||
import top.continew.starter.cache.redisson.util.RedisUtils;
|
||||
@@ -104,7 +104,7 @@ public class OptionServiceImpl implements OptionService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetValue(OptionResetValueReq req) {
|
||||
public void resetValue(OptionValueResetReq req) {
|
||||
RedisUtils.deleteByPattern(CacheConstants.OPTION_KEY_PREFIX + StringConstants.ASTERISK);
|
||||
String category = req.getCategory();
|
||||
List<String> codeList = req.getCode();
|
||||
|
@@ -36,7 +36,7 @@ import top.continew.admin.system.mapper.RoleMapper;
|
||||
import top.continew.admin.system.model.entity.RoleDO;
|
||||
import top.continew.admin.system.model.query.RoleQuery;
|
||||
import top.continew.admin.system.model.req.RoleReq;
|
||||
import top.continew.admin.system.model.req.RoleUpdatePermissionReq;
|
||||
import top.continew.admin.system.model.req.RolePermissionUpdateReq;
|
||||
import top.continew.admin.system.model.resp.MenuResp;
|
||||
import top.continew.admin.system.model.resp.role.RoleDetailResp;
|
||||
import top.continew.admin.system.model.resp.role.RoleResp;
|
||||
@@ -142,7 +142,7 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, RoleDO, RoleRes
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheInvalidate(key = "#id", name = CacheConstants.ROLE_MENU_KEY_PREFIX)
|
||||
public void updatePermission(Long id, RoleUpdatePermissionReq req) {
|
||||
public void updatePermission(Long id, RolePermissionUpdateReq req) {
|
||||
RoleDO role = super.getById(id);
|
||||
CheckUtils.throwIf(Boolean.TRUE.equals(role.getIsSystem()), "[{}] 是系统内置角色,不允许修改角色功能权限", role.getName());
|
||||
// 保存角色和菜单关联
|
||||
|
Reference in New Issue
Block a user