mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-05 23:58:33 +00:00
refactor: Optimize code structure and constant usage
This commit is contained in:
parent
d73a76d9c1
commit
069ada0795
22 changed files with 89 additions and 14 deletions
|
|
@ -15,6 +15,8 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.bgasol.common.constant.value.SystemConfigValues.ADMIN_USER_ID;
|
||||
|
||||
/**
|
||||
* 自定义权限验证接口扩展
|
||||
*/
|
||||
|
|
@ -39,7 +41,7 @@ public class StpInterfaceImpl implements StpInterface {
|
|||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
UserEntity user = this.getUser((String) loginId, loginType);
|
||||
Set<String> permissions = new HashSet<>();
|
||||
if (user.getId().equals("admin")) {
|
||||
if (user.getId().equals(ADMIN_USER_ID)) {
|
||||
permissions.add("*");
|
||||
} else {
|
||||
for (RoleEntity role : user.getRoles()) {
|
||||
|
|
@ -60,7 +62,7 @@ public class StpInterfaceImpl implements StpInterface {
|
|||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
UserEntity user = this.getUser((String) loginId, loginType);
|
||||
Set<String> roles = new HashSet<>();
|
||||
if (user.getId().equals("admin")) {
|
||||
if (user.getId().equals(ADMIN_USER_ID)) {
|
||||
roles.add("*");
|
||||
} else {
|
||||
for (RoleEntity role : user.getRoles()) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bgasol.common.core.base.dto;
|
||||
|
||||
import com.bgasol.common.core.base.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -25,6 +26,7 @@ public abstract class BaseCreateDto<ENTITY extends BaseEntity> {
|
|||
*
|
||||
* @return ENTITY
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public abstract ENTITY toEntity();
|
||||
|
||||
|
|
@ -34,6 +36,7 @@ public abstract class BaseCreateDto<ENTITY extends BaseEntity> {
|
|||
* @param entity 实体
|
||||
* @return ENTITY
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public ENTITY toEntity(ENTITY entity) {
|
||||
entity.setSort(this.getSort());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bgasol.common.core.base.dto;
|
||||
|
||||
import com.bgasol.common.core.base.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Getter;
|
||||
|
|
@ -30,9 +31,11 @@ public abstract class BaseUpdateDto<ENTITY extends BaseEntity> {
|
|||
*
|
||||
* @return ENTITY
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public abstract ENTITY toEntity();
|
||||
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public ENTITY toEntity(ENTITY entity) {
|
||||
entity.setSort(this.getSort());
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bgasol.model.file.file.dto;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.file.file.entity.FileEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -34,6 +35,8 @@ public class FileCreateDto extends BaseCreateDto<FileEntity> {
|
|||
private String source;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public FileEntity toEntity() {
|
||||
return super.toEntity(FILE_MAPSTRUCT_IMPL.toEntity(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bgasol.model.file.file.dto;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.file.file.entity.FileEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -34,6 +35,8 @@ public class FileUpdateDto extends BaseUpdateDto<FileEntity> {
|
|||
private String source;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public FileEntity toEntity() {
|
||||
return super.toEntity(FILE_MAPSTRUCT_IMPL.toEntity(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.file.image.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.file.image.entity.ImageEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.*;
|
||||
|
|
@ -21,6 +22,8 @@ public class ImageCreateDto extends BaseCreateDto<ImageEntity> {
|
|||
private String fileId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public ImageEntity toEntity() {
|
||||
ImageEntity imageEntity = new ImageEntity();
|
||||
imageEntity.setName(name);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.file.image.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.file.image.entity.ImageEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.*;
|
||||
|
|
@ -21,6 +22,8 @@ public class ImageUpdateDto extends BaseUpdateDto<ImageEntity> {
|
|||
private String fileId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public ImageEntity toEntity() {
|
||||
ImageEntity imageEntity = new ImageEntity();
|
||||
imageEntity.setName(name);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.file.video.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.file.video.entity.VideoEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -42,8 +43,10 @@ public class VideoCreateDto extends BaseCreateDto<VideoEntity> {
|
|||
private String fileId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public VideoEntity toEntity() {
|
||||
return this.toEntity(VideoEntity.builder()
|
||||
VideoEntity videoEntity = VideoEntity.builder()
|
||||
.name(name)
|
||||
.width(width)
|
||||
.height(height)
|
||||
|
|
@ -52,7 +55,7 @@ public class VideoCreateDto extends BaseCreateDto<VideoEntity> {
|
|||
.bitrate(bitrate)
|
||||
.fps(fps)
|
||||
.codec(codec)
|
||||
.fileId(fileId)
|
||||
.build());
|
||||
.fileId(fileId).build();
|
||||
return this.toEntity(videoEntity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.file.video.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.file.video.entity.VideoEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -42,8 +43,10 @@ public class VideoUpdateDto extends BaseUpdateDto<VideoEntity> {
|
|||
private String fileId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public VideoEntity toEntity() {
|
||||
return this.toEntity(VideoEntity.builder()
|
||||
VideoEntity videoEntity = VideoEntity.builder()
|
||||
.name(name)
|
||||
.width(width)
|
||||
.height(height)
|
||||
|
|
@ -52,7 +55,7 @@ public class VideoUpdateDto extends BaseUpdateDto<VideoEntity> {
|
|||
.bitrate(bitrate)
|
||||
.fps(fps)
|
||||
.codec(codec)
|
||||
.fileId(fileId)
|
||||
.build());
|
||||
.fileId(fileId).build();
|
||||
return this.toEntity(videoEntity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.system.department.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.system.department.entity.DepartmentEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
|
@ -40,6 +41,8 @@ public class DepartmentCreateDto extends BaseCreateDto<DepartmentEntity> {
|
|||
private String parentId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public DepartmentEntity toEntity() {
|
||||
return super.toEntity(DEPARTMENT_MAPSTRUCT_IMPL.toEntity(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bgasol.model.system.department.dto;
|
|||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.system.department.entity.DepartmentEntity;
|
||||
import com.bgasol.model.system.department.mapstruct.DepartmentMapstruct;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
|
@ -39,6 +40,8 @@ public class DepartmentUpdateDto extends BaseUpdateDto<DepartmentEntity> {
|
|||
private String parentId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public DepartmentEntity toEntity() {
|
||||
DepartmentMapstruct mapper = Mappers.getMapper(DepartmentMapstruct.class);
|
||||
return super.toEntity(mapper.toEntity(this));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bgasol.model.system.menu.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.system.menu.entity.MenuEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
|
@ -14,6 +16,8 @@ import lombok.experimental.SuperBuilder;
|
|||
@NoArgsConstructor
|
||||
public class MenuCreateDto extends BaseCreateDto<MenuEntity> {
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public MenuEntity toEntity() {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bgasol.model.system.menu.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.system.menu.entity.MenuEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
|
@ -14,6 +16,8 @@ import lombok.experimental.SuperBuilder;
|
|||
@NoArgsConstructor
|
||||
public class MenuUpdateDto extends BaseUpdateDto<MenuEntity> {
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public MenuEntity toEntity() {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bgasol.model.system.permission.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.system.permission.entity.PermissionEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
|
@ -14,6 +16,8 @@ import lombok.experimental.SuperBuilder;
|
|||
@NoArgsConstructor
|
||||
public class PermissionCreateDto extends BaseCreateDto<PermissionEntity> {
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public PermissionEntity toEntity() {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bgasol.model.system.permission.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.system.permission.entity.PermissionEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
|
@ -14,6 +16,8 @@ import lombok.experimental.SuperBuilder;
|
|||
@NoArgsConstructor
|
||||
public class PermissionUpdateDto extends BaseUpdateDto<PermissionEntity> {
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public PermissionEntity toEntity() {
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bgasol.common.core.base.dto.BaseCreateDto;
|
|||
import com.bgasol.model.system.menu.entity.MenuEntity;
|
||||
import com.bgasol.model.system.permission.entity.PermissionEntity;
|
||||
import com.bgasol.model.system.role.entity.RoleEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.*;
|
||||
|
|
@ -37,6 +38,8 @@ public class RoleCreateDto extends BaseCreateDto<RoleEntity> {
|
|||
private List<String> menuIds;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public RoleEntity toEntity() {
|
||||
RoleEntity roleEntity = ROLE_MAPSTRUCT_IMPL.toEntity(this);
|
||||
if (permissionIds != null) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
|||
import com.bgasol.model.system.menu.entity.MenuEntity;
|
||||
import com.bgasol.model.system.permission.entity.PermissionEntity;
|
||||
import com.bgasol.model.system.role.entity.RoleEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.*;
|
||||
|
|
@ -36,6 +37,8 @@ public class RoleUpdateDto extends BaseUpdateDto<RoleEntity> {
|
|||
private List<String> menuIds;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public RoleEntity toEntity() {
|
||||
RoleEntity roleEntity = ROLE_MAPSTRUCT_IMPL.toEntity(this);
|
||||
if (permissionIds != null) {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ package com.bgasol.model.system.user.dto;
|
|||
import com.bgasol.common.core.base.dto.BaseCreateDto;
|
||||
import com.bgasol.model.system.role.entity.RoleEntity;
|
||||
import com.bgasol.model.system.user.entity.UserEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
|
|
@ -14,6 +17,8 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.bgasol.common.constant.value.SystemConfigValues.DEFAULT_DEPARTMENT_ID;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
|
|
@ -50,6 +55,8 @@ public class UserCreateDto extends BaseCreateDto<UserEntity> {
|
|||
private String departmentId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public UserEntity toEntity() {
|
||||
UserEntity user = new UserEntity();
|
||||
user.setUsername(username);
|
||||
|
|
@ -61,7 +68,7 @@ public class UserCreateDto extends BaseCreateDto<UserEntity> {
|
|||
if (ObjectUtils.isNotEmpty(departmentId)) {
|
||||
user.setDepartmentId(departmentId);
|
||||
} else {
|
||||
user.setDepartmentId("default");
|
||||
user.setDepartmentId(DEFAULT_DEPARTMENT_ID);
|
||||
}
|
||||
if (roleIds != null) {
|
||||
Stream<RoleEntity> roleEntityStream = roleIds.stream().map((id) -> {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bgasol.model.system.user.dto;
|
|||
|
||||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.system.user.entity.UserEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.*;
|
||||
|
|
@ -18,6 +19,8 @@ public class UserPasswordResetDto extends BaseUpdateDto<UserEntity> {
|
|||
private String password;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public UserEntity toEntity() {
|
||||
UserEntity user = new UserEntity();
|
||||
user.setId(this.getId());
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ package com.bgasol.model.system.user.dto;
|
|||
import com.bgasol.common.core.base.dto.BaseUpdateDto;
|
||||
import com.bgasol.model.system.role.entity.RoleEntity;
|
||||
import com.bgasol.model.system.user.entity.UserEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
||||
|
|
@ -14,6 +17,8 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.bgasol.common.constant.value.SystemConfigValues.DEFAULT_DEPARTMENT_ID;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
|
|
@ -44,6 +49,8 @@ public class UserUpdateDto extends BaseUpdateDto<UserEntity> {
|
|||
private String departmentId;
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
public UserEntity toEntity() {
|
||||
UserEntity user = new UserEntity();
|
||||
user.setUsername(username);
|
||||
|
|
@ -55,7 +62,7 @@ public class UserUpdateDto extends BaseUpdateDto<UserEntity> {
|
|||
if (ObjectUtils.isNotEmpty(departmentId)) {
|
||||
user.setDepartmentId(departmentId);
|
||||
} else {
|
||||
user.setDepartmentId("default");
|
||||
user.setDepartmentId(DEFAULT_DEPARTMENT_ID);
|
||||
}
|
||||
if (roleIds != null) {
|
||||
Stream<RoleEntity> roleEntityStream = roleIds.stream().map((id) -> {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static com.bgasol.common.constant.value.SystemConfigValues.DEFAULT_DEPARTMENT_ID;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "部门管理")
|
||||
|
|
@ -78,7 +80,7 @@ public class DepartmentController extends BaseController<
|
|||
@GetMapping("/find-by-id-is-default")
|
||||
@Operation(summary = "查询默认部门", operationId = "findDefaultDepartment")
|
||||
public BaseVo<DepartmentEntity> findById() {
|
||||
return super.findById("default");
|
||||
return super.findById(DEFAULT_DEPARTMENT_ID);
|
||||
}
|
||||
|
||||
@GetMapping("/get-my-department")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import org.springframework.context.annotation.Lazy;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static com.bgasol.common.constant.value.SystemConfigValues.DEFAULT_DEPARTMENT_ID;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
||||
@Transactional
|
||||
|
|
@ -59,6 +61,6 @@ public class DepartmentService extends BaseService<DepartmentEntity, BasePageDto
|
|||
return departmentEntity;
|
||||
}
|
||||
}
|
||||
return this.findById("default");
|
||||
return this.findById(DEFAULT_DEPARTMENT_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue