refactor(权限点): 参数处理调整

This commit is contained in:
zhansihu 2023-09-13 17:05:32 +08:00
parent 614b3289ea
commit adc9e97a39
5 changed files with 15 additions and 4 deletions

View File

@ -35,4 +35,8 @@ public enum DelegatedType {
public static DelegatedType apply(Integer code) {
return code == null ? null :MAPPING.get(code);
}
public boolean sameCode(Integer code) {
return this.code.equals(code);
}
}

View File

@ -36,4 +36,8 @@ public enum FeatureType {
public static FeatureType apply(Integer code) {
return code == null ? null :MAPPING.get(code);
}
public boolean sameCode(Integer code) {
return this.code.equals(code);
}
}

View File

@ -34,4 +34,8 @@ public enum PageLinkType {
public static PageLinkType apply(Integer code) {
return code == null ? null :MAPPING.get(code);
}
public boolean sameCode(Integer code) {
return this.code.equals(code);
}
}

View File

@ -49,8 +49,7 @@ public class PermissionPointController implements PermissionPointApi {
@Override
public ApiResult<PermissionPointDTO> savePermissionPoint(PermissionPointDTO dto) {
permissionPointService.save(dto);
return ApiResult.ok();
return ApiResult.ok(permissionPointService.save(dto));
}
@Override

View File

@ -254,14 +254,14 @@ public class PermissionPointServiceImpl implements PermissionPointService {
private PermissionPointDTO doUpdate(PermissionPointDTO dto) {
SaasFeature feature = getAndCheck(dto.getId());
SaasFeature saasFeature = BeanMapper.copyBean(dto, SaasFeature.class);
//清理不可更新的数据
saasFeature.setFeatureCode(null);
//清理不可直接更新的数据
saasFeature.setParentId(null);
saasFeature.setPath(null);
saasFeature.setSort(null);
saasFeature.setTerminal(null);
saasFeature.setBusinessNo(null);
this.saasFeatureDao.updateById(saasFeature);
//返回一些要用的数据
dto.setBusinessNo(feature.getBusinessNo());
return dto;
}