├── cdp-auth ├── src │ ├── main │ │ ├── resources │ │ │ ├── application.yml │ │ │ ├── application-dev.yml │ │ │ ├── application-prod.yml │ │ │ ├── application-test.yml │ │ │ └── banner.txt │ │ └── java │ │ │ └── com │ │ │ └── chomolungma │ │ │ └── auth │ │ │ ├── login │ │ │ ├── param │ │ │ │ ├── LoginForm.java │ │ │ │ └── ResetPasswordDTO.java │ │ │ ├── application │ │ │ │ └── service │ │ │ │ │ ├── LoginService.java │ │ │ │ │ └── impl │ │ │ │ │ └── SecurityServiceImpl.java │ │ │ └── interfaces │ │ │ │ └── controller │ │ │ │ └── LoginController.java │ │ │ ├── CdpApplication.java │ │ │ ├── config │ │ │ └── CacheConfig.java │ │ │ ├── handler │ │ │ ├── AuthenticationEntryPointImpl.java │ │ │ └── AccessDeniedHandlerImpl.java │ │ │ └── filter │ │ │ └── AuthenticationTokenFilter.java │ └── test │ │ └── java │ │ └── com │ │ └── chomolungma │ │ └── auth │ │ └── AppTest.java └── pom.xml ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── cdp-system ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── chomolungma │ │ │ └── system │ │ │ ├── log │ │ │ ├── application │ │ │ │ └── service │ │ │ │ │ ├── LoginLogService.java │ │ │ │ │ ├── OperateLogService.java │ │ │ │ │ ├── OperateLogServiceImpl.java │ │ │ │ │ └── LoginLogServiceImpl.java │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── LoginLogPageDTO.java │ │ │ │ │ ├── OperateLogPageDTO.java │ │ │ │ │ ├── LoginLogDTO.java │ │ │ │ │ └── OperateLogDTO.java │ │ │ │ ├── assembler │ │ │ │ │ ├── LoginLogAssembler.java │ │ │ │ │ └── OperateLogAssembler.java │ │ │ │ └── controller │ │ │ │ │ ├── LoginLogController.java │ │ │ │ │ └── OperateLogController.java │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ ├── LoginLogEntity.java │ │ │ │ │ └── OperateLogEntity.java │ │ │ │ └── repository │ │ │ │ │ ├── ILoginLogRepository.java │ │ │ │ │ └── IOperateLogRepository.java │ │ │ └── infrastructure │ │ │ │ ├── dataobject │ │ │ │ ├── LoginLogDO.java │ │ │ │ └── OperateLogDO.java │ │ │ │ ├── mybatis │ │ │ │ └── repository │ │ │ │ │ ├── mapper │ │ │ │ │ ├── LoginLogMapper.java │ │ │ │ │ ├── OperateLogMapper.java │ │ │ │ │ ├── OperateLogMapper.xml │ │ │ │ │ └── LoginLogMapper.xml │ │ │ │ │ ├── LoginLogRepositoryImpl.java │ │ │ │ │ └── OperateLogRepositoryImpl.java │ │ │ │ └── converter │ │ │ │ ├── LoginLogConverter.java │ │ │ │ └── OperateLogConverter.java │ │ │ ├── staff │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ ├── Org.java │ │ │ │ │ ├── Post.java │ │ │ │ │ ├── OrgStaffEntity.java │ │ │ │ │ └── Staff.java │ │ │ │ ├── service │ │ │ │ │ ├── impl │ │ │ │ │ │ └── IStaffDomainService.java │ │ │ │ │ └── StaffDomainServiceImpl.java │ │ │ │ ├── repository │ │ │ │ │ ├── dataobject │ │ │ │ │ │ └── StaffOrgDO.java │ │ │ │ │ └── IStaffRepository.java │ │ │ │ └── factory │ │ │ │ │ └── StaffFactory.java │ │ │ ├── infrastructure │ │ │ │ ├── dataobject │ │ │ │ │ ├── OrgWithStaffDO.java │ │ │ │ │ ├── PostWithStaffDO.java │ │ │ │ │ ├── OrgStaffDO.java │ │ │ │ │ └── StaffDO.java │ │ │ │ ├── mybatis │ │ │ │ │ └── repository │ │ │ │ │ │ └── mapper │ │ │ │ │ │ ├── OrgStaffMapper.java │ │ │ │ │ │ └── StaffMapper.java │ │ │ │ ├── adapter │ │ │ │ │ └── OrgAdapter.java │ │ │ │ └── converter │ │ │ │ │ └── StaffConverter.java │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── PageStaffDTO.java │ │ │ │ │ ├── StaffSearchDTO.java │ │ │ │ │ ├── StaffExcelDTO.java │ │ │ │ │ ├── StaffFormDTO.java │ │ │ │ │ └── StaffDTO.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── StaffEntityMapStruct.java │ │ │ │ └── assembler │ │ │ │ │ └── StaffAssembler.java │ │ │ └── application │ │ │ │ ├── service │ │ │ │ └── StaffService.java │ │ │ │ └── listener │ │ │ │ └── StaffExcelListener.java │ │ │ ├── account │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ ├── Role.java │ │ │ │ │ └── Account.java │ │ │ │ ├── repository │ │ │ │ │ ├── IAccountRoleRepository.java │ │ │ │ │ └── IAccountRepository.java │ │ │ │ └── mapstruct │ │ │ │ │ └── AccountEntityMapStruct.java │ │ │ ├── interfaces │ │ │ │ └── dto │ │ │ │ │ ├── AccountPageDTO.java │ │ │ │ │ ├── AccountInDTO.java │ │ │ │ │ ├── AccountExcelDTO.java │ │ │ │ │ └── AccountDTO.java │ │ │ ├── infrastructure │ │ │ │ ├── dataobject │ │ │ │ │ ├── AccountRoleDO.java │ │ │ │ │ ├── AccountUserRoleDO.java │ │ │ │ │ └── AccountDO.java │ │ │ │ ├── mybatis │ │ │ │ │ └── repository │ │ │ │ │ │ ├── mapper │ │ │ │ │ │ ├── AccountRoleMapper.java │ │ │ │ │ │ ├── AccountMapper.java │ │ │ │ │ │ ├── AccountUserRoleMapper.java │ │ │ │ │ │ └── AccountMapper.xml │ │ │ │ │ │ └── AccountRoleRepositoryImpl.java │ │ │ │ ├── converter │ │ │ │ │ ├── AccountConverter.java │ │ │ │ │ ├── AccountRoleConverter.java │ │ │ │ │ └── AccountUserConverter.java │ │ │ │ └── listener │ │ │ │ │ └── AccountExcelListener.java │ │ │ └── application │ │ │ │ └── service │ │ │ │ └── AccountService.java │ │ │ ├── role │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── RolePermissionDTO.java │ │ │ │ │ ├── InPermissionDTO.java │ │ │ │ │ ├── OutRoleSearchDTO.java │ │ │ │ │ ├── InRoleFormDTO.java │ │ │ │ │ ├── RoleDTO.java │ │ │ │ │ ├── OutRoleFormDTO.java │ │ │ │ │ └── InRoleSearchDTO.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── RoleEntityMapStruct.java │ │ │ │ └── assembler │ │ │ │ │ └── RoleAssembler.java │ │ │ ├── infrastructure │ │ │ │ ├── dataobject │ │ │ │ │ ├── RoleMenuDO.java │ │ │ │ │ ├── RolePermissionDO.java │ │ │ │ │ └── RoleDO.java │ │ │ │ ├── converter │ │ │ │ │ └── RoleConverter.java │ │ │ │ └── mybatis │ │ │ │ │ └── repository │ │ │ │ │ └── mapper │ │ │ │ │ └── RoleMapper.java │ │ │ ├── domain │ │ │ │ ├── enity │ │ │ │ │ └── RoleEntity.java │ │ │ │ └── repository │ │ │ │ │ └── IRoleRepository.java │ │ │ └── application │ │ │ │ └── service │ │ │ │ ├── RoleService.java │ │ │ │ └── impl │ │ │ │ └── RoleServiceImpl.java │ │ │ ├── post │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── PostPageDTO.java │ │ │ │ │ └── PostDTO.java │ │ │ │ ├── param │ │ │ │ │ └── PostParam.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── PostEntityMapStruct.java │ │ │ │ └── controller │ │ │ │ │ └── PostController.java │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ └── PostEntity.java │ │ │ │ └── repository │ │ │ │ │ └── IPostRepository.java │ │ │ └── infrastructure │ │ │ │ ├── mybatis │ │ │ │ └── repository │ │ │ │ │ ├── mapper │ │ │ │ │ └── PostMapper.java │ │ │ │ │ └── PostRepositoryImpl.java │ │ │ │ ├── dataobject │ │ │ │ └── PostDO.java │ │ │ │ └── converter │ │ │ │ └── PostConverter.java │ │ │ ├── menu │ │ │ ├── interfaces │ │ │ │ ├── param │ │ │ │ │ ├── MenuSearchParam.java │ │ │ │ │ └── MenuParam.java │ │ │ │ ├── dto │ │ │ │ │ └── MenuDTO.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── MenuEntityMapStruct.java │ │ │ │ ├── assembler │ │ │ │ │ └── MenuAssembler.java │ │ │ │ └── controller │ │ │ │ │ └── MenuController.java │ │ │ ├── application │ │ │ │ └── service │ │ │ │ │ ├── MenuService.java │ │ │ │ │ └── impl │ │ │ │ │ └── MenuServiceImpl.java │ │ │ ├── infrastructure │ │ │ │ ├── converter │ │ │ │ │ └── MenuConverter.java │ │ │ │ ├── mybatis │ │ │ │ │ └── repository │ │ │ │ │ │ └── mapper │ │ │ │ │ │ ├── MenuMapper.java │ │ │ │ │ │ └── MenuMapper.xml │ │ │ │ └── dataobject │ │ │ │ │ └── MenuDO.java │ │ │ └── domain │ │ │ │ ├── repository │ │ │ │ └── IMenuRepository.java │ │ │ │ └── entity │ │ │ │ └── MenuEntity.java │ │ │ ├── dict │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── DictPageDTO.java │ │ │ │ │ ├── DictDTO.java │ │ │ │ │ ├── DictItemPageDTO.java │ │ │ │ │ └── DictItemDTO.java │ │ │ │ ├── param │ │ │ │ │ ├── DictItemParam.java │ │ │ │ │ └── DictParam.java │ │ │ │ ├── assembler │ │ │ │ │ ├── DictAssembler.java │ │ │ │ │ └── DictItemAssembler.java │ │ │ │ ├── mapstruct │ │ │ │ │ ├── DictEntityMapStruct.java │ │ │ │ │ └── DictItemEntityMapStruct.java │ │ │ │ └── controller │ │ │ │ │ └── DictController.java │ │ │ ├── application │ │ │ │ └── service │ │ │ │ │ ├── DictService.java │ │ │ │ │ ├── DictItemService.java │ │ │ │ │ └── impl │ │ │ │ │ ├── DictServiceImpl.java │ │ │ │ │ └── DictItemServiceImpl.java │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ ├── DictEntity.java │ │ │ │ │ └── DictItemEntity.java │ │ │ │ └── repository │ │ │ │ │ ├── IDictRepository.java │ │ │ │ │ └── IDictItemRepository.java │ │ │ └── infrastructure │ │ │ │ ├── mybatis │ │ │ │ └── repository │ │ │ │ │ ├── mapper │ │ │ │ │ ├── DictMapper.java │ │ │ │ │ ├── DictItemMapper.java │ │ │ │ │ └── DictItemMapper.xml │ │ │ │ │ ├── DictRepositoryImpl.java │ │ │ │ │ └── DictItemRepositoryImpl.java │ │ │ │ ├── dataobject │ │ │ │ ├── DictDO.java │ │ │ │ └── DictItemDO.java │ │ │ │ └── converter │ │ │ │ ├── DictConverter.java │ │ │ │ └── DictItemConverter.java │ │ │ ├── resource │ │ │ ├── interfaces │ │ │ │ ├── dto │ │ │ │ │ ├── ResourcePageDTO.java │ │ │ │ │ └── ResourceDTO.java │ │ │ │ ├── param │ │ │ │ │ └── ResourceParam.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── ResourceEntityMapStruct.java │ │ │ │ ├── assembler │ │ │ │ │ └── ResourceAssembler.java │ │ │ │ └── controller │ │ │ │ │ └── ResourceController.java │ │ │ ├── application │ │ │ │ ├── ResourceService.java │ │ │ │ └── impl │ │ │ │ │ └── ResourceServiceImpl.java │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ └── ResourceEntity.java │ │ │ │ └── repository │ │ │ │ │ └── IResourceRepository.java │ │ │ └── infrastructure │ │ │ │ ├── dataobject │ │ │ │ └── ResourceDO.java │ │ │ │ ├── mybatis │ │ │ │ └── repository │ │ │ │ │ ├── mapper │ │ │ │ │ ├── ResourceMapper.java │ │ │ │ │ └── ResourceMapper.xml │ │ │ │ │ └── ResourceRepositoryImpl.java │ │ │ │ └── converter │ │ │ │ └── ResourceConverter.java │ │ │ ├── org │ │ │ ├── application │ │ │ │ └── service │ │ │ │ │ ├── OrgService.java │ │ │ │ │ └── impl │ │ │ │ │ └── OrgServiceImpl.java │ │ │ ├── interfaces │ │ │ │ ├── param │ │ │ │ │ ├── OrgSearchParam.java │ │ │ │ │ └── OrgParam.java │ │ │ │ ├── dto │ │ │ │ │ └── OrgDTO.java │ │ │ │ ├── assembler │ │ │ │ │ └── OrgAssembler.java │ │ │ │ ├── mapstruct │ │ │ │ │ └── OrgEntityMapStruct.java │ │ │ │ └── controller │ │ │ │ │ └── OrgController.java │ │ │ ├── domain │ │ │ │ ├── entity │ │ │ │ │ └── OrgEntity.java │ │ │ │ ├── repository │ │ │ │ │ └── IOrgRepository.java │ │ │ │ └── factory │ │ │ │ │ └── OrgFactory.java │ │ │ └── infrastructure │ │ │ │ ├── mybatis │ │ │ │ └── repository │ │ │ │ │ ├── mapper │ │ │ │ │ ├── OrgMapper.java │ │ │ │ │ └── OrgMapper.xml │ │ │ │ │ └── OrgRepositoryImpl.java │ │ │ │ ├── dataobject │ │ │ │ └── OrgDO.java │ │ │ │ └── converter │ │ │ │ └── OrgConverter.java │ │ │ └── operation │ │ │ ├── application │ │ │ └── service │ │ │ │ ├── OperationService.java │ │ │ │ └── OperationServiceImpl.java │ │ │ ├── interfaces │ │ │ └── param │ │ │ │ ├── OperationPageDTO.java │ │ │ │ └── OperationDTO.java │ │ │ ├── domain │ │ │ ├── entity │ │ │ │ └── Operation.java │ │ │ ├── repository │ │ │ │ └── IOperationRepository.java │ │ │ ├── assembler │ │ │ │ └── OperationAssembler.java │ │ │ └── mapstruct │ │ │ │ └── OperationEntityMapStruct.java │ │ │ └── infrastructure │ │ │ ├── dataobject │ │ │ └── OperationDO.java │ │ │ ├── mybatis │ │ │ └── repository │ │ │ │ ├── mapper │ │ │ │ └── OperationMapper.java │ │ │ │ └── OperationRepositoryImpl.java │ │ │ └── converter │ │ │ └── OperationConverter.java │ └── test │ │ └── java │ │ └── com │ │ └── chomolungma │ │ └── auth │ │ └── CdpApplicationTest.java └── pom.xml ├── cdp-core ├── src │ └── main │ │ └── java │ │ └── com │ │ └── chomolungma │ │ └── core │ │ ├── dto │ │ ├── PageDTO.java │ │ └── BaseDTO.java │ │ ├── exception │ │ ├── BusinessRuntimeException.java │ │ └── GlobalExceptionHandler.java │ │ ├── service │ │ ├── ExcelService.java │ │ └── ExcelServiceImpl.java │ │ ├── CurrentProfileHolder.java │ │ ├── entity │ │ └── BaseEntity.java │ │ ├── dataobject │ │ └── BaseDO.java │ │ ├── result │ │ └── Result.java │ │ └── UserDetail.java └── pom.xml ├── .gitignore ├── cdp-common ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── chomolungma │ │ │ └── common │ │ │ └── utils │ │ │ ├── WebUtils.java │ │ │ └── IpUtils.java │ └── test │ │ └── java │ │ └── com │ │ └── chomolungma │ │ └── auth │ │ └── AppTest.java └── pom.xml └── HELP.md /cdp-auth/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kushu001/cdp/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/application/service/LoginLogService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.application.service; 2 | 3 | public interface LoginLogService { 4 | Void generateLoginLog(); 5 | } 6 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/login/param/LoginForm.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.login.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginForm { 7 | private String username; 8 | private String password; 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/entity/Org.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Org { 7 | private Long id; 8 | private String name; 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/domain/entity/Role.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.domain.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Role { 7 | private Long id; 8 | private String name; 9 | } 10 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/dto/PageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PageDTO extends BaseDTO{ 7 | private Integer limit; 8 | private Integer page; 9 | private Long total; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/exception/BusinessRuntimeException.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.exception; 2 | 3 | public class BusinessRuntimeException extends RuntimeException{ 4 | public BusinessRuntimeException(String msg){ 5 | super(msg); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/application/service/OperateLogService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.application.service; 2 | 3 | import java.io.IOException; 4 | 5 | public interface OperateLogService { 6 | Void generateOperateLog() throws IOException; 7 | } 8 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/RolePermissionDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class RolePermissionDTO { 7 | private Long id; 8 | private Long pid; 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/entity/Post.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Post { 7 | private Long id; 8 | private String name; 9 | private String code; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/InPermissionDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class InPermissionDTO { 9 | private List permissions; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/domain/repository/IAccountRoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.domain.repository; 2 | 3 | public interface IAccountRoleRepository { 4 | Void save(Long accountId, Long roleId); 5 | 6 | Void remove(Long accountId); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/infrastructure/dataobject/RoleMenuDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.infrastructure.dataobject; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class RoleMenuDO { 7 | private Long menuId; 8 | private Boolean isHalfKey; 9 | } 10 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/login/application/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.login.application.service; 2 | 3 | public interface LoginService { 4 | String login(String username, String password); 5 | 6 | void resetPassword(String oldPassword, String newPassword, String confirmPassword); 7 | } 8 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/dataobject/OrgWithStaffDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.dataobject; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OrgWithStaffDO { 7 | private Long id; 8 | private String name; 9 | private String code; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/dataobject/PostWithStaffDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.dataobject; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PostWithStaffDO { 7 | private Long id; 8 | private String name; 9 | private String code; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/interfaces/dto/PostPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class PostPageDTO extends PageDTO { 10 | List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/param/MenuSearchParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class MenuSearchParam { 7 | private String name; 8 | private String url; 9 | private String icon; 10 | private String status; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/infrastructure/dataobject/RolePermissionDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.infrastructure.dataobject; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | @Data 7 | public class RolePermissionDO { 8 | private Long roleId; 9 | private List permissions; 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/dto/DictPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.dto; 2 | 3 | 4 | import com.chomolungma.core.dto.PageDTO; 5 | import lombok.Data; 6 | import java.util.List; 7 | 8 | @Data 9 | public class DictPageDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/service/impl/IStaffDomainService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.service.impl; 2 | 3 | 4 | import com.chomolungma.system.staff.domain.entity.Staff; 5 | 6 | public interface IStaffDomainService { 7 | void addStaff(Staff staff); 8 | void modifyStaff(Staff staff); 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/dto/PageStaffDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class PageStaffDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/application/service/DictService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.application.service; 2 | 3 | import com.chomolungma.system.dict.domain.entity.DictEntity; 4 | 5 | public interface DictService { 6 | Void createDict(DictEntity dictEntity); 7 | 8 | Void updateDict(DictEntity dictEntity); 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/dto/LoginLogPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class LoginLogPageDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/interfaces/param/PostParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PostParam { 7 | private Long id; 8 | private String name; 9 | private String code; 10 | private String type; 11 | private Integer sort; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/dto/ResourcePageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class ResourcePageDTO extends PageDTO { 10 | List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/OutRoleSearchDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class OutRoleSearchDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/interfaces/dto/AccountPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class AccountPageDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/dto/DictDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.dto; 2 | 3 | 4 | import com.chomolungma.core.dto.BaseDTO; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class DictDTO extends BaseDTO { 9 | private String code; 10 | private String name; 11 | private String sort; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/dto/DictItemPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.dto; 2 | 3 | 4 | import com.chomolungma.core.dto.PageDTO; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class DictItemPageDTO extends PageDTO { 11 | private List records; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/dto/OperateLogPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class OperateLogPageDTO extends PageDTO { 10 | private List records; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/domain/entity/DictEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class DictEntity extends BaseEntity { 8 | private String code; 9 | private String name; 10 | private String sort; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/application/ResourceService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.application; 2 | 3 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 4 | 5 | public interface ResourceService { 6 | void create(ResourceEntity resourceEntity); 7 | 8 | void modify(ResourceEntity resourceEntity); 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/param/ResourceParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ResourceParam { 7 | private Long id; 8 | private String name; 9 | private String sign; 10 | private String url; 11 | private String method; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/service/ExcelService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.service; 2 | 3 | 4 | import java.io.IOException; 5 | import java.util.Collection; 6 | 7 | public interface ExcelService { 8 | void export(Collection t, Class clazz) throws IOException; 9 | 10 | void export(Collection t, Class clazz, String fileName) throws IOException; 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/application/service/OrgService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.application.service; 2 | 3 | import com.chomolungma.system.org.interfaces.param.OrgParam; 4 | 5 | public interface OrgService { 6 | void createOrg(OrgParam orgEntity); 7 | 8 | void updateOrg(OrgParam orgParam); 9 | 10 | void deleteOrg(Long code); 11 | } 12 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/InRoleFormDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class InRoleFormDTO { 7 | public Long id; 8 | public String name; 9 | public String code; 10 | public String remark; 11 | public Boolean enabled; 12 | public Integer status; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/RoleDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class RoleDTO extends BaseDTO { 8 | private String name; 9 | private String code; 10 | private Boolean enabled; 11 | private String remark; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/application/service/DictItemService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.application.service; 2 | 3 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 4 | 5 | public interface DictItemService { 6 | 7 | Void createDictItem(DictItemEntity dictItemEntity); 8 | 9 | Void updateDictItem(DictItemEntity dictItemEntity); 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/dto/ResourceDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ResourceDTO extends BaseDTO { 8 | private String name; 9 | private String sign; 10 | private String url; 11 | private String method; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/OutRoleFormDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OutRoleFormDTO { 7 | private Long id; 8 | private String name; 9 | private String code; 10 | private String remark; 11 | private Boolean enabled; 12 | private Integer status; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/param/OrgSearchParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OrgSearchParam { 7 | private String name; 8 | private String code; 9 | private String manager; 10 | private Long managerId; 11 | private String tel; 12 | private String status; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/domain/entity/ResourceEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ResourceEntity extends BaseEntity { 8 | private String name; 9 | private String sign; 10 | private String url; 11 | private String method; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/interfaces/dto/PostDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class PostDTO extends BaseDTO { 8 | private String name; 9 | private String code; 10 | private String type; 11 | private String typeName; 12 | private Integer sort; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/dto/LoginLogDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class LoginLogDTO extends PageDTO { 8 | private String user; 9 | private String address; 10 | private String client; 11 | private String os; 12 | private String ip; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/application/service/OperationService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.application.service; 2 | 3 | import com.chomolungma.system.operation.interfaces.param.OperationDTO; 4 | 5 | /** 6 | * Automatically generated code by CDP-GENERATOR maven-plugin. 7 | * Thank you for your use. 8 | * Good Luck! 9 | */ 10 | 11 | public interface OperationService { 12 | 13 | } -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/dto/DictItemDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.dto; 2 | 3 | 4 | import com.chomolungma.core.dto.BaseDTO; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class DictItemDTO extends BaseDTO { 9 | private String code; 10 | private String name; 11 | private String value; 12 | private String sort; 13 | private Boolean enabled; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/domain/entity/LoginLogEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class LoginLogEntity extends BaseEntity { 8 | private String user; 9 | private String address; 10 | private String ip; 11 | private String client; 12 | private String os; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/domain/entity/PostEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class PostEntity extends BaseEntity { 8 | private String name; 9 | private String code; 10 | private String type; 11 | private String typeName; 12 | private Integer sort; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/entity/OrgStaffEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.entity.BaseEntity; 5 | import lombok.Data; 6 | 7 | @TableName("sys_org_user") 8 | @Data 9 | public class OrgStaffEntity extends BaseEntity { 10 | private Long orgId; 11 | private Long userId; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/dataobject/LoginLogDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.dataobject; 2 | 3 | import com.chomolungma.core.dataobject.BaseDO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class LoginLogDO extends BaseDO { 8 | private String user; 9 | private String address; 10 | private String client; 11 | private String os; 12 | private String ip; 13 | } 14 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/login/param/ResetPasswordDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.login.param; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * Created by IntelliJ IDEA 7 | * 8 | * @Author: kushu001 9 | * @Date: 2024/01/20/20:26 10 | * @Description: 11 | */ 12 | @Data 13 | public class ResetPasswordDTO { 14 | private String oldPassword; 15 | private String newPassword; 16 | private String confirmPassword; 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/mybatis/repository/mapper/DictMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.dict.infrastructure.dataobject.DictDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface DictMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/infrastructure/mybatis/repository/mapper/PostMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.post.infrastructure.dataobject.PostDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface PostMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /**/target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | *.log 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /build/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | ### MACOS ### 29 | .DS_Store 30 | */.DS_Store -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/domain/enity/RoleEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.domain.enity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class RoleEntity { 9 | private Long id; 10 | private String name; 11 | private String code; 12 | private String remark; 13 | private Boolean enabled; 14 | private Integer status; 15 | private Date createTime; 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/dataobject/AccountRoleDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName("sys_account_role") 9 | public class AccountRoleDO extends BaseDO { 10 | private Long accountId; 11 | private Long roleId; 12 | } 13 | -------------------------------------------------------------------------------- /cdp-auth/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/cdp?serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true 6 | username: root 7 | password: 12345678 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | jackson: 10 | property-naming-strategy: SNAKE_CASE 11 | 12 | mybatis-plus: 13 | configuration: 14 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/domain/entity/DictItemEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class DictItemEntity extends BaseEntity { 8 | private Long dictId; 9 | private String code; 10 | private String name; 11 | private String value; 12 | private Integer sort; 13 | private Boolean enabled; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/mybatis/repository/mapper/OrgStaffMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.staff.infrastructure.dataobject.OrgStaffDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface OrgStaffMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /cdp-auth/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/cdp?serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true 6 | username: root 7 | password: 12345678 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | jackson: 10 | property-naming-strategy: SNAKE_CASE 11 | 12 | mybatis-plus: 13 | configuration: 14 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /cdp-auth/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/cdp?serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true 6 | username: root 7 | password: 12345678 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | jackson: 10 | property-naming-strategy: SNAKE_CASE 11 | 12 | mybatis-plus: 13 | configuration: 14 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/dto/OrgDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OrgDTO extends BaseDTO { 8 | private Long pid; 9 | private String name; 10 | private String code; 11 | private String manager; 12 | private String managerId; 13 | private String tel; 14 | private String order; 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/domain/repository/ILoginLogRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.domain.repository; 2 | 3 | import com.chomolungma.system.log.interfaces.dto.LoginLogDTO; 4 | import com.chomolungma.system.log.interfaces.dto.LoginLogPageDTO; 5 | 6 | public interface ILoginLogRepository { 7 | LoginLogPageDTO find(int current, int size, String user, String client, String os); 8 | 9 | Void save(LoginLogDTO loginLogDTO); 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/dto/OperateLogDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OperateLogDTO extends PageDTO { 8 | private String user; 9 | private String url; 10 | private String requestMethod; 11 | private String resourceName; 12 | private String pathPayload; 13 | private String payload; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/param/OrgParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OrgParam { 7 | private Long id; 8 | private Long pid = 0l; 9 | private String name; 10 | private String code; 11 | private String manager; 12 | private Long managerId; 13 | private String tel; 14 | private Integer order; 15 | private String status; 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/domain/entity/OrgEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OrgEntity extends BaseEntity { 8 | private Long pid; 9 | private String name; 10 | private String code; 11 | private String manager; 12 | private Long managerId; 13 | private String tel; 14 | private Integer order; 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/mybatis/repository/mapper/AccountRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.account.infrastructure.dataobject.AccountRoleDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface AccountRoleMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/domain/entity/OperateLogEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OperateLogEntity extends BaseEntity { 8 | private String user; 9 | private String url; 10 | private String requestMethod; 11 | private String resourceName; 12 | private String pathPayload; 13 | private String payload; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/domain/repository/IOrgRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.domain.repository; 2 | 3 | import com.chomolungma.system.org.domain.entity.OrgEntity; 4 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 5 | 6 | import java.util.List; 7 | 8 | public interface IOrgRepository { 9 | OrgEntity find(Long id); 10 | List find(OrgDTO orgDTO); 11 | void save(OrgEntity org); 12 | void remove(Long id); 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/infrastructure/dataobject/PostDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName("sys_post") 9 | public class PostDO extends BaseDO { 10 | private String name; 11 | private String code; 12 | private String type; 13 | private Integer sort; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/dto/StaffSearchDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class StaffSearchDTO extends PageDTO { 8 | private String name; 9 | private Integer gender; 10 | private String idNumber; 11 | private String tel; 12 | private String phone; 13 | private String address; 14 | private String company; 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/dataobject/OperateLogDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.dataobject; 2 | 3 | import com.chomolungma.core.dataobject.BaseDO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class OperateLogDO extends BaseDO { 8 | private String user; 9 | private String url; 10 | private String requestMethod; 11 | private String resourceName; 12 | private String pathPayload; 13 | private String payload; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/dto/StaffExcelDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class StaffExcelDTO { 7 | private String name; 8 | private Integer gender; 9 | private String idNumber; 10 | private String tel; 11 | private String phone; 12 | private String address; 13 | private String company; 14 | private String deptId; 15 | private String deptName; 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/interfaces/dto/AccountInDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class AccountInDTO { 9 | private Long id; 10 | private Long userId; 11 | private List roleIds; 12 | private String username; 13 | private String nickname; 14 | private String avatar; 15 | private Boolean enabled; 16 | private Integer status; 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/domain/repository/IOperateLogRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.domain.repository; 2 | 3 | import com.chomolungma.system.log.interfaces.dto.OperateLogDTO; 4 | import com.chomolungma.system.log.interfaces.dto.OperateLogPageDTO; 5 | 6 | public interface IOperateLogRepository { 7 | OperateLogPageDTO find(int current, int size, String user, String requestMethod, String resourceName); 8 | 9 | Void save(OperateLogDTO operateLogDTO); 10 | } 11 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/interfaces/param/OperationPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.interfaces.param; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Automatically generated code by CDP-GENERATOR maven-plugin. 10 | * Thank you for your use. 11 | * Good Luck! 12 | */ 13 | 14 | @Data 15 | public class OperationPageDTO extends PageDTO { 16 | private List records; 17 | } -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/CurrentProfileHolder.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core; 2 | 3 | public class CurrentProfileHolder { 4 | private static ThreadLocal context = new ThreadLocal<>(); 5 | 6 | public static void setContext(UserDetail account) { 7 | context.set(account); 8 | } 9 | 10 | public static UserDetail getProfile(){ 11 | return context.get(); 12 | } 13 | 14 | public static void remove(){ 15 | context.remove(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/infrastructure/dataobject/ResourceDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName("sys_resource") 9 | public class ResourceDO extends BaseDO { 10 | private String name; 11 | private String sign; 12 | private String url; 13 | private String method; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/mapper/LoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.chomolungma.system.log.infrastructure.dataobject.LoginLogDO; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface LoginLogMapper { 10 | List selectList(LoginLogDO loginLogDO); 11 | 12 | void insert(LoginLogDO loginLogDO); 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/dataobject/OrgStaffDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @TableName(value = "sys_org_user") 8 | @Data 9 | public class OrgStaffDO extends BaseDO { 10 | private Long orgId; 11 | private String orgName; 12 | private Long userId; 13 | private String userName; 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/interfaces/dto/AccountExcelDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.interfaces.dto; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class AccountExcelDTO{ 8 | @ExcelProperty("账号") 9 | private String username; 10 | @ExcelProperty("用户名") 11 | private String name; 12 | @ExcelProperty("昵称") 13 | private String nickname; 14 | @ExcelProperty("头像") 15 | private String avatar; 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/dataobject/DictDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @TableName("sys_dict") 8 | @Data 9 | public class DictDO extends BaseDO { 10 | private String name; 11 | private String code; 12 | // @TableField("`desc`") 13 | // private String desc; 14 | private Integer sort; 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/mapper/OperateLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.chomolungma.system.log.infrastructure.dataobject.OperateLogDO; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface OperateLogMapper { 10 | List selectList(OperateLogDO operateLogDO); 11 | 12 | void insert(OperateLogDO operateLogDO); 13 | } 14 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/infrastructure/dataobject/RoleDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName("sys_role") 9 | public class RoleDO extends BaseDO { 10 | private String name; 11 | private String code; 12 | private String remark; 13 | private Boolean enabled; 14 | private Integer status; 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/dto/InRoleSearchDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | public class InRoleSearchDTO extends PageDTO { 10 | public String name; 11 | public String code; 12 | public String remark; 13 | public Integer status; 14 | public Boolean enabled; 15 | public Date startTime; 16 | public Date endTime; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/application/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.application.service; 2 | 3 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 4 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 5 | 6 | import java.util.List; 7 | 8 | public interface MenuService { 9 | void createMenu(MenuEntity menuEntity); 10 | 11 | void deleteMenu(Long id); 12 | 13 | void updateMenu(MenuEntity menuEntity); 14 | 15 | List permissions(String type); 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/domain/repository/IDictRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.domain.repository; 2 | 3 | import com.chomolungma.system.dict.interfaces.dto.DictPageDTO; 4 | import com.chomolungma.system.dict.domain.entity.DictEntity; 5 | 6 | import java.util.List; 7 | 8 | public interface IDictRepository { 9 | DictPageDTO find(int current, int size, String param); 10 | 11 | DictEntity find(Long id); 12 | 13 | void save(DictEntity dictEntity); 14 | 15 | void remove(Listids); 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/param/DictItemParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.param; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class DictItemParam extends PageDTO { 8 | private Long id; 9 | private Long dictId; 10 | private String name; 11 | private String code; 12 | private String value; 13 | private String desc; 14 | private Integer sort; 15 | private Integer status; 16 | private Boolean enabled; 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/mybatis/repository/mapper/DictItemMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface DictItemMapper extends BaseMapper { 11 | List selectListByDictCode(String code); 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/infrastructure/converter/MenuConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.infrastructure.converter; 2 | 3 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 4 | import com.chomolungma.system.menu.infrastructure.dataobject.MenuDO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | @Mapper 9 | public interface MenuConverter { 10 | MenuConverter INSTANCE = Mappers.getMapper(MenuConverter.class); 11 | MenuDO toDO(MenuEntity menuEntity); 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/infrastructure/mybatis/repository/mapper/OrgMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.org.infrastructure.dataobject.OrgDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface OrgMapper extends BaseMapper { 11 | List selectVo(OrgDO orgDO); 12 | 13 | OrgDO selectById(Long id); 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/dataobject/DictItemDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @TableName("sys_dict_item") 8 | @Data 9 | public class DictItemDO extends BaseDO { 10 | private Long dictId; 11 | private String name; 12 | private String value; 13 | private String code; 14 | private Integer sort; 15 | private Boolean enabled; 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/infrastructure/mybatis/repository/mapper/ResourceMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.resource.infrastructure.dataobject.ResourceDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface ResourceMapper extends BaseMapper { 11 | List selectList(ResourceDO resourceDO); 12 | } 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/dataobject/AccountUserRoleDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.dataobject; 2 | 3 | import com.chomolungma.core.dataobject.BaseDO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class AccountUserRoleDO extends BaseDO { 10 | private String username; 11 | private String nickname; 12 | private String name; 13 | private String roleName; 14 | private List roleIds; 15 | private String avatar; 16 | private Boolean enabled; 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/repository/dataobject/StaffOrgDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.repository.dataobject; 2 | 3 | import com.chomolungma.core.dataobject.BaseDO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class StaffOrgDO extends BaseDO { 8 | private String name; 9 | private String idNumber; 10 | private String gender; 11 | private String tel; 12 | private String phone; 13 | private String address; 14 | private String company; 15 | private String deptId; 16 | private String deptName; 17 | } 18 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/dto/BaseDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | public class BaseDTO { 10 | private Long id; 11 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 12 | private Date createTime; 13 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 14 | private Date updateTime; 15 | private Long createUser; 16 | private Long updateUser; 17 | private Integer status; 18 | } 19 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/domain/repository/IPostRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.domain.repository; 2 | 3 | import com.chomolungma.system.post.interfaces.dto.PostPageDTO; 4 | import com.chomolungma.system.post.domain.entity.PostEntity; 5 | 6 | import java.util.List; 7 | 8 | public interface IPostRepository { 9 | Void save(PostEntity postEntity); 10 | PostPageDTO find(int current, int size, String name, String code); 11 | List findAll(); 12 | PostEntity find(Long id); 13 | 14 | Void remove(List ids); 15 | } 16 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/entity/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import lombok.Data; 6 | 7 | import java.time.Instant; 8 | 9 | @Data 10 | public class BaseEntity { 11 | @TableId(type = IdType.AUTO) 12 | private Long id; 13 | 14 | private Instant createTime; 15 | 16 | private Instant updateTime; 17 | 18 | private Long createUser; 19 | 20 | private Long updateUser; 21 | 22 | private Integer status; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/converter/DictConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.converter; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictDO; 4 | import com.chomolungma.system.dict.domain.entity.DictEntity; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | @Mapper 9 | public interface DictConverter { 10 | DictConverter INSTANCE = Mappers.getMapper(DictConverter.class); 11 | 12 | DictEntity toEntity(DictDO dictDO); 13 | 14 | DictDO toDO(DictEntity dictEntity); 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/application/service/AccountService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.application.service; 2 | 3 | import com.chomolungma.system.account.domain.entity.Account; 4 | import com.chomolungma.system.account.interfaces.dto.AccountDTO; 5 | 6 | import java.util.List; 7 | 8 | public interface AccountService { 9 | 10 | Void resetPassword(Long id); 11 | 12 | Void bindUser(Long id, Long userId); 13 | 14 | Void createAccount(Account account); 15 | 16 | Void updateAccount(Account account); 17 | 18 | List getAccounts(Account account); 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/converter/AccountConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.converter; 2 | 3 | import com.chomolungma.system.account.infrastructure.dataobject.AccountDO; 4 | import com.chomolungma.system.account.domain.entity.Account; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | @Mapper 9 | public interface AccountConverter { 10 | AccountConverter INSTANCE = Mappers.getMapper(AccountConverter.class); 11 | 12 | Account toEntity(AccountDO accountDO); 13 | 14 | AccountDO toDO(Account account); 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/domain/repository/IMenuRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.domain.repository; 2 | 3 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 4 | import com.chomolungma.system.menu.infrastructure.dataobject.MenuDO; 5 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 6 | 7 | import java.util.List; 8 | 9 | public interface IMenuRepository { 10 | List find(List roleIds); 11 | List find(); 12 | List find(String type); 13 | void save(MenuEntity menuEntity); 14 | 15 | void remove(Long id); 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/param/MenuParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.param; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class MenuParam { 7 | private Long id; 8 | private Long pid; 9 | private String name; 10 | private String title; 11 | private String url; 12 | private String icon; 13 | private String sort; 14 | private String type; 15 | private String permission; 16 | private Boolean affix; 17 | private Boolean enabled; 18 | private Boolean isHidden; 19 | private Boolean isHome; 20 | private String status; 21 | } 22 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/domain/repository/IResourceRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.domain.repository; 2 | 3 | import com.chomolungma.system.resource.interfaces.dto.ResourcePageDTO; 4 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 5 | 6 | import java.util.List; 7 | 8 | public interface IResourceRepository { 9 | void save(ResourceEntity resourceEntity); 10 | 11 | ResourcePageDTO find(int current, int size, String name, String sign, String url, String method); 12 | 13 | ResourceEntity find(Long id); 14 | 15 | void remove(List ids); 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/infrastructure/mybatis/repository/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.menu.infrastructure.dataobject.MenuDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface MenuMapper extends BaseMapper { 11 | List selectMenusByRoleIds(List roleIds); 12 | void deleteRoleMenuRelByMenuId(Long menuId); 13 | 14 | void deleteMenus(Long menuId); 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/interfaces/dto/AccountDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class AccountDTO extends PageDTO { 10 | private Long userId; 11 | private String username; 12 | private List roleIds; 13 | private List permissions; 14 | private List resources; 15 | private String roleName; 16 | private String name; 17 | private String nickname; 18 | private String avatar; 19 | private Boolean enabled; 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/converter/AccountRoleConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.converter; 2 | 3 | import com.chomolungma.system.account.infrastructure.dataobject.AccountRoleDO; 4 | import com.chomolungma.system.account.domain.entity.Account; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | @Mapper 9 | public interface AccountRoleConverter { 10 | AccountRoleConverter INSTANCE = Mappers.getMapper(AccountRoleConverter.class); 11 | 12 | Account toEntity(AccountRoleDO accountRoleDO); 13 | 14 | AccountRoleDO toDO(Account account); 15 | } 16 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/dto/StaffFormDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class StaffFormDTO { 9 | private Long id; 10 | private String code; 11 | private String name; 12 | private Integer gender; 13 | private String idNumber; 14 | private String tel; 15 | private String phone; 16 | private String email; 17 | private String address; 18 | private String homeAddress; 19 | private String company; 20 | private List postIds; 21 | private List orgIds; 22 | } 23 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/infrastructure/dataobject/OrgDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.chomolungma.core.dataobject.BaseDO; 6 | import lombok.Data; 7 | 8 | @Data 9 | @TableName(value = "sys_org") 10 | public class OrgDO extends BaseDO { 11 | private Long pid; 12 | private String name; 13 | private String code; 14 | private String manager; 15 | private Long managerId; 16 | private String tel; 17 | @TableField("`order`") 18 | private Integer order; 19 | } 20 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/CdpApplication.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.ComponentScan; 7 | 8 | /** 9 | * cdp框架启动类 10 | * 11 | */ 12 | @SpringBootApplication 13 | @ComponentScan(basePackages = {"com.chomolungma"}) 14 | @MapperScan("com.chomolungma.**.mapper") 15 | public class CdpApplication 16 | { 17 | public static void main( String[] args ) 18 | { 19 | SpringApplication.run(CdpApplication.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/infrastructure/converter/RoleConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.infrastructure.converter; 2 | 3 | import com.chomolungma.system.role.domain.enity.RoleEntity; 4 | import com.chomolungma.system.role.infrastructure.dataobject.RoleDO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface RoleConverter { 12 | RoleConverter INSTANCE = Mappers.getMapper(RoleConverter.class); 13 | 14 | RoleEntity toEntity(RoleDO roleDO); 15 | 16 | RoleDO toDO(RoleEntity role); 17 | 18 | List toEntity(List roleDOS); 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/domain/entity/Operation.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import java.lang.String; 5 | import lombok.Data; 6 | 7 | /** 8 | * Automatically generated code by CDP-GENERATOR maven-plugin. 9 | * Thank you for your use. 10 | * Good Luck! 11 | */ 12 | 13 | @Data 14 | public class Operation extends BaseEntity { 15 | // 按钮名称 16 | private String name; 17 | // 编码 18 | private String code; 19 | // 组件路径 20 | private String path; 21 | // 所属分组 22 | private String group; 23 | // 级别(1. 系统级 2. 页面级) 24 | private String level; 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/interfaces/param/OperationDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.interfaces.param; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import java.lang.String; 5 | import lombok.Data; 6 | 7 | /** 8 | * Automatically generated code by CDP-GENERATOR maven-plugin. 9 | * Thank you for your use. 10 | * Good Luck! 11 | */ 12 | 13 | @Data 14 | public class OperationDTO extends PageDTO { 15 | // 按钮名称 16 | private String name; 17 | // 编码 18 | private String code; 19 | // 组件路径 20 | private String path; 21 | // 所属分组 22 | private String group; 23 | // 级别(1. 系统级 2. 页面级) 24 | private String level; 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/dataobject/StaffDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @TableName(value = "sys_user") 8 | @Data 9 | public class StaffDO extends BaseDO { 10 | private String code; 11 | private String name; 12 | private String gender; 13 | private String tel; 14 | private String phone; 15 | private String email; 16 | private String idNumber; 17 | private String address; 18 | private String homeAddress; 19 | private String company; 20 | } 21 | -------------------------------------------------------------------------------- /cdp-common/src/main/java/com/chomolungma/common/utils/WebUtils.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.common.utils; 2 | 3 | import javax.servlet.http.HttpServletResponse; 4 | import java.io.IOException; 5 | 6 | public class WebUtils { 7 | public static String renderString(HttpServletResponse response, String string) { 8 | try 9 | { 10 | response.setStatus(200); 11 | response.setContentType("application/json"); 12 | response.setCharacterEncoding("utf-8"); 13 | response.getWriter().print(string); 14 | } 15 | catch (IOException e) 16 | { 17 | e.printStackTrace(); 18 | } 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/domain/repository/IDictItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.domain.repository; 2 | 3 | import com.chomolungma.system.dict.interfaces.dto.DictItemDTO; 4 | import com.chomolungma.system.dict.interfaces.dto.DictItemPageDTO; 5 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 6 | 7 | import java.util.List; 8 | 9 | public interface IDictItemRepository { 10 | DictItemPageDTO find(int current, int size, Long dictId, String name, String code); 11 | 12 | DictItemEntity find(Long id); 13 | 14 | List find(String code); 15 | 16 | void save(DictItemEntity dictItemEntity); 17 | 18 | void remove(Listids); 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/param/DictParam.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.param; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | public class DictParam extends PageDTO { 11 | private String name; 12 | private String code; 13 | private String desc; 14 | private Integer sort; 15 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 16 | private Date createTime; 17 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 18 | private Date updateTime; 19 | private String param; 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/assembler/OrgAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.assembler; 2 | 3 | import com.chomolungma.system.org.domain.entity.OrgEntity; 4 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 5 | import com.chomolungma.system.org.interfaces.mapstruct.OrgEntityMapStruct; 6 | 7 | import java.util.List; 8 | 9 | public final class OrgAssembler { 10 | 11 | public static List toDTO(List orgList){ 12 | return OrgEntityMapStruct.INSTANCE.toDTO(orgList); 13 | } 14 | 15 | public static OrgDTO toDTO(OrgEntity orgEntity){ 16 | return OrgEntityMapStruct.INSTANCE.toDTO(orgEntity); 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cdp-auth/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ _ _ 2 | / __ \ | | | 3 | | / \/ |__ ___ _ __ ___ ___ | |_ _ _ __ __ _ _ __ ___ __ _ 4 | | | | '_ \ / _ \| '_ ` _ \ / _ \| | | | | '_ \ / _` | '_ ` _ \ / _` | 5 | | \__/\ | | | (_) | | | | | | (_) | | |_| | | | | (_| | | | | | | (_| | 6 | \____/_| |_|\___/|_| |_| |_|\___/|_|\__,_|_| |_|\__, |_| |_| |_|\__,_| 7 | __/ | 8 | |___/ 9 | 10 | +-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 11 | |c|o|p|y|r|i|g|h|t| |b|y| |c|h|o|m|o|l|u|n|g|m|a|.|c|o|m|.|c|n| 12 | +-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 13 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/domain/entity/MenuEntity.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class MenuEntity extends BaseEntity { 8 | private String code; 9 | private String pCode; 10 | private Long pid; 11 | private String title; 12 | private String name; 13 | private String url; 14 | private String icon; 15 | private String sort; 16 | private String permission; 17 | private Boolean affix; 18 | private Boolean hasLeaf = false; 19 | private Boolean isHidden; 20 | private Boolean isHome; 21 | private String type; 22 | private Boolean enabled; 23 | } 24 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/dataobject/AccountDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.FieldFill; 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.chomolungma.core.dataobject.BaseDO; 7 | import lombok.Data; 8 | 9 | @Data 10 | @TableName("sys_account") 11 | public class AccountDO extends BaseDO { 12 | private String username; 13 | @TableField(fill = FieldFill.INSERT_UPDATE) 14 | private Long userId; 15 | private String nickname; 16 | private String password; 17 | private String avatar; 18 | private Boolean enabled; 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/mapstruct/ResourceEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 4 | import com.chomolungma.system.resource.interfaces.dto.ResourceDTO; 5 | import com.chomolungma.system.resource.interfaces.param.ResourceParam; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | @Mapper 10 | public interface ResourceEntityMapStruct { 11 | ResourceEntityMapStruct INSTANCE = Mappers.getMapper(ResourceEntityMapStruct.class); 12 | 13 | ResourceEntity toEntity(ResourceParam resourceParam); 14 | 15 | ResourceDTO toDTO(ResourceEntity resourceEntity); 16 | } 17 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/dataobject/BaseDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.IdType; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import lombok.Data; 7 | 8 | import java.util.Date; 9 | 10 | @Data 11 | public class BaseDO { 12 | @TableId(type = IdType.AUTO) 13 | private Long id; 14 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 15 | private Date createTime; 16 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 17 | private Date updateTime; 18 | private Long createUser; 19 | private Long updateUser; 20 | private Integer status; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/converter/DictItemConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.converter; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 4 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface DictItemConverter { 12 | DictItemConverter INSTANCE = Mappers.getMapper(DictItemConverter.class); 13 | 14 | DictItemEntity toEntity(DictItemDO dictItemDO); 15 | 16 | List toEntity(List dictItemDOS); 17 | 18 | DictItemDO toDO(DictItemEntity dictItemEntity); 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/dto/StaffDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class StaffDTO extends BaseDTO { 10 | private String code; 11 | private String name; 12 | private Integer gender; 13 | private String idNumber; 14 | private String tel; 15 | private String phone; 16 | private String email; 17 | private String address; 18 | private String homeAddress; 19 | private String company; 20 | private List orgIds; 21 | private String orgNames; 22 | private List postIds; 23 | private String postNames; 24 | } 25 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/dto/MenuDTO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.dto; 2 | 3 | import com.chomolungma.core.dto.BaseDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class MenuDTO extends BaseDTO { 8 | private String code; 9 | private String pCode; 10 | private Long pid; 11 | private String title; 12 | private String name; 13 | private String url; 14 | private String icon; 15 | private String permission; 16 | private Boolean affix; 17 | private Boolean hasLeaf; 18 | private String sort; 19 | private String type; 20 | private Boolean enabled; 21 | private Boolean isHidden; 22 | private Boolean isHome; 23 | private Boolean disabled; 24 | } 25 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/mybatis/repository/mapper/AccountMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.account.infrastructure.dataobject.AccountDO; 5 | import com.chomolungma.system.account.domain.entity.Role; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import java.util.List; 8 | @Mapper 9 | public interface AccountMapper extends BaseMapper { 10 | List selectRolesByAccountId(Long accountId); 11 | List getPermissions(Long accountId); 12 | List getResources(Long accountId); 13 | void deleteBatchByIds(List ids); 14 | } 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/interfaces/mapstruct/PostEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.post.domain.entity.PostEntity; 4 | import com.chomolungma.system.post.interfaces.dto.PostDTO; 5 | import com.chomolungma.system.post.interfaces.param.PostParam; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface PostEntityMapStruct { 13 | PostEntityMapStruct INSTANCE = Mappers.getMapper(PostEntityMapStruct.class); 14 | PostEntity toEntity(PostParam param); 15 | 16 | PostDTO toDTO(PostEntity postEntity); 17 | List toDTO(List postEntities); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/repository/IStaffRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.repository; 2 | 3 | import com.chomolungma.system.staff.domain.entity.Org; 4 | import com.chomolungma.system.staff.domain.entity.Post; 5 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 6 | import com.chomolungma.system.staff.domain.entity.Staff; 7 | 8 | import java.util.List; 9 | 10 | public interface IStaffRepository { 11 | List findStaffs(Long orgId, Staff staff); 12 | void save(Staff staff); 13 | void remove(List ids); 14 | Staff findStaff(String idNumber); 15 | Staff findStaff(Long id); 16 | List findPosts(List ids); 17 | List findOrgs(List ids); 18 | } 19 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/converter/LoginLogConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.converter; 2 | 3 | import com.chomolungma.system.log.domain.entity.LoginLogEntity; 4 | import com.chomolungma.system.log.interfaces.dto.LoginLogDTO; 5 | import com.chomolungma.system.log.infrastructure.dataobject.LoginLogDO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | @Mapper 10 | public interface LoginLogConverter { 11 | LoginLogConverter INSTANCE = Mappers.getMapper(LoginLogConverter.class); 12 | 13 | LoginLogDO toDO(LoginLogEntity loginLogEntity); 14 | 15 | LoginLogDO toDO(LoginLogDTO loginLogDTO); 16 | 17 | LoginLogEntity toEntity(LoginLogDO loginLogDO); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/infrastructure/converter/OrgConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.infrastructure.converter; 2 | 3 | import com.chomolungma.system.org.domain.entity.OrgEntity; 4 | import com.chomolungma.system.org.infrastructure.dataobject.OrgDO; 5 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface OrgConverter { 13 | OrgConverter INSTANCE = Mappers.getMapper(OrgConverter.class); 14 | 15 | OrgEntity toEntity(OrgDO orgDO); 16 | 17 | OrgDO toDO(OrgDTO orgDTO); 18 | 19 | OrgDO toDO(OrgEntity org); 20 | 21 | List toEntity(List orgDOS); 22 | } 23 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.exception; 2 | 3 | 4 | import com.chomolungma.core.result.Result; 5 | import org.springframework.http.HttpStatus; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.ResponseStatus; 8 | import org.springframework.web.bind.annotation.RestControllerAdvice; 9 | 10 | @RestControllerAdvice 11 | public class GlobalExceptionHandler { 12 | 13 | @ExceptionHandler(BusinessRuntimeException.class) 14 | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) 15 | public Result handlerException(BusinessRuntimeException ex){ 16 | return Result.fail(ex.getMessage(),ex.getCause()); 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/mybatis/repository/mapper/DictItemMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/domain/repository/IOperationRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.domain.repository; 2 | 3 | import com.chomolungma.system.operation.domain.entity.Operation; 4 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 5 | import com.github.pagehelper.PageInfo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Automatically generated code by CDP-GENERATOR maven-plugin. 11 | * Thank you for your use. 12 | * Good Luck! 13 | */ 14 | 15 | 16 | public interface IOperationRepository { 17 | void save(Operation operation); 18 | void remove(List ids); 19 | Operation find(Long id); 20 | PageInfo findPageList(Operation operation, int current, int size); 21 | } -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/config/CacheConfig.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.config; 2 | 3 | import com.github.benmanes.caffeine.cache.Cache; 4 | import com.github.benmanes.caffeine.cache.Caffeine; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class CacheConfig { 10 | @Bean 11 | public Cache caffeineCache() { 12 | return Caffeine.newBuilder() 13 | // 设置最后一次写入或访问后经过固定时间过期 14 | //.expireAfterWrite(60, TimeUnit.MINUTES) 15 | // 初始的缓存空间大小 16 | .initialCapacity(100) 17 | // 缓存的最大条数 18 | .maximumSize(1000) 19 | .build(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/entity/Staff.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class Staff extends BaseEntity { 10 | private String code; 11 | private String name; 12 | private Integer gender; 13 | private String idNumber; 14 | private String tel; 15 | private String phone; 16 | private String email; 17 | private String address; 18 | private String homeAddress; 19 | private String company; 20 | private Org org; 21 | private List orgs; 22 | private List posts; 23 | 24 | 25 | public void audit(){ 26 | this.setStatus(1); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/converter/OperateLogConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.converter; 2 | 3 | import com.chomolungma.system.log.domain.entity.OperateLogEntity; 4 | import com.chomolungma.system.log.interfaces.dto.OperateLogDTO; 5 | import com.chomolungma.system.log.infrastructure.dataobject.OperateLogDO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | @Mapper 10 | public interface OperateLogConverter { 11 | OperateLogConverter INSTANCE = Mappers.getMapper(OperateLogConverter.class); 12 | 13 | OperateLogDO toDO(OperateLogEntity operateLogEntity); 14 | 15 | OperateLogDO toDO(OperateLogDTO operateLogDTO); 16 | 17 | OperateLogEntity toEntity(OperateLogDO operateLogDO); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/infrastructure/dataobject/OperationDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import java.lang.String; 6 | import lombok.Data; 7 | 8 | /** 9 | * Automatically generated code by CDP-GENERATOR maven-plugin. 10 | * Thank you for your use. 11 | * Good Luck! 12 | */ 13 | 14 | @Data 15 | @TableName("sys_operation") 16 | public class OperationDO extends BaseDO { 17 | // 按钮名称 18 | private String name; 19 | // 编码 20 | private String code; 21 | // 组件路径 22 | private String path; 23 | // 所属分组 24 | private String group; 25 | // 级别(1. 系统级 2. 页面级) 26 | private String level; 27 | } 28 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/domain/entity/Account.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.domain.entity; 2 | 3 | import com.chomolungma.core.entity.BaseEntity; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | 9 | @Data 10 | public class Account extends BaseEntity { 11 | private Long userId; 12 | private String username; 13 | private String password; 14 | private String name; 15 | private String nickname; 16 | private String avatar; 17 | private List roles; 18 | private Boolean enabled; 19 | 20 | public void resetPassword(){ 21 | this.password = "$2a$10$G8C2EAQk7audou2Niau8luZnNUin6DR1eVGhRpQ5Dmo.Ke1cpxMhK"; 22 | } 23 | 24 | public void bindUser(Long userId){ 25 | this.userId = userId; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/infrastructure/mybatis/repository/mapper/OperationMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 4 | import org.apache.ibatis.annotations.Mapper; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Automatically generated code by CDP-GENERATOR maven-plugin. 10 | * Thank you for your use. 11 | * Good Luck! 12 | */ 13 | 14 | @Mapper 15 | public interface OperationMapper { 16 | 17 | List selectLists(OperationDO operationDO); 18 | OperationDO selectById(Long id); 19 | int insert(OperationDO operationDO); 20 | int updateById(OperationDO operationDO); 21 | void deleteBatchIds(List ids); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cdp-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.chomolungma 8 | cdp 9 | 1.0.1-SNAPSHOT 10 | 11 | 12 | cdp-core 13 | jar 14 | 15 | 8 16 | 8 17 | UTF-8 18 | 19 | 20 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/converter/AccountUserConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.converter; 2 | 3 | import com.chomolungma.system.account.infrastructure.dataobject.AccountUserRoleDO; 4 | import com.chomolungma.system.account.domain.entity.Account; 5 | import com.chomolungma.system.account.interfaces.dto.AccountDTO; 6 | import org.mapstruct.Mapper; 7 | import org.mapstruct.factory.Mappers; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface AccountUserConverter { 13 | AccountUserConverter INSTANCE = Mappers.getMapper(AccountUserConverter.class); 14 | AccountUserRoleDO toDO(Account account); 15 | Account toEntity(AccountUserRoleDO accountUserRoleDO); 16 | List toEntity(List accountUserRoleDOS); 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/infrastructure/dataobject/MenuDO.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.infrastructure.dataobject; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.chomolungma.core.dataobject.BaseDO; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName(value = "sys_menu") 9 | public class MenuDO extends BaseDO { 10 | private String code; 11 | private String pCode; 12 | private Long pid; 13 | private String title; 14 | private String name; 15 | private String icon; 16 | private String url; 17 | private String permission; 18 | private Boolean affix; 19 | private Boolean hasLeaf; 20 | private String type; 21 | private Boolean enabled; 22 | private Boolean isHidden; 23 | private Boolean isHome; 24 | private Integer sort; 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/assembler/ResourceAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.assembler; 2 | 3 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 4 | import com.chomolungma.system.resource.interfaces.dto.ResourceDTO; 5 | import com.chomolungma.system.resource.interfaces.mapstruct.ResourceEntityMapStruct; 6 | import com.chomolungma.system.resource.interfaces.param.ResourceParam; 7 | 8 | public final class ResourceAssembler { 9 | public static ResourceEntity toEntity(ResourceParam resourceParam){ 10 | return ResourceEntityMapStruct.INSTANCE.toEntity(resourceParam); 11 | } 12 | 13 | public static ResourceDTO toDTO(ResourceEntity resourceEntity){ 14 | return ResourceEntityMapStruct.INSTANCE.toDTO(resourceEntity); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/domain/repository/IAccountRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.domain.repository; 2 | 3 | import com.chomolungma.system.account.interfaces.dto.AccountDTO; 4 | import com.chomolungma.system.account.interfaces.dto.AccountPageDTO; 5 | import com.chomolungma.system.account.domain.entity.Account; 6 | 7 | import java.util.List; 8 | 9 | public interface IAccountRepository { 10 | Void save(Account account); 11 | Void remove(List ids); 12 | AccountPageDTO findPageList(Account account, int current, int size); 13 | Account findAccount(Long id); 14 | Account findAccount(String username); 15 | List findAccounts(Account account); 16 | List findPermissions(Long accountId); 17 | 18 | List findResources(Long accountId); 19 | } 20 | -------------------------------------------------------------------------------- /cdp-auth/src/test/java/com/chomolungma/auth/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /cdp-common/src/test/java/com/chomolungma/auth/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/application/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.application.service; 2 | 3 | import com.chomolungma.system.role.domain.enity.RoleEntity; 4 | import com.chomolungma.system.role.interfaces.dto.RolePermissionDTO; 5 | 6 | import java.util.List; 7 | 8 | public interface RoleService { 9 | 10 | void createRole(RoleEntity roleEntity); 11 | 12 | void updateRole(RoleEntity roleEntity); 13 | 14 | void authorizedMenus(Long roleId, List permissions); 15 | 16 | void authorizedOperations(Long roleId, List permissions); 17 | 18 | void authorizedResources(Long roleId, List permissions); 19 | 20 | List menus(Long roleId); 21 | 22 | List operations(Long roleId); 23 | 24 | List resources(Long roleId); 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/mapstruct/OrgEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.org.domain.entity.OrgEntity; 4 | import com.chomolungma.system.org.infrastructure.dataobject.OrgDO; 5 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 6 | import com.chomolungma.system.org.interfaces.param.OrgParam; 7 | import org.mapstruct.Mapper; 8 | import org.mapstruct.factory.Mappers; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | public interface OrgEntityMapStruct { 14 | OrgEntityMapStruct INSTANCE = Mappers.getMapper(OrgEntityMapStruct.class); 15 | 16 | List toDTO(List orgList); 17 | 18 | OrgDTO toDTO(OrgEntity orgEntity); 19 | 20 | OrgEntity toEntity(OrgParam orgParam); 21 | 22 | OrgDO toDO(OrgParam orgParam); 23 | } 24 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/infrastructure/converter/OperationConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.infrastructure.converter; 2 | 3 | import com.chomolungma.system.operation.domain.entity.Operation; 4 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 5 | import org.mapstruct.Mapper; 6 | import org.mapstruct.factory.Mappers; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Automatically generated code by CDP-GENERATOR maven-plugin. 12 | * Thank you for your use. 13 | * Good Luck! 14 | */ 15 | 16 | @Mapper 17 | public interface OperationConverter { 18 | OperationConverter INSTANCE = Mappers.getMapper(OperationConverter.class); 19 | Operation toEntity(OperationDO operationDO); 20 | OperationDO toDO(Operation operation); 21 | List toEntity(List operationDOS); 22 | } -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/adapter/OrgAdapter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.adapter; 2 | 3 | import com.chomolungma.system.org.domain.entity.OrgEntity; 4 | import com.chomolungma.system.org.domain.repository.IOrgRepository; 5 | import com.chomolungma.system.staff.domain.entity.Org; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class OrgAdapter { 10 | private final IOrgRepository iOrgRepository; 11 | public OrgAdapter(IOrgRepository iOrgRepository) { 12 | this.iOrgRepository = iOrgRepository; 13 | } 14 | public Org adapter(Long orgId){ 15 | OrgEntity org = iOrgRepository.find(orgId); 16 | Org userOrg = new Org(); 17 | userOrg.setId(org.getId()); 18 | userOrg.setName(org.getName()); 19 | return userOrg; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/mapstruct/MenuEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.menu.infrastructure.dataobject.MenuDO; 4 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 5 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 6 | import com.chomolungma.system.menu.interfaces.param.MenuParam; 7 | import org.mapstruct.Mapper; 8 | import org.mapstruct.Mapping; 9 | import org.mapstruct.factory.Mappers; 10 | 11 | import java.util.List; 12 | 13 | @Mapper 14 | public interface MenuEntityMapStruct { 15 | MenuEntityMapStruct INSTANCE = Mappers.getMapper(MenuEntityMapStruct.class); 16 | 17 | List toMenuDto(List menuList); 18 | @Mapping(target = "pid", source = "pid", defaultValue = "0l") 19 | MenuEntity toMenuEntity(MenuParam menuParam); 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/test/java/com/chomolungma/auth/CdpApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class CdpApplicationTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public CdpApplicationTest(String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( CdpApplicationTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/mybatis/repository/mapper/AccountUserRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.account.infrastructure.dataobject.AccountUserRoleDO; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface AccountUserRoleMapper extends BaseMapper { 12 | // IPage selectList(IPage page,@Param("accountUserRole") AccountUserRoleDO accountUserRoleDO); 13 | 14 | AccountUserRoleDO selectAccount(@Param("username") String username, @Param("password") String password); 15 | 16 | List selectList(@Param("accountUserRole") AccountUserRoleDO accountUserRoleDO); 17 | } 18 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/application/service/impl/DictServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.application.service.impl; 2 | 3 | import com.chomolungma.system.dict.application.service.DictService; 4 | import com.chomolungma.system.dict.domain.entity.DictEntity; 5 | import com.chomolungma.system.dict.domain.repository.IDictRepository; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class DictServiceImpl implements DictService { 10 | 11 | private final IDictRepository iDictRepository; 12 | 13 | public DictServiceImpl(IDictRepository iDictRepository) { 14 | this.iDictRepository = iDictRepository; 15 | } 16 | 17 | @Override 18 | public Void createDict(DictEntity dictEntity) { 19 | iDictRepository.save(dictEntity); 20 | return null; 21 | } 22 | 23 | @Override 24 | public Void updateDict(DictEntity dictEntity) { 25 | iDictRepository.save(dictEntity); 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/application/impl/ResourceServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.application.impl; 2 | 3 | import com.chomolungma.system.resource.application.ResourceService; 4 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 5 | import com.chomolungma.system.resource.domain.repository.IResourceRepository; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class ResourceServiceImpl implements ResourceService { 10 | private IResourceRepository iResourceRepository; 11 | public ResourceServiceImpl(IResourceRepository iResourceRepository){ 12 | this.iResourceRepository = iResourceRepository; 13 | } 14 | @Override 15 | public void create(ResourceEntity resourceEntity) { 16 | iResourceRepository.save(resourceEntity); 17 | } 18 | 19 | @Override 20 | public void modify(ResourceEntity resourceEntity) { 21 | iResourceRepository.save(resourceEntity); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.1.17.RELEASE/maven-plugin/) 8 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.3.4.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications) 9 | * [MyBatis Framework](https://mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/) 10 | 11 | ### Guides 12 | The following guides illustrate how to use some features concretely: 13 | 14 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 15 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 16 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 17 | * [MyBatis Quick Start](https://github.com/mybatis/spring-boot-starter/wiki/Quick-Start) 18 | 19 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/handler/AuthenticationEntryPointImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.handler; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.chomolungma.core.result.Result; 5 | import com.chomolungma.common.utils.WebUtils; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.security.core.AuthenticationException; 8 | import org.springframework.security.web.AuthenticationEntryPoint; 9 | import org.springframework.stereotype.Component; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | @Component 15 | public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint { 16 | @Override 17 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) { 18 | Result result = Result.fail("用户名密码不正确", HttpStatus.FORBIDDEN); 19 | String json = JSON.toJSONString(result); 20 | WebUtils.renderString(response, json); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/application/service/OperationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.application.service; 2 | 3 | import com.chomolungma.system.operation.domain.assembler.OperationAssembler; 4 | import com.chomolungma.system.operation.domain.entity.Operation; 5 | import com.chomolungma.system.operation.domain.repository.IOperationRepository; 6 | import com.chomolungma.system.operation.interfaces.param.OperationDTO; 7 | import com.chomolungma.core.exception.BusinessRuntimeException; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * Automatically generated code by CDP-GENERATOR maven-plugin. 12 | * Thank you for your use. 13 | * Good Luck! 14 | */ 15 | 16 | @Service 17 | public class OperationServiceImpl implements OperationService{ 18 | private final IOperationRepository iOperationRepository; 19 | 20 | public OperationServiceImpl(IOperationRepository iOperationRepository){ 21 | this.iOperationRepository = iOperationRepository; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cdp-auth/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.chomolungma 6 | cdp 7 | 1.0.1-SNAPSHOT 8 | 9 | cdp-auth 10 | jar 11 | cdp-auth 12 | https://maven.apache.org 13 | 14 | 15 | junit 16 | junit 17 | 4.13.2 18 | test 19 | 20 | 21 | com.chomolungma 22 | cdp-system 23 | 1.0.1-SNAPSHOT 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /cdp-common/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.chomolungma 6 | cdp 7 | 1.0.1-SNAPSHOT 8 | 9 | cdp-common 10 | jar 11 | cdp-common 12 | https://maven.apache.org 13 | 14 | 15 | junit 16 | junit 17 | 4.13.2 18 | test 19 | 20 | 21 | com.chomolungma 22 | cdp-core 23 | 1.0.1-SNAPSHOT 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/infrastructure/converter/ResourceConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.infrastructure.converter; 2 | 3 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 4 | import com.chomolungma.system.resource.infrastructure.dataobject.ResourceDO; 5 | import com.chomolungma.system.resource.interfaces.dto.ResourcePageDTO; 6 | import com.github.pagehelper.PageInfo; 7 | import org.mapstruct.Mapper; 8 | import org.mapstruct.Mapping; 9 | import org.mapstruct.Mappings; 10 | import org.mapstruct.factory.Mappers; 11 | 12 | @Mapper 13 | public interface ResourceConverter { 14 | ResourceConverter INSTANCE = Mappers.getMapper(ResourceConverter.class); 15 | 16 | ResourceDO toDO(ResourceEntity resourceEntity); 17 | 18 | ResourceEntity toEntity(ResourceDO resourceDO); 19 | 20 | @Mappings({ 21 | @Mapping(target = "records", source = "list"), 22 | @Mapping(target = "page", source = "pageNum") 23 | }) 24 | ResourcePageDTO toDTO(PageInfo pageInfo); 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.chomolungma 6 | cdp 7 | 1.0.1-SNAPSHOT 8 | 9 | cdp-system 10 | jar 11 | cdp-system 12 | https://maven.apache.org 13 | 14 | 15 | junit 16 | junit 17 | 4.13.2 18 | test 19 | 20 | 21 | com.chomolungma 22 | cdp-common 23 | 1.0.1-SNAPSHOT 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/infrastructure/converter/PostConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.infrastructure.converter; 2 | 3 | import com.chomolungma.system.post.infrastructure.dataobject.PostDO; 4 | import com.chomolungma.system.post.domain.entity.PostEntity; 5 | import com.chomolungma.system.post.interfaces.dto.PostPageDTO; 6 | import com.github.pagehelper.PageInfo; 7 | import org.mapstruct.Mapper; 8 | import org.mapstruct.Mapping; 9 | import org.mapstruct.Mappings; 10 | import org.mapstruct.factory.Mappers; 11 | 12 | import java.util.List; 13 | 14 | @Mapper 15 | public interface PostConverter { 16 | PostConverter INSTANCE = Mappers.getMapper(PostConverter.class); 17 | PostDO toDO(PostEntity postEntity); 18 | 19 | PostEntity toEntity(PostDO postDO); 20 | 21 | List toEntity(List postDO); 22 | @Mappings({ 23 | @Mapping(target = "records", source = "list"), 24 | @Mapping(target = "page", source = "pageNum") 25 | }) 26 | PostPageDTO toDTO(PageInfo pageInfo); 27 | } 28 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/assembler/DictAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.assembler; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictDO; 4 | import com.chomolungma.system.dict.domain.entity.DictEntity; 5 | import com.chomolungma.system.dict.interfaces.dto.DictDTO; 6 | import com.chomolungma.system.dict.interfaces.dto.DictPageDTO; 7 | import com.chomolungma.system.dict.interfaces.mapstruct.DictEntityMapStruct; 8 | import com.chomolungma.system.dict.interfaces.param.DictParam; 9 | import com.github.pagehelper.PageInfo; 10 | 11 | public class DictAssembler { 12 | public static DictEntity covertToEntity(DictParam dictParam){ 13 | return DictEntityMapStruct.INSTANCE.covertToEntity(dictParam); 14 | } 15 | 16 | public static DictDTO toDTO(DictEntity dictEntity){ 17 | return DictEntityMapStruct.INSTANCE.toDTO(dictEntity); 18 | } 19 | 20 | public static DictPageDTO toDTO(PageInfo pageInfo){ 21 | return DictEntityMapStruct.INSTANCE.toDTO(pageInfo); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/assembler/MenuAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.assembler; 2 | 3 | import com.chomolungma.system.menu.infrastructure.dataobject.MenuDO; 4 | import com.chomolungma.system.menu.interfaces.mapstruct.MenuEntityMapStruct; 5 | import com.chomolungma.system.menu.interfaces.param.MenuParam; 6 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 7 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 8 | 9 | import java.util.List; 10 | 11 | public final class MenuAssembler { 12 | 13 | public static List convertToDto(List menuList){ 14 | return MenuEntityMapStruct.INSTANCE.toMenuDto(menuList); 15 | } 16 | 17 | public static MenuEntity convertParamToEntity(MenuParam menuParam){ 18 | MenuEntity menuEntity = MenuEntityMapStruct.INSTANCE.toMenuEntity(menuParam); 19 | if (menuParam.getType().equals("0")){ 20 | menuEntity.setName(menuParam.getUrl().substring(1).replaceAll("/","-")); 21 | } 22 | return menuEntity; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/application/service/impl/DictItemServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.application.service.impl; 2 | 3 | import com.chomolungma.system.dict.application.service.DictItemService; 4 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 5 | import com.chomolungma.system.dict.domain.repository.IDictItemRepository; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class DictItemServiceImpl implements DictItemService { 10 | 11 | private final IDictItemRepository iDictItemRepository; 12 | 13 | public DictItemServiceImpl(IDictItemRepository iDictItemRepository) { 14 | this.iDictItemRepository = iDictItemRepository; 15 | } 16 | 17 | @Override 18 | public Void createDictItem(DictItemEntity dictItemEntity) { 19 | iDictItemRepository.save(dictItemEntity); 20 | return null; 21 | } 22 | 23 | @Override 24 | public Void updateDictItem(DictItemEntity dictItemEntity) { 25 | iDictItemRepository.save(dictItemEntity); 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/application/service/StaffService.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.application.service; 2 | 3 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 4 | import com.chomolungma.system.staff.domain.entity.Staff; 5 | import com.chomolungma.system.staff.interfaces.dto.PageStaffDTO; 6 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 7 | import com.chomolungma.system.staff.interfaces.dto.StaffFormDTO; 8 | 9 | import java.util.List; 10 | 11 | public interface StaffService { 12 | PageStaffDTO getStaffs(Long orgId, String name, String idNumber, String phone, String tel, String address, Integer status, Integer page, Integer limit); 13 | List getStaffs(Long orgId, String name, String idNumber, String phone, String tel, String address); 14 | StaffDTO getStaff(Long id); 15 | void createStaff(Long orgId, StaffFormDTO staffFormDTO); 16 | void updateStaff(StaffFormDTO staffFormDTO); 17 | void deleteStaffs(List ids); 18 | List getMenus(List roleIds); 19 | void audit(Long userId); 20 | } 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/assembler/LoginLogAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.assembler; 2 | 3 | import com.chomolungma.system.log.domain.entity.LoginLogEntity; 4 | import com.chomolungma.system.log.interfaces.dto.LoginLogDTO; 5 | import com.chomolungma.system.log.interfaces.dto.LoginLogPageDTO; 6 | import com.chomolungma.system.log.infrastructure.dataobject.LoginLogDO; 7 | import com.github.pagehelper.PageInfo; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.Mappings; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface LoginLogAssembler { 15 | LoginLogAssembler INSTANCE = Mappers.getMapper(LoginLogAssembler.class); 16 | 17 | LoginLogEntity toEntity(LoginLogDTO loginLogDTO); 18 | 19 | LoginLogDTO toDTO(LoginLogEntity loginLogEntity); 20 | 21 | @Mappings({ 22 | @Mapping(target = "records", source = "list"), 23 | @Mapping(target = "page", source = "pageNum") 24 | }) 25 | LoginLogPageDTO toPageDTO(PageInfo pageInfo); 26 | } 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/domain/repository/IRoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.domain.repository; 2 | 3 | import com.chomolungma.system.role.interfaces.dto.RolePermissionDTO; 4 | import com.chomolungma.system.role.interfaces.dto.RoleDTO; 5 | import com.chomolungma.system.role.domain.enity.RoleEntity; 6 | import com.github.pagehelper.PageInfo; 7 | 8 | import java.util.List; 9 | 10 | public interface IRoleRepository { 11 | void saveMenus(Long roleId, List permissions); 12 | 13 | void saveOperations(Long roleId, List permissions); 14 | 15 | void saveResources(Long roleId, List permissions); 16 | 17 | void save(RoleEntity role); 18 | 19 | List findMenus(Long roleId); 20 | 21 | List findOperation(Long roleId); 22 | 23 | List findResources(Long roleId); 24 | 25 | PageInfo find(int current, int size, RoleEntity role); 26 | 27 | List findAll(); 28 | 29 | RoleEntity find(Long roleId); 30 | 31 | void remove(List ids); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/mapstruct/DictEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictDO; 4 | import com.chomolungma.system.dict.domain.entity.DictEntity; 5 | import com.chomolungma.system.dict.interfaces.dto.DictDTO; 6 | import com.chomolungma.system.dict.interfaces.dto.DictPageDTO; 7 | import com.chomolungma.system.dict.interfaces.param.DictParam; 8 | import com.github.pagehelper.PageInfo; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.Mapping; 11 | import org.mapstruct.Mappings; 12 | import org.mapstruct.factory.Mappers; 13 | 14 | @Mapper 15 | public interface DictEntityMapStruct { 16 | DictEntityMapStruct INSTANCE = Mappers.getMapper(DictEntityMapStruct.class); 17 | 18 | DictEntity covertToEntity(DictParam dictParam); 19 | DictDTO toDTO(DictEntity dictEntity); 20 | @Mappings({ 21 | @Mapping(target = "records", source = "list"), 22 | @Mapping(target = "page", source = "pageNum") 23 | }) 24 | DictPageDTO toDTO(PageInfo pageInfo); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/assembler/OperateLogAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.assembler; 2 | 3 | import com.chomolungma.system.log.domain.entity.OperateLogEntity; 4 | import com.chomolungma.system.log.interfaces.dto.OperateLogDTO; 5 | import com.chomolungma.system.log.interfaces.dto.OperateLogPageDTO; 6 | import com.chomolungma.system.log.infrastructure.dataobject.OperateLogDO; 7 | import com.github.pagehelper.PageInfo; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.Mappings; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | @Mapper 14 | public interface OperateLogAssembler { 15 | OperateLogAssembler INSTANCE = Mappers.getMapper(OperateLogAssembler.class); 16 | 17 | OperateLogEntity toEntity(OperateLogDTO operateLogDTO); 18 | 19 | OperateLogDTO toDTO(OperateLogEntity operateLogEntity); 20 | 21 | @Mappings({ 22 | @Mapping(target = "records", source = "list"), 23 | @Mapping(target = "page", source = "pageNum") 24 | }) 25 | OperateLogPageDTO toPageDTO(PageInfo pageInfo); 26 | } 27 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/handler/AccessDeniedHandlerImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.handler; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.chomolungma.common.utils.WebUtils; 5 | import com.chomolungma.core.result.Result; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.security.access.AccessDeniedException; 8 | import org.springframework.security.web.access.AccessDeniedHandler; 9 | import org.springframework.stereotype.Component; 10 | 11 | import javax.servlet.ServletException; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import java.io.IOException; 15 | @Component 16 | public class AccessDeniedHandlerImpl implements AccessDeniedHandler { 17 | @Override 18 | public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { 19 | Result result = Result.fail("此接口没有权限", HttpStatus.METHOD_NOT_ALLOWED); 20 | String json = JSON.toJSONString(result); 21 | WebUtils.renderString(response, json); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/application/listener/StaffExcelListener.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.application.listener; 2 | 3 | import com.alibaba.excel.context.AnalysisContext; 4 | import com.alibaba.excel.read.listener.ReadListener; 5 | import com.chomolungma.core.service.ExcelService; 6 | import com.chomolungma.system.staff.domain.repository.IStaffRepository; 7 | import com.chomolungma.system.staff.interfaces.dto.StaffExcelDTO; 8 | 9 | public class StaffExcelListener implements ReadListener { 10 | private String code; 11 | 12 | private IStaffRepository iStaffRepository; 13 | 14 | private ExcelService excelService; 15 | 16 | public StaffExcelListener(String code, IStaffRepository iStaffRepository, ExcelService excelService){ 17 | this.code = code; 18 | this.iStaffRepository = iStaffRepository; 19 | this.excelService = excelService; 20 | } 21 | @Override 22 | public void invoke(StaffExcelDTO staffExcelDTO, AnalysisContext analysisContext) { 23 | 24 | } 25 | 26 | @Override 27 | public void doAfterAllAnalysed(AnalysisContext analysisContext) { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/mapstruct/StaffEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.mapstruct; 2 | 3 | 4 | import com.chomolungma.system.staff.domain.entity.Staff; 5 | import com.chomolungma.system.staff.interfaces.dto.PageStaffDTO; 6 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 7 | import com.chomolungma.system.staff.interfaces.dto.StaffFormDTO; 8 | import com.chomolungma.system.staff.interfaces.dto.StaffSearchDTO; 9 | import com.github.pagehelper.PageInfo; 10 | import org.mapstruct.Mapper; 11 | import org.mapstruct.Mapping; 12 | import org.mapstruct.Mappings; 13 | import org.mapstruct.factory.Mappers; 14 | 15 | 16 | @Mapper 17 | public interface StaffEntityMapStruct { 18 | StaffEntityMapStruct INSTANCE = Mappers.getMapper(StaffEntityMapStruct.class); 19 | 20 | @Mappings({ 21 | @Mapping(target = "records", source = "list"), 22 | @Mapping(target = "page", source = "pageNum") 23 | }) 24 | PageStaffDTO toPageUserDTO(PageInfo pageUsers); 25 | Staff toEntity(StaffFormDTO staffFormDTO); 26 | Staff toEntity(StaffSearchDTO staffSearchDTO); 27 | StaffDTO toDTO(Staff staff); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/service/StaffDomainServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.service; 2 | 3 | import com.chomolungma.core.exception.BusinessRuntimeException; 4 | import com.chomolungma.system.staff.domain.repository.IStaffRepository; 5 | import com.chomolungma.system.staff.domain.entity.Staff; 6 | import com.chomolungma.system.staff.domain.service.impl.IStaffDomainService; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class StaffDomainServiceImpl implements IStaffDomainService { 11 | private final IStaffRepository iStaffRepository; 12 | public StaffDomainServiceImpl(IStaffRepository iStaffRepository){ 13 | this.iStaffRepository = iStaffRepository; 14 | } 15 | @Override 16 | public void addStaff(Staff staff) { 17 | Staff isStaff = iStaffRepository.findStaff(staff.getIdNumber()); 18 | if (isStaff != null) { 19 | throw new BusinessRuntimeException("用户身份证号已存在,请查证后再建!"); 20 | } else { 21 | iStaffRepository.save(staff); 22 | } 23 | } 24 | 25 | @Override 26 | public void modifyStaff(Staff staff) { 27 | iStaffRepository.save(staff); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/domain/assembler/OperationAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.domain.assembler; 2 | 3 | import com.chomolungma.system.operation.domain.entity.Operation; 4 | import com.chomolungma.system.operation.domain.mapstruct.OperationEntityMapStruct; 5 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 6 | import com.chomolungma.system.operation.interfaces.param.OperationDTO; 7 | import com.chomolungma.system.operation.interfaces.param.OperationPageDTO; 8 | import com.github.pagehelper.PageInfo; 9 | 10 | /** 11 | * Automatically generated code by CDP-GENERATOR maven-plugin. 12 | * Thank you for your use. 13 | * Good Luck! 14 | */ 15 | 16 | public class OperationAssembler { 17 | public static Operation toEntity(OperationDTO operationDTO){ 18 | return OperationEntityMapStruct.INSTANCE.toEntity(operationDTO); 19 | } 20 | 21 | public static OperationDTO toDTO(Operation operation){ 22 | return OperationEntityMapStruct.INSTANCE.toDTO(operation); 23 | } 24 | 25 | public static OperationPageDTO toOperationPageDTO(PageInfo page){ 26 | return OperationEntityMapStruct.INSTANCE.toOperationPageDTO(page); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/infrastructure/mybatis/repository/mapper/ResourceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/controller/LoginLogController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.controller; 2 | 3 | 4 | import com.chomolungma.system.log.domain.repository.ILoginLogRepository; 5 | import com.chomolungma.core.dto.PageDTO; 6 | import com.chomolungma.core.result.Result; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | @RequestMapping("/api/v1/login-log") 15 | public class LoginLogController { 16 | @Autowired 17 | private ILoginLogRepository iLoginLogRepository; 18 | 19 | @GetMapping 20 | public Result pageList(PageDTO pageDTO, 21 | @RequestParam(required = false) String user, 22 | @RequestParam(required = false) String client, 23 | @RequestParam(required = false) String os){ 24 | return Result.success(iLoginLogRepository.find(pageDTO.getPage(), pageDTO.getLimit(), user, client, os)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/converter/StaffConverter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.converter; 2 | 3 | import com.chomolungma.system.staff.domain.entity.Org; 4 | import com.chomolungma.system.staff.domain.entity.Post; 5 | import com.chomolungma.system.staff.domain.entity.Staff; 6 | import com.chomolungma.system.staff.infrastructure.dataobject.OrgWithStaffDO; 7 | import com.chomolungma.system.staff.infrastructure.dataobject.PostWithStaffDO; 8 | import com.chomolungma.system.staff.infrastructure.dataobject.StaffDO; 9 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 10 | import org.mapstruct.Mapper; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | import java.util.List; 14 | 15 | @Mapper 16 | public interface StaffConverter { 17 | StaffConverter INSTANCE = Mappers.getMapper(StaffConverter.class); 18 | 19 | StaffDO toDO(Staff staff); 20 | 21 | Staff toEntity(StaffDO staffDO); 22 | 23 | StaffDTO toDTO(StaffDO staffDO); 24 | 25 | List toEntity(List postWithStaffDOS); 26 | List toOrgEntity(List orgWithStaffDOS); 27 | 28 | List toDO(List posts); 29 | List toOrgDO(List orgs); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/mapstruct/RoleEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.role.interfaces.dto.RoleDTO; 4 | import com.chomolungma.system.role.domain.enity.RoleEntity; 5 | import com.chomolungma.system.role.interfaces.dto.InRoleFormDTO; 6 | import com.chomolungma.system.role.interfaces.dto.InRoleSearchDTO; 7 | import com.chomolungma.system.role.interfaces.dto.OutRoleSearchDTO; 8 | import com.github.pagehelper.PageInfo; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.Mapping; 11 | import org.mapstruct.Mappings; 12 | import org.mapstruct.factory.Mappers; 13 | 14 | import java.util.List; 15 | 16 | @Mapper 17 | public interface RoleEntityMapStruct { 18 | RoleEntityMapStruct INSTANCE = Mappers.getMapper(RoleEntityMapStruct.class); 19 | 20 | RoleEntity fromSearchDTO(InRoleSearchDTO inRoleSearchDTO); 21 | 22 | RoleEntity fromFormDTO(InRoleFormDTO inRoleFormDTO); 23 | 24 | @Mappings({ 25 | @Mapping(target = "records", source = "list"), 26 | @Mapping(target = "page", source = "pageNum") 27 | }) 28 | OutRoleSearchDTO toDTO(PageInfo pageInfo); 29 | 30 | List toDTO(List roleEntities); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/interfaces/controller/OperateLogController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.interfaces.controller; 2 | 3 | 4 | import com.chomolungma.system.log.domain.repository.IOperateLogRepository; 5 | import com.chomolungma.core.dto.PageDTO; 6 | import com.chomolungma.core.result.Result; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | @RequestMapping("/api/v1/operate-log") 15 | public class OperateLogController { 16 | @Autowired 17 | private IOperateLogRepository iOperateLogRepository; 18 | @GetMapping 19 | public Result pageList(PageDTO pageDTO, 20 | @RequestParam(required = false) String user, 21 | @RequestParam(required = false) String requestMethod, 22 | @RequestParam(required = false) String resourceName){ 23 | return Result.success(iOperateLogRepository.find(pageDTO.getPage(), pageDTO.getLimit(), user, requestMethod, resourceName)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/mapstruct/DictItemEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.mapstruct; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 4 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 5 | import com.chomolungma.system.dict.interfaces.dto.DictItemDTO; 6 | import com.chomolungma.system.dict.interfaces.dto.DictItemPageDTO; 7 | import com.chomolungma.system.dict.interfaces.param.DictItemParam; 8 | import com.github.pagehelper.PageInfo; 9 | import org.mapstruct.Mapper; 10 | import org.mapstruct.Mapping; 11 | import org.mapstruct.Mappings; 12 | import org.mapstruct.factory.Mappers; 13 | 14 | import java.util.List; 15 | 16 | @Mapper 17 | public interface DictItemEntityMapStruct { 18 | DictItemEntityMapStruct INSTANCE = Mappers.getMapper(DictItemEntityMapStruct.class); 19 | DictItemEntity covertToEntity(DictItemParam dictItemParam); 20 | 21 | DictItemDTO toDTO(DictItemEntity dictItemEntity); 22 | 23 | List toDTO(List dictItemDOS); 24 | 25 | @Mappings({ 26 | @Mapping(target = "records", source = "list"), 27 | @Mapping(target = "page", source = "pageNum") 28 | }) 29 | DictItemPageDTO toDTO(PageInfo pageInfo); 30 | } 31 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/domain/factory/StaffFactory.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.domain.factory; 2 | 3 | import com.chomolungma.system.staff.domain.entity.Org; 4 | import com.chomolungma.system.staff.domain.entity.Post; 5 | import com.chomolungma.system.staff.domain.entity.Staff; 6 | import com.chomolungma.system.staff.domain.repository.IStaffRepository; 7 | import com.chomolungma.system.staff.interfaces.assembler.StaffAssembler; 8 | import com.chomolungma.system.staff.interfaces.dto.StaffFormDTO; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.util.List; 12 | 13 | @Component 14 | public class StaffFactory { 15 | private final IStaffRepository iStaffRepository; 16 | 17 | public StaffFactory(IStaffRepository iStaffRepository){ 18 | this.iStaffRepository = iStaffRepository; 19 | } 20 | 21 | public Staff createStaff(StaffFormDTO staffFormDTO){ 22 | Staff staff = StaffAssembler.toEntity(staffFormDTO); 23 | List postIds = staffFormDTO.getPostIds(); 24 | List posts = iStaffRepository.findPosts(postIds); 25 | List orgs = iStaffRepository.findOrgs(staffFormDTO.getOrgIds()); 26 | staff.setOrgs(orgs); 27 | staff.setPosts(posts); 28 | return staff; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/domain/mapstruct/OperationEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.domain.mapstruct; 2 | 3 | import com.chomolungma.system.operation.domain.entity.Operation; 4 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 5 | import com.chomolungma.system.operation.interfaces.param.OperationDTO; 6 | import com.chomolungma.system.operation.interfaces.param.OperationPageDTO; 7 | import com.github.pagehelper.PageInfo; 8 | import org.mapstruct.Mapper; 9 | import org.mapstruct.Mapping; 10 | import org.mapstruct.Mappings; 11 | import org.mapstruct.factory.Mappers; 12 | 13 | /** 14 | * Automatically generated code by CDP-GENERATOR maven-plugin. 15 | * Thank you for your use. 16 | * Good Luck! 17 | */ 18 | 19 | 20 | @Mapper 21 | public interface OperationEntityMapStruct { 22 | OperationEntityMapStruct INSTANCE = Mappers.getMapper(OperationEntityMapStruct.class); 23 | 24 | Operation toEntity(OperationDTO operationDTO); 25 | 26 | OperationDTO toDTO(Operation operation); 27 | 28 | @Mappings({ 29 | @Mapping(target = "records", source = "list"), 30 | @Mapping(target = "page", source = "pageNum") 31 | }) 32 | OperationPageDTO toOperationPageDTO(PageInfo operationPageInfo); 33 | 34 | } -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/interfaces/assembler/RoleAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.interfaces.assembler; 2 | 3 | import com.chomolungma.system.role.interfaces.dto.OutRoleSearchDTO; 4 | import com.chomolungma.system.role.interfaces.mapstruct.RoleEntityMapStruct; 5 | import com.chomolungma.system.role.interfaces.dto.RoleDTO; 6 | import com.chomolungma.system.role.domain.enity.RoleEntity; 7 | import com.chomolungma.system.role.interfaces.dto.InRoleFormDTO; 8 | import com.chomolungma.system.role.interfaces.dto.InRoleSearchDTO; 9 | import com.github.pagehelper.PageInfo; 10 | 11 | import java.util.List; 12 | 13 | public class RoleAssembler { 14 | public static RoleEntity toEntity(InRoleSearchDTO inRoleSearchDTO){ 15 | return RoleEntityMapStruct.INSTANCE.fromSearchDTO(inRoleSearchDTO); 16 | } 17 | 18 | public static RoleEntity toEntity(InRoleFormDTO inRoleFormDTO){ 19 | return RoleEntityMapStruct.INSTANCE.fromFormDTO(inRoleFormDTO); 20 | } 21 | 22 | public static OutRoleSearchDTO toDTO(PageInfo pageInfo){ 23 | return RoleEntityMapStruct.INSTANCE.toDTO(pageInfo); 24 | } 25 | 26 | public static List toDTO(List roleEntities){ 27 | return RoleEntityMapStruct.INSTANCE.toDTO(roleEntities); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/assembler/DictItemAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.assembler; 2 | 3 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 4 | import com.chomolungma.system.dict.interfaces.mapstruct.DictItemEntityMapStruct; 5 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 6 | import com.chomolungma.system.dict.interfaces.dto.DictItemDTO; 7 | import com.chomolungma.system.dict.interfaces.dto.DictItemPageDTO; 8 | import com.chomolungma.system.dict.interfaces.param.DictItemParam; 9 | import com.github.pagehelper.PageInfo; 10 | 11 | import java.util.List; 12 | 13 | public class DictItemAssembler { 14 | public static DictItemEntity covertToEntity(DictItemParam dictItemParam){ 15 | return DictItemEntityMapStruct.INSTANCE.covertToEntity(dictItemParam); 16 | } 17 | 18 | public static DictItemDTO toDTO(DictItemEntity dictItemEntity){ 19 | return DictItemEntityMapStruct.INSTANCE.toDTO(dictItemEntity); 20 | } 21 | 22 | public static List toDTO(List dictItemDOS){ 23 | return DictItemEntityMapStruct.INSTANCE.toDTO(dictItemDOS); 24 | } 25 | 26 | public static DictItemPageDTO toDTO(PageInfo pageInfo){ 27 | return DictItemEntityMapStruct.INSTANCE.toDTO(pageInfo); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/service/ExcelServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.service; 2 | 3 | import com.alibaba.excel.EasyExcel; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | 7 | import javax.servlet.http.HttpServletResponse; 8 | import java.io.IOException; 9 | import java.net.URLEncoder; 10 | import java.util.Collection; 11 | 12 | @Service 13 | public class ExcelServiceImpl implements ExcelService{ 14 | 15 | @Autowired 16 | private HttpServletResponse response; 17 | 18 | @Override 19 | public void export(Collection t, Class clazz) throws IOException { 20 | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman 21 | export(t, clazz, System.currentTimeMillis()+""); 22 | } 23 | 24 | @Override 25 | public void export(Collection t, Class clazz, String fileName) throws IOException { 26 | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman 27 | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); 28 | response.setCharacterEncoding("utf-8"); 29 | response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")+ ".xlsx"); 30 | EasyExcel.write(response.getOutputStream(), clazz).autoCloseStream(Boolean.FALSE).sheet("模板").doWrite(t); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/mapper/OperateLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | 17 | insert into sys_operate_log (user, url, request_method, resource_name, path_payload, payload, status) values ( 18 | #{user, jdbcType=VARCHAR}, 19 | #{url, jdbcType=VARCHAR}, 20 | #{requestMethod, jdbcType=VARCHAR}, 21 | #{resourceName, jdbcType=VARCHAR}, 22 | #{pathPayload, jdbcType=VARCHAR}, 23 | #{payload, jdbcType=VARCHAR}, 24 | '1' 25 | ) 26 | 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/application/service/impl/OrgServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.application.service.impl; 2 | 3 | import com.chomolungma.system.org.application.service.OrgService; 4 | import com.chomolungma.system.org.domain.entity.OrgEntity; 5 | import com.chomolungma.system.org.domain.factory.OrgFactory; 6 | import com.chomolungma.system.org.domain.repository.IOrgRepository; 7 | import com.chomolungma.system.org.interfaces.param.OrgParam; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class OrgServiceImpl implements OrgService { 12 | 13 | private final OrgFactory orgFactory; 14 | 15 | private final IOrgRepository iOrgRepository; 16 | 17 | public OrgServiceImpl(OrgFactory orgFactory, IOrgRepository iOrgRepository){ 18 | this.orgFactory = orgFactory; 19 | this.iOrgRepository = iOrgRepository; 20 | } 21 | 22 | @Override 23 | public void createOrg(OrgParam orgParam) { 24 | OrgEntity org = orgFactory.createOrg(orgParam); 25 | iOrgRepository.save(org); 26 | } 27 | 28 | 29 | @Override 30 | public void updateOrg(OrgParam orgParam) { 31 | OrgEntity org = orgFactory.createOrg(orgParam); 32 | iOrgRepository.save(org); 33 | } 34 | 35 | @Override 36 | public void deleteOrg(Long id) { 37 | iOrgRepository.remove(id); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/mybatis/repository/AccountRoleRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.account.infrastructure.dataobject.AccountRoleDO; 5 | import com.chomolungma.system.account.domain.repository.IAccountRoleRepository; 6 | import com.chomolungma.system.account.infrastructure.mybatis.repository.mapper.AccountRoleMapper; 7 | import org.springframework.stereotype.Repository; 8 | 9 | @Repository 10 | public class AccountRoleRepositoryImpl implements IAccountRoleRepository { 11 | 12 | private final AccountRoleMapper accountRoleMapper; 13 | 14 | public AccountRoleRepositoryImpl(AccountRoleMapper accountRoleMapper) { 15 | this.accountRoleMapper = accountRoleMapper; 16 | } 17 | 18 | @Override 19 | public Void save(Long accountId, Long roleId) { 20 | AccountRoleDO accountRoleDO = new AccountRoleDO(); 21 | accountRoleDO.setAccountId(accountId); 22 | accountRoleDO.setRoleId(roleId); 23 | accountRoleMapper.insert(accountRoleDO); 24 | return null; 25 | } 26 | 27 | @Override 28 | public Void remove(Long accountId) { 29 | accountRoleMapper.delete(new QueryWrapper().eq("account_id",accountId)); 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/mapper/LoginLogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | 19 | 20 | insert into sys_login_log (ip, user, address, client, os, status) values ( 21 | #{ip, jdbcType=VARCHAR}, 22 | #{user, jdbcType=VARCHAR}, 23 | #{address, jdbcType=VARCHAR}, 24 | #{client, jdbcType=VARCHAR}, 25 | #{os, jdbcType=VARCHAR}, 26 | '1' 27 | ) 28 | 29 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/infrastructure/mybatis/repository/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.role.infrastructure.dataobject.RoleDO; 5 | import com.chomolungma.system.role.infrastructure.dataobject.RolePermissionDO; 6 | import com.chomolungma.system.role.interfaces.dto.RolePermissionDTO; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | @Mapper 12 | public interface RoleMapper extends BaseMapper { 13 | void insertRoleMenusPermission(@Param("rolePermissionDO") RolePermissionDO rolePermissionDO); 14 | void insertRoleOperationsPermission(@Param("rolePermissionDO")RolePermissionDO rolePermissionDO); 15 | void insertRoleResourcesPermission(@Param("rolePermissionDO")RolePermissionDO rolePermissionDO); 16 | void deleteMenusPermissionByRoleId(Long roleId); 17 | void deleteOperationsPermissionByRoleId(Long roleId); 18 | void deleteResourcesPermissionByRoleId(Long roleId); 19 | List selectMenusByRoleId(Long roleId); 20 | void deletePermissionByBatchRoleIds(List ids); 21 | void deleteAccountRoleByBatchRoleIds(List ids); 22 | List getOperations(Long roleId); 23 | List getResources(Long roleId); 24 | } 25 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/infrastructure/mybatis/repository/mapper/StaffMapper.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.infrastructure.mybatis.repository.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.chomolungma.system.staff.infrastructure.dataobject.OrgWithStaffDO; 5 | import com.chomolungma.system.staff.infrastructure.dataobject.PostWithStaffDO; 6 | import com.chomolungma.system.staff.infrastructure.dataobject.StaffDO; 7 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 8 | import org.apache.ibatis.annotations.Mapper; 9 | import org.apache.ibatis.annotations.Param; 10 | 11 | import java.util.List; 12 | @Mapper 13 | public interface StaffMapper extends BaseMapper { 14 | List selectStaffsByCondition(@Param("orgId") Long orgId, @Param("staffDO") StaffDO staffDO); 15 | Boolean noDeleteCount(List ids); 16 | List selectPostWithStaff(List ids); 17 | List selectOrgWithStaff(List ids); 18 | List selectPostByStaffId(Long userId); 19 | List selectOrgByStaffId(Long userId); 20 | void deleteStaffAndPosts(Long pkUserId); 21 | void deleteStaffAndOrgs(Long pkUserId); 22 | void saveStaffAndPosts(@Param("pkUserId") Long pkUserId, @Param("posts") List posts); 23 | void saveStaffAndOrgs(@Param("pkUserId") Long pkUserId, @Param("orgs") List orgs); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/application/service/impl/MenuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.application.service.impl; 2 | 3 | import com.chomolungma.system.menu.application.service.MenuService; 4 | import com.chomolungma.system.menu.domain.entity.MenuEntity; 5 | import com.chomolungma.system.menu.domain.repository.IMenuRepository; 6 | import com.chomolungma.system.menu.interfaces.dto.MenuDTO; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | import java.util.stream.Collectors; 11 | 12 | @Service 13 | public class MenuServiceImpl implements MenuService { 14 | 15 | private final IMenuRepository iMenuRepository; 16 | 17 | public MenuServiceImpl(IMenuRepository iMenuRepository) { 18 | this.iMenuRepository = iMenuRepository; 19 | } 20 | 21 | @Override 22 | public void createMenu(MenuEntity menuEntity) { 23 | iMenuRepository.save(menuEntity); 24 | } 25 | 26 | @Override 27 | public void deleteMenu(Long id) { 28 | iMenuRepository.remove(id); 29 | } 30 | 31 | @Override 32 | public void updateMenu(MenuEntity menuEntity) { 33 | iMenuRepository.save(menuEntity); 34 | } 35 | 36 | @Override 37 | public List permissions(String type) { 38 | List menuDTOS = iMenuRepository.find(type); 39 | return menuDTOS.stream().peek(item -> item.setDisabled(item.getIsHome())).collect(Collectors.toList()); 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/domain/factory/OrgFactory.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.domain.factory; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.org.domain.entity.OrgEntity; 5 | import com.chomolungma.system.org.infrastructure.dataobject.OrgDO; 6 | import com.chomolungma.system.org.infrastructure.mybatis.repository.mapper.OrgMapper; 7 | import com.chomolungma.system.org.interfaces.mapstruct.OrgEntityMapStruct; 8 | import com.chomolungma.system.org.interfaces.param.OrgParam; 9 | import org.springframework.stereotype.Component; 10 | 11 | @Component 12 | public class OrgFactory { 13 | private final OrgMapper orgMapper; 14 | 15 | public OrgFactory(OrgMapper orgMapper){ 16 | this.orgMapper = orgMapper; 17 | } 18 | 19 | public OrgEntity createOrg(OrgParam orgParam){ 20 | if (orgParam.getId() == null) { 21 | OrgDO currentMaxOrg = orgMapper.selectOne(new QueryWrapper().eq("pid",orgParam.getPid()).orderByDesc("code").last("limit 1")); 22 | int num = 1; 23 | if (currentMaxOrg != null) { 24 | num = Integer.parseInt(currentMaxOrg.getCode().substring(currentMaxOrg.getCode().length()-3)) + 1; 25 | } 26 | OrgDO parent = orgMapper.selectById(orgParam.getPid()); 27 | String parentCode = parent == null ? "" : parent.getCode(); 28 | orgParam.setCode(parentCode + String.format("%03d", num)); 29 | } 30 | return OrgEntityMapStruct.INSTANCE.toEntity(orgParam); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/infrastructure/mybatis/repository/mapper/OrgMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | 27 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/domain/mapstruct/AccountEntityMapStruct.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.domain.mapstruct; 2 | 3 | import com.chomolungma.system.account.infrastructure.dataobject.AccountDO; 4 | import com.chomolungma.system.account.infrastructure.dataobject.AccountUserRoleDO; 5 | import com.chomolungma.system.account.interfaces.dto.AccountDTO; 6 | import com.chomolungma.system.account.interfaces.dto.AccountExcelDTO; 7 | import com.chomolungma.system.account.interfaces.dto.AccountInDTO; 8 | import com.chomolungma.system.account.interfaces.dto.AccountPageDTO; 9 | import com.chomolungma.system.account.domain.entity.Account; 10 | import com.github.pagehelper.PageInfo; 11 | import org.mapstruct.Mapper; 12 | import org.mapstruct.Mapping; 13 | import org.mapstruct.Mappings; 14 | import org.mapstruct.factory.Mappers; 15 | 16 | import java.util.List; 17 | 18 | @Mapper 19 | public interface AccountEntityMapStruct { 20 | AccountEntityMapStruct INSTANCE = Mappers.getMapper(AccountEntityMapStruct.class); 21 | @Mappings({ 22 | @Mapping(target = "records", source = "list"), 23 | @Mapping(target = "page", source = "pageNum") 24 | }) 25 | AccountPageDTO toAccountPageDTO(PageInfo accountPage); 26 | @Mappings({ 27 | @Mapping(target = "records", source = "list"), 28 | @Mapping(target = "page", source = "pageNum") 29 | }) 30 | AccountPageDTO toAccountPageDTO2(PageInfo accountPage); 31 | 32 | Account toEntity(AccountInDTO accountInDTO); 33 | 34 | Account toEntity(AccountDTO accountDTO); 35 | 36 | Account toEntity(AccountExcelDTO accountExcelDTO); 37 | 38 | List toExcelDTO(List accountEntities); 39 | 40 | AccountDTO toDTO(Account account); 41 | 42 | AccountDTO toDTO(AccountDO accountDO); 43 | } 44 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/listener/AccountExcelListener.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.account.infrastructure.listener; 2 | 3 | import com.alibaba.excel.context.AnalysisContext; 4 | import com.alibaba.excel.read.listener.ReadListener; 5 | import com.chomolungma.core.service.ExcelService; 6 | import com.chomolungma.system.account.domain.assembler.AccountAssembler; 7 | import com.chomolungma.system.account.interfaces.dto.AccountExcelDTO; 8 | import com.chomolungma.system.account.domain.repository.IAccountRepository; 9 | 10 | import java.io.IOException; 11 | import java.util.ArrayList; 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class AccountExcelListener implements ReadListener { 16 | 17 | private final IAccountRepository iAccountRepository; 18 | 19 | private final ExcelService excelService; 20 | List results = new ArrayList<>(); 21 | public AccountExcelListener(IAccountRepository iAccountRepository, ExcelService excelService) { 22 | this.iAccountRepository = iAccountRepository; 23 | this.excelService = excelService; 24 | } 25 | 26 | @Override 27 | public void invoke(AccountExcelDTO accountExcelDTO, AnalysisContext analysisContext) { 28 | try 29 | { 30 | iAccountRepository.save(AccountAssembler.toEntity(accountExcelDTO)); 31 | results.add(accountExcelDTO); 32 | } catch (Exception ex) { 33 | System.err.println(Arrays.toString(ex.getStackTrace())); 34 | } 35 | 36 | } 37 | 38 | @Override 39 | public void doAfterAllAnalysed(AnalysisContext analysisContext) { 40 | try { 41 | excelService.export(results, AccountExcelDTO.class); 42 | } catch (IOException e) { 43 | throw new RuntimeException(e); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/login/application/service/impl/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.login.application.service.impl; 2 | 3 | import com.chomolungma.core.UserDetail; 4 | import com.chomolungma.core.exception.BusinessRuntimeException; 5 | import com.chomolungma.system.account.domain.entity.Account; 6 | import com.chomolungma.system.account.domain.entity.Role; 7 | import com.chomolungma.system.account.domain.repository.IAccountRepository; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | import java.util.Objects; 15 | import java.util.stream.Collectors; 16 | 17 | @Service 18 | public class SecurityServiceImpl implements UserDetailsService { 19 | private final IAccountRepository iAccountRepository; 20 | 21 | public SecurityServiceImpl(IAccountRepository iAccountRepository) { 22 | this.iAccountRepository = iAccountRepository; 23 | } 24 | 25 | @Override 26 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 27 | // 查询用户是否存在 28 | Account account = iAccountRepository.findAccount(username); 29 | 30 | if(Objects.isNull(account)){ 31 | throw new BusinessRuntimeException("用户名或密码错误"); 32 | } 33 | 34 | List permissions = iAccountRepository.findPermissions(account.getId()); 35 | 36 | List resources = iAccountRepository.findResources(account.getId()); 37 | return new UserDetail(account.getId(), account.getUsername(), account.getPassword(), account.getRoles().stream().map(Role::getId).collect(Collectors.toList()), permissions, resources); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/login/interfaces/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.login.interfaces.controller; 2 | 3 | 4 | import com.chomolungma.auth.login.param.LoginForm; 5 | import com.chomolungma.auth.login.application.service.LoginService; 6 | import com.chomolungma.auth.login.param.ResetPasswordDTO; 7 | import com.chomolungma.core.result.Result; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | @RestController 16 | @RequestMapping("/api/v1") 17 | public class LoginController { 18 | private final LoginService loginService; 19 | 20 | private final HttpServletResponse response; 21 | 22 | public LoginController(LoginService loginService, HttpServletResponse response) { 23 | this.loginService = loginService; 24 | this.response = response; 25 | } 26 | 27 | @PostMapping("/login") 28 | public Result login(@RequestBody LoginForm loginForm){ 29 | String token = loginService.login(loginForm.getUsername(),loginForm.getPassword()); 30 | response.addHeader("Authorization","Bearer " + token); 31 | return Result.success(); 32 | } 33 | 34 | @PostMapping("/resetPassword") 35 | public Result resetPassword(@RequestBody ResetPasswordDTO resetPasswordDTO){ 36 | loginService.resetPassword(resetPasswordDTO.getOldPassword(), resetPasswordDTO.getNewPassword(), resetPasswordDTO.getConfirmPassword()); 37 | return Result.success(); 38 | } 39 | 40 | 41 | @PostMapping("/logout") 42 | public Result logout(){ 43 | response.addHeader("Authorization",null); 44 | return Result.success(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/interfaces/controller/MenuController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.menu.interfaces.controller; 2 | 3 | import com.chomolungma.system.menu.application.service.MenuService; 4 | import com.chomolungma.core.result.Result; 5 | import com.chomolungma.system.menu.domain.repository.IMenuRepository; 6 | import com.chomolungma.system.menu.interfaces.assembler.MenuAssembler; 7 | import com.chomolungma.system.menu.interfaces.param.MenuParam; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | 11 | @RestController 12 | @RequestMapping("/api/v1/menu") 13 | public class MenuController { 14 | private final MenuService menuService; 15 | private final IMenuRepository iMenuRepository; 16 | 17 | public MenuController(MenuService menuService, IMenuRepository iMenuRepository){ 18 | this.iMenuRepository = iMenuRepository; 19 | this.menuService = menuService; 20 | } 21 | 22 | @GetMapping 23 | public Result queryMenu(){ 24 | return Result.success(iMenuRepository.find()); 25 | } 26 | 27 | @GetMapping("/type/{type}") 28 | public Result queryMenuPermissions(@PathVariable("type") String type){ 29 | return Result.success(menuService.permissions(type)); 30 | } 31 | 32 | @PostMapping 33 | public Result createMenu(@RequestBody MenuParam menuParam){ 34 | menuService.createMenu(MenuAssembler.convertParamToEntity(menuParam)); 35 | return Result.success(); 36 | } 37 | 38 | @PutMapping 39 | public Result updateMenu(@RequestBody MenuParam menuParam){ 40 | menuService.updateMenu(MenuAssembler.convertParamToEntity(menuParam)); 41 | return Result.success(); 42 | } 43 | 44 | @DeleteMapping("/{id}") 45 | public Result deleteMenu(@PathVariable("id") Long id){ 46 | menuService.deleteMenu(id); 47 | return Result.success(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/LoginLogRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.mybatis.repository; 2 | 3 | import com.chomolungma.system.log.domain.repository.ILoginLogRepository; 4 | import com.chomolungma.system.log.infrastructure.mybatis.repository.mapper.LoginLogMapper; 5 | import com.chomolungma.system.log.interfaces.assembler.LoginLogAssembler; 6 | import com.chomolungma.system.log.interfaces.dto.LoginLogDTO; 7 | import com.chomolungma.system.log.interfaces.dto.LoginLogPageDTO; 8 | import com.chomolungma.system.log.infrastructure.converter.LoginLogConverter; 9 | import com.chomolungma.system.log.infrastructure.dataobject.LoginLogDO; 10 | import com.github.pagehelper.PageHelper; 11 | import com.github.pagehelper.PageInfo; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Repository; 14 | 15 | import java.util.List; 16 | 17 | @Repository 18 | public class LoginLogRepositoryImpl implements ILoginLogRepository { 19 | @Autowired 20 | private LoginLogMapper loginLogMapper; 21 | @Override 22 | public LoginLogPageDTO find(int current, int size, String user, String client, String os) { 23 | PageHelper.startPage(current, size); 24 | LoginLogDO loginLogDO = new LoginLogDO(); 25 | loginLogDO.setUser(user); 26 | loginLogDO.setClient(client); 27 | loginLogDO.setOs(os); 28 | List list = loginLogMapper.selectList(loginLogDO); 29 | PageInfo pageInfo = new PageInfo<>(list); 30 | return LoginLogAssembler.INSTANCE.toPageDTO(pageInfo); 31 | } 32 | 33 | @Override 34 | public Void save(LoginLogDTO loginLogDTO) { 35 | LoginLogDO loginLogDO = LoginLogConverter.INSTANCE.toDO(loginLogDTO); 36 | loginLogMapper.insert(loginLogDO); 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/infrastructure/mybatis/repository/OrgRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.org.domain.entity.OrgEntity; 5 | import com.chomolungma.system.org.domain.repository.IOrgRepository; 6 | import com.chomolungma.system.org.infrastructure.converter.OrgConverter; 7 | import com.chomolungma.system.org.infrastructure.dataobject.OrgDO; 8 | import com.chomolungma.system.org.infrastructure.mybatis.repository.mapper.OrgMapper; 9 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 10 | import org.springframework.stereotype.Repository; 11 | 12 | import java.util.List; 13 | 14 | @Repository 15 | public class OrgRepositoryImpl implements IOrgRepository { 16 | private final OrgMapper orgMapper; 17 | 18 | public OrgRepositoryImpl(OrgMapper orgMapper) { 19 | this.orgMapper = orgMapper; 20 | } 21 | 22 | @Override 23 | public OrgEntity find(Long id) { 24 | OrgDO orgDo = orgMapper.selectById(id); 25 | return OrgConverter.INSTANCE.toEntity(orgDo); 26 | } 27 | 28 | @Override 29 | public List find(OrgDTO orgDTO) { 30 | List orgDOS = orgMapper.selectVo(OrgConverter.INSTANCE.toDO(orgDTO)); 31 | return OrgConverter.INSTANCE.toEntity(orgDOS); 32 | } 33 | 34 | @Override 35 | public void save(OrgEntity org) { 36 | OrgDO orgDO = OrgConverter.INSTANCE.toDO(org); 37 | if (orgDO.getId() == null) { 38 | orgMapper.insert(orgDO); 39 | }else { 40 | orgMapper.updateById(orgDO); 41 | } 42 | } 43 | 44 | @Override 45 | public void remove(Long id) { 46 | OrgDO orgDO = orgMapper.selectById(id); 47 | orgMapper.delete(new QueryWrapper().likeRight("code", orgDO.getCode())); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/result/Result.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core.result; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | import org.springframework.http.HttpStatus; 5 | 6 | @JsonInclude(value= JsonInclude.Include.NON_NULL) 7 | public class Result { 8 | private String msg; 9 | private int code; 10 | private Object data; 11 | 12 | public Result(String msg, int code, Object data){ 13 | this.msg = msg; 14 | this.code = code; 15 | this.data = data; 16 | } 17 | 18 | public static Result success( ){ 19 | return new Result("操作成功!",HttpStatus.OK.value(),null); 20 | } 21 | public static Result success( Object data){ 22 | return new Result("操作成功!",HttpStatus.OK.value(),data); 23 | } 24 | 25 | public static Result success(String msg, Object data){ 26 | return new Result(msg,HttpStatus.OK.value(),data); 27 | } 28 | 29 | public static Result fail(Object data){ 30 | return new Result("操作失败",HttpStatus.INTERNAL_SERVER_ERROR.value(),data); 31 | } 32 | 33 | public static Result fail(String msg, Object data){ 34 | return new Result(msg,HttpStatus.INTERNAL_SERVER_ERROR.value(),data); 35 | } 36 | 37 | public static Result fail(String msg, HttpStatus status, Object data){ 38 | return new Result(msg,status.value(),data); 39 | } 40 | 41 | public static Result fail(String msg, HttpStatus status){ 42 | return new Result(msg,status.value(),null); 43 | } 44 | 45 | public String getMsg() { 46 | return msg; 47 | } 48 | 49 | public void setMsg(String msg) { 50 | this.msg = msg; 51 | } 52 | 53 | public int getCode() { 54 | return code; 55 | } 56 | 57 | public void setCode(int code) { 58 | this.code = code; 59 | } 60 | 61 | public Object getData() { 62 | return data; 63 | } 64 | 65 | public void setData(Object data) { 66 | this.data = data; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/infrastructure/mybatis/repository/OperateLogRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.infrastructure.mybatis.repository; 2 | 3 | import com.chomolungma.system.log.domain.repository.IOperateLogRepository; 4 | import com.chomolungma.system.log.infrastructure.mybatis.repository.mapper.OperateLogMapper; 5 | import com.chomolungma.system.log.interfaces.assembler.OperateLogAssembler; 6 | import com.chomolungma.system.log.interfaces.dto.OperateLogDTO; 7 | import com.chomolungma.system.log.interfaces.dto.OperateLogPageDTO; 8 | import com.chomolungma.system.log.infrastructure.converter.OperateLogConverter; 9 | import com.chomolungma.system.log.infrastructure.dataobject.OperateLogDO; 10 | import com.github.pagehelper.PageHelper; 11 | import com.github.pagehelper.PageInfo; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Repository; 14 | 15 | import java.util.List; 16 | 17 | @Repository 18 | public class OperateLogRepositoryImpl implements IOperateLogRepository { 19 | @Autowired 20 | private OperateLogMapper operateLogMapper; 21 | @Override 22 | public OperateLogPageDTO find(int current, int size, String user, String requestMethod, String resourceName) { 23 | PageHelper.startPage(current, size); 24 | OperateLogDO operateLogDO = new OperateLogDO(); 25 | operateLogDO.setUser(user); 26 | operateLogDO.setRequestMethod(requestMethod); 27 | operateLogDO.setResourceName(resourceName); 28 | List list = operateLogMapper.selectList(operateLogDO); 29 | PageInfo pageInfo = new PageInfo<>(list); 30 | return OperateLogAssembler.INSTANCE.toPageDTO(pageInfo); 31 | } 32 | 33 | @Override 34 | public Void save(OperateLogDTO operateLogDTO) { 35 | OperateLogDO operateLogDO = OperateLogConverter.INSTANCE.toDO(operateLogDTO); 36 | operateLogMapper.insert(operateLogDO); 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/role/application/service/impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.role.application.service.impl; 2 | 3 | import com.chomolungma.system.role.application.service.RoleService; 4 | import com.chomolungma.system.role.domain.enity.RoleEntity; 5 | import com.chomolungma.system.role.domain.repository.IRoleRepository; 6 | import com.chomolungma.system.role.interfaces.dto.RolePermissionDTO; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class RoleServiceImpl implements RoleService { 13 | 14 | public final IRoleRepository iRoleRepository; 15 | 16 | public RoleServiceImpl(IRoleRepository iRoleRepository) { 17 | this.iRoleRepository = iRoleRepository; 18 | } 19 | 20 | 21 | @Override 22 | public void createRole(RoleEntity roleEntity) { 23 | iRoleRepository.save(roleEntity); 24 | } 25 | 26 | @Override 27 | public void updateRole(RoleEntity roleEntity) { 28 | iRoleRepository.save(roleEntity); 29 | } 30 | 31 | @Override 32 | public void authorizedMenus(Long roleId, List permissions) { 33 | iRoleRepository.saveMenus(roleId, permissions); 34 | } 35 | 36 | @Override 37 | public void authorizedOperations(Long roleId, List permissions) { 38 | iRoleRepository.saveOperations(roleId, permissions); 39 | } 40 | 41 | @Override 42 | public void authorizedResources(Long roleId, List permissions) { 43 | iRoleRepository.saveResources(roleId, permissions); 44 | } 45 | 46 | @Override 47 | public List menus(Long roleId) { 48 | return iRoleRepository.findMenus(roleId); 49 | } 50 | 51 | @Override 52 | public List operations(Long roleId) { 53 | return iRoleRepository.findOperation(roleId); 54 | } 55 | 56 | @Override 57 | public List resources(Long roleId) { 58 | return iRoleRepository.findResources(roleId); 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/staff/interfaces/assembler/StaffAssembler.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.staff.interfaces.assembler; 2 | 3 | 4 | import com.chomolungma.system.staff.domain.entity.Org; 5 | import com.chomolungma.system.staff.domain.entity.Post; 6 | import com.chomolungma.system.staff.interfaces.dto.StaffSearchDTO; 7 | import com.chomolungma.system.staff.interfaces.mapstruct.StaffEntityMapStruct; 8 | import com.chomolungma.system.staff.domain.entity.Staff; 9 | import com.chomolungma.system.staff.interfaces.dto.PageStaffDTO; 10 | import com.chomolungma.system.staff.interfaces.dto.StaffDTO; 11 | import com.chomolungma.system.staff.interfaces.dto.StaffFormDTO; 12 | import com.github.pagehelper.PageInfo; 13 | 14 | import java.util.List; 15 | import java.util.stream.Collectors; 16 | 17 | 18 | public class StaffAssembler { 19 | 20 | public static PageStaffDTO toPageUserDTO(PageInfo userOrgDOPageInfo){ 21 | return StaffEntityMapStruct.INSTANCE.toPageUserDTO(userOrgDOPageInfo); 22 | } 23 | 24 | public static Staff toEntity(StaffFormDTO staffFormDTO){ 25 | return StaffEntityMapStruct.INSTANCE.toEntity(staffFormDTO); 26 | } 27 | 28 | public static Staff toEntity(StaffSearchDTO staffSearchDTO){ 29 | return StaffEntityMapStruct.INSTANCE.toEntity(staffSearchDTO); 30 | } 31 | 32 | public static StaffDTO toDTO(Staff staff){ 33 | StaffDTO staffDTO = StaffEntityMapStruct.INSTANCE.toDTO(staff); 34 | List orgIds = staff.getOrgs().stream().map(Org::getId).collect(Collectors.toList()); 35 | staffDTO.setOrgIds(orgIds); 36 | String orgNames = staff.getOrgs().stream().map(Org::getName).collect(Collectors.joining(",")); 37 | staffDTO.setOrgNames(orgNames); 38 | 39 | List postIds = staff.getPosts().stream().map(Post::getId).collect(Collectors.toList()); 40 | staffDTO.setPostIds(postIds); 41 | String postNames = staff.getPosts().stream().map(Post::getName).collect(Collectors.joining(",")); 42 | staffDTO.setPostNames(postNames); 43 | return staffDTO; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/interfaces/controller/PostController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.interfaces.controller; 2 | 3 | 4 | import com.chomolungma.system.post.interfaces.mapstruct.PostEntityMapStruct; 5 | import com.chomolungma.core.dto.PageDTO; 6 | import com.chomolungma.core.result.Result; 7 | import com.chomolungma.system.post.domain.repository.IPostRepository; 8 | import com.chomolungma.system.post.interfaces.param.PostParam; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.Arrays; 12 | 13 | @RestController 14 | @RequestMapping("/api/v1/post") 15 | public class PostController { 16 | private final IPostRepository iPostRepository; 17 | 18 | public PostController(IPostRepository iPostRepository) { 19 | this.iPostRepository = iPostRepository; 20 | } 21 | 22 | @GetMapping 23 | public Result pageList(PageDTO pageDTO, @RequestParam(required = false) String name, @RequestParam(required = false) String code){ 24 | return Result.success(iPostRepository.find(pageDTO.getPage(), pageDTO.getLimit(), name, code)); 25 | } 26 | @GetMapping("/all") 27 | public Result list(){ 28 | return Result.success(PostEntityMapStruct.INSTANCE.toDTO(iPostRepository.findAll())); 29 | } 30 | @PostMapping 31 | public Result createPost(@RequestBody PostParam postParam){ 32 | iPostRepository.save(PostEntityMapStruct.INSTANCE.toEntity(postParam)); 33 | return Result.success(); 34 | } 35 | 36 | @GetMapping("/{id}") 37 | public Result getPost(@PathVariable("id") Long id){ 38 | return Result.success(PostEntityMapStruct.INSTANCE.toDTO(iPostRepository.find(id))); 39 | } 40 | 41 | @PutMapping 42 | public Result updatePost(@RequestBody PostParam postParam){ 43 | iPostRepository.save(PostEntityMapStruct.INSTANCE.toEntity(postParam)); 44 | return Result.success(); 45 | } 46 | 47 | @DeleteMapping("/{ids}") 48 | public Result deletePosts(@PathVariable("ids") String ids){ 49 | iPostRepository.remove(Arrays.asList(ids.split(","))); 50 | return Result.success(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/menu/infrastructure/mybatis/repository/mapper/MenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | delete from sys_menu where id in ( 20 | select id from ( 21 | select t1.id, 22 | if(find_in_set(pid, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild 23 | from ( select id,pid from sys_menu t order by pid, id ) t1, 24 | (select @pids := #{id,jdbcType=BIGINT} ) t2 25 | ) t3 where ischild != 0 or id = #{id,jdbcType=BIGINT} 26 | ) 27 | 28 | 29 | 30 | delete from sys_role_menu where menu_id in (select id from ( 31 | select t1.id, 32 | if(find_in_set(pid, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild 33 | from ( select id,pid from sys_menu t order by pid, id ) t1, 34 | (select @pids := #{id,jdbcType=BIGINT} ) t2 35 | ) t3 where ischild != 0 or id = #{id,jdbcType=BIGINT}) 36 | 37 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/org/interfaces/controller/OrgController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.org.interfaces.controller; 2 | 3 | import com.chomolungma.core.result.Result; 4 | import com.chomolungma.system.org.domain.entity.OrgEntity; 5 | import com.chomolungma.system.org.domain.repository.IOrgRepository; 6 | import com.chomolungma.system.org.interfaces.assembler.OrgAssembler; 7 | import com.chomolungma.system.org.interfaces.dto.OrgDTO; 8 | import com.chomolungma.system.org.interfaces.param.OrgParam; 9 | import com.chomolungma.system.org.application.service.OrgService; 10 | import com.chomolungma.system.staff.application.service.StaffService; 11 | import org.springframework.web.bind.annotation.*; 12 | import java.util.List; 13 | 14 | 15 | @RestController 16 | @RequestMapping("/api/v1/org") 17 | public class OrgController { 18 | 19 | private final OrgService orgService; 20 | 21 | private final StaffService staffService; 22 | 23 | private final IOrgRepository iOrgRepository; 24 | 25 | public OrgController(OrgService orgService, StaffService staffService, IOrgRepository iOrgRepository){ 26 | this.orgService = orgService; 27 | this.staffService = staffService; 28 | this.iOrgRepository = iOrgRepository; 29 | } 30 | 31 | @GetMapping 32 | public Result queryOrg(OrgDTO orgDTO){ 33 | List orgList = iOrgRepository.find(orgDTO); 34 | return Result.success(OrgAssembler.toDTO(orgList)); 35 | } 36 | 37 | 38 | @GetMapping("/{id}") 39 | public Result getOrg(@PathVariable("id") Long id){ 40 | return Result.success(OrgAssembler.toDTO(iOrgRepository.find(id))); 41 | } 42 | 43 | @PostMapping 44 | public Result createOrg(@RequestBody OrgParam orgParam){ 45 | orgService.createOrg(orgParam); 46 | return Result.success(); 47 | } 48 | 49 | @PutMapping 50 | public Result updateOrg(@RequestBody OrgParam orgParam){ 51 | orgService.updateOrg(orgParam); 52 | return Result.success(); 53 | } 54 | 55 | @DeleteMapping("/{id}") 56 | public Result deleteOrg(@PathVariable("id") Long id){ 57 | iOrgRepository.remove(id); 58 | return Result.success(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/application/service/OperateLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.application.service; 2 | 3 | import com.chomolungma.core.CurrentProfileHolder; 4 | import com.chomolungma.core.UserDetail; 5 | import com.chomolungma.system.log.domain.repository.IOperateLogRepository; 6 | import com.chomolungma.system.log.interfaces.dto.OperateLogDTO; 7 | import org.apache.ibatis.logging.Log; 8 | import org.apache.ibatis.logging.LogFactory; 9 | import org.springframework.stereotype.Service; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import java.io.BufferedReader; 13 | import java.io.IOException; 14 | 15 | @Service 16 | public class OperateLogServiceImpl implements OperateLogService{ 17 | Log logger = LogFactory.getLog(OperateLogServiceImpl.class); 18 | private final IOperateLogRepository iOperateLogRepository; 19 | 20 | private final HttpServletRequest request; 21 | 22 | public OperateLogServiceImpl(IOperateLogRepository iOperateLogRepository, HttpServletRequest request) { 23 | this.iOperateLogRepository = iOperateLogRepository; 24 | this.request = request; 25 | } 26 | 27 | @Override 28 | public Void generateOperateLog() throws IOException { 29 | UserDetail accountDTO = CurrentProfileHolder.getProfile(); 30 | OperateLogDTO operateLogDTO = new OperateLogDTO(); 31 | operateLogDTO.setUser(accountDTO.getUsername()); 32 | operateLogDTO.setUrl(request.getRequestURL().substring(0, request.getRequestURL().length()- request.getRequestURI().length())); 33 | operateLogDTO.setResourceName(request.getRequestURI()); 34 | operateLogDTO.setPathPayload(request.getQueryString()); 35 | if (!request.getRequestURI().contains("/import")){ 36 | operateLogDTO.setPayload(charReader(request)); 37 | } 38 | operateLogDTO.setRequestMethod(request.getMethod()); 39 | iOperateLogRepository.save(operateLogDTO); 40 | return null; 41 | } 42 | 43 | private String charReader(HttpServletRequest request) throws IOException { 44 | BufferedReader br = request.getReader(); 45 | String str, wholeStr = ""; 46 | while ((str = br.readLine()) != null) { 47 | wholeStr += str; 48 | } 49 | return wholeStr; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cdp-common/src/main/java/com/chomolungma/common/utils/IpUtils.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.common.utils; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import java.net.InetAddress; 5 | import java.net.UnknownHostException; 6 | 7 | public class IpUtils { 8 | private static final String UNKNOWN = "unknown"; 9 | private static final String LOCALHOST_IP = "127.0.0.1"; 10 | // 客户端与服务器同为一台机器,获取的 ip 有时候是 ipv6 格式 11 | private static final String LOCALHOST_IPV6 = "0:0:0:0:0:0:0:1"; 12 | private static final String SEPARATOR = ","; 13 | 14 | // 根据 HttpServletRequest 获取 IP 15 | public static String getIpAddress(HttpServletRequest request) { 16 | if (request == null) { 17 | return "unknown"; 18 | } 19 | String ip = request.getHeader("x-forwarded-for"); 20 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 21 | ip = request.getHeader("Proxy-Client-IP"); 22 | } 23 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 24 | ip = request.getHeader("X-Forwarded-For"); 25 | } 26 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 27 | ip = request.getHeader("WL-Proxy-Client-IP"); 28 | } 29 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 30 | ip = request.getHeader("X-Real-IP"); 31 | } 32 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { 33 | ip = request.getRemoteAddr(); 34 | if (LOCALHOST_IP.equalsIgnoreCase(ip) || LOCALHOST_IPV6.equalsIgnoreCase(ip)) { 35 | // 根据网卡取本机配置的 IP 36 | InetAddress iNet = null; 37 | try { 38 | iNet = InetAddress.getLocalHost(); 39 | } catch (UnknownHostException e) { 40 | e.printStackTrace(); 41 | } 42 | if (iNet != null) 43 | ip = iNet.getHostAddress(); 44 | } 45 | } 46 | // 对于通过多个代理的情况,分割出第一个 IP 47 | if (ip != null && ip.length() > 15) { 48 | if (ip.indexOf(SEPARATOR) > 0) { 49 | ip = ip.substring(0, ip.indexOf(SEPARATOR)); 50 | } 51 | } 52 | return LOCALHOST_IPV6.equals(ip) ? LOCALHOST_IP : ip; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/log/application/service/LoginLogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.log.application.service; 2 | 3 | 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.chomolungma.core.CurrentProfileHolder; 6 | import com.chomolungma.core.UserDetail; 7 | import com.chomolungma.system.log.domain.repository.ILoginLogRepository; 8 | import com.chomolungma.system.log.interfaces.dto.LoginLogDTO; 9 | 10 | import com.chomolungma.common.utils.AddressUtils; 11 | import com.chomolungma.common.utils.IpUtils; 12 | import eu.bitwalker.useragentutils.Browser; 13 | import eu.bitwalker.useragentutils.OperatingSystem; 14 | import eu.bitwalker.useragentutils.UserAgent; 15 | import org.apache.ibatis.logging.Log; 16 | import org.apache.ibatis.logging.LogFactory; 17 | import org.springframework.stereotype.Service; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | 21 | @Service 22 | public class LoginLogServiceImpl implements LoginLogService{ 23 | Log logger = LogFactory.getLog(LoginLogServiceImpl.class); 24 | private final ILoginLogRepository iLoginLogRepository; 25 | 26 | private final HttpServletRequest request; 27 | 28 | public LoginLogServiceImpl(ILoginLogRepository iLoginLogRepository, HttpServletRequest request) { 29 | this.iLoginLogRepository = iLoginLogRepository; 30 | this.request = request; 31 | } 32 | 33 | @Override 34 | public Void generateLoginLog() { 35 | String agent = request.getHeader("User-Agent"); 36 | UserAgent userAgent = UserAgent.parseUserAgentString(agent); 37 | Browser browser = userAgent.getBrowser(); 38 | OperatingSystem operatingSystem = userAgent.getOperatingSystem(); 39 | 40 | UserDetail accountDTO = CurrentProfileHolder.getProfile(); 41 | String ip = IpUtils.getIpAddress(request); 42 | LoginLogDTO loginLogDTO = new LoginLogDTO(); 43 | loginLogDTO.setUser(accountDTO.getUsername()); 44 | loginLogDTO.setIp(ip); 45 | loginLogDTO.setClient(browser.getName()); 46 | loginLogDTO.setOs(operatingSystem.getName()); 47 | JSONObject address = AddressUtils.getCity(ip); 48 | logger.debug("=============" + address.get("region")+ ":" + address.get("city")); 49 | loginLogDTO.setAddress(address.get("region")+ " " + address.get("city")); 50 | iLoginLogRepository.save(loginLogDTO); 51 | return null; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /cdp-core/src/main/java/com/chomolungma/core/UserDetail.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.core; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import org.springframework.security.core.GrantedAuthority; 7 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | 10 | import java.util.Collection; 11 | import java.util.List; 12 | import java.util.stream.Collectors; 13 | 14 | @Data 15 | @NoArgsConstructor 16 | public class UserDetail implements UserDetails { 17 | 18 | private Long accountId; 19 | 20 | private String username; 21 | 22 | private String password; 23 | 24 | private List roleIds; 25 | 26 | private List permissions; 27 | 28 | private List resources; 29 | 30 | //存储SpringSecurity所需要的权限信息的集合 31 | @JSONField(serialize = false) 32 | private List authorities; 33 | 34 | public UserDetail(Long accountId, String username, String password, List roleIds, List permissions, List resources) { 35 | this.accountId = accountId; 36 | this.username = username; 37 | this.password = password; 38 | this.permissions = permissions; 39 | this.resources = resources; 40 | this.roleIds = roleIds; 41 | } 42 | @Override 43 | public Collection getAuthorities() { 44 | if(authorities!=null){ 45 | return authorities; 46 | } 47 | //把resources中字符串类型的权限信息转换成GrantedAuthority对象存入authorities中 48 | authorities = resources.stream(). 49 | map(SimpleGrantedAuthority::new) 50 | .collect(Collectors.toList()); 51 | return authorities; 52 | } 53 | 54 | @Override 55 | public String getPassword() { 56 | return this.password; 57 | } 58 | 59 | @Override 60 | public String getUsername() { 61 | return this.username; 62 | } 63 | 64 | @Override 65 | public boolean isAccountNonExpired() { 66 | return true; 67 | } 68 | 69 | @Override 70 | public boolean isAccountNonLocked() { 71 | return true; 72 | } 73 | 74 | @Override 75 | public boolean isCredentialsNonExpired() { 76 | return true; 77 | } 78 | 79 | @Override 80 | public boolean isEnabled() { 81 | return true; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/post/infrastructure/mybatis/repository/PostRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.post.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.post.infrastructure.dataobject.PostDO; 5 | import com.chomolungma.system.post.domain.entity.PostEntity; 6 | import com.chomolungma.system.post.domain.repository.IPostRepository; 7 | import com.chomolungma.system.post.infrastructure.converter.PostConverter; 8 | import com.chomolungma.system.post.infrastructure.mybatis.repository.mapper.PostMapper; 9 | import com.chomolungma.system.post.interfaces.dto.PostPageDTO; 10 | import com.github.pagehelper.PageHelper; 11 | import com.github.pagehelper.PageInfo; 12 | import org.springframework.stereotype.Repository; 13 | import org.springframework.util.StringUtils; 14 | 15 | import java.util.List; 16 | 17 | @Repository 18 | public class PostRepositoryImpl implements IPostRepository { 19 | 20 | private final PostMapper postMapper; 21 | 22 | public PostRepositoryImpl(PostMapper postMapper) { 23 | this.postMapper = postMapper; 24 | } 25 | 26 | @Override 27 | public Void save(PostEntity postEntity) { 28 | PostDO postDO = PostConverter.INSTANCE.toDO(postEntity); 29 | if (StringUtils.isEmpty(postDO.getId())){ 30 | postMapper.insert(postDO); 31 | }else{ 32 | postMapper.updateById(postDO); 33 | } 34 | return null; 35 | } 36 | @Override 37 | public PostPageDTO find(int current, int size, String name, String code) { 38 | PageHelper.startPage(current, size); 39 | List postDOS = postMapper.selectList(new QueryWrapper().like(name !=null, "name", name).like(code != null, "code", code)); 40 | PageInfo pageInfo = new PageInfo<>(postDOS); 41 | return PostConverter.INSTANCE.toDTO(pageInfo); 42 | } 43 | 44 | @Override 45 | public List findAll() { 46 | List postDOS = postMapper.selectList(new QueryWrapper<>()); 47 | return PostConverter.INSTANCE.toEntity(postDOS); 48 | } 49 | 50 | @Override 51 | public PostEntity find(Long id) { 52 | return PostConverter.INSTANCE.toEntity(postMapper.selectById(id)); 53 | } 54 | 55 | @Override 56 | public Void remove(List ids) { 57 | postMapper.deleteBatchIds(ids); 58 | return null; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /cdp-auth/src/main/java/com/chomolungma/auth/filter/AuthenticationTokenFilter.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.auth.filter; 2 | 3 | import com.chomolungma.core.CurrentProfileHolder; 4 | import com.chomolungma.core.UserDetail; 5 | import com.chomolungma.common.utils.TokenUtils; 6 | import com.github.benmanes.caffeine.cache.Cache; 7 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.util.StringUtils; 11 | import org.springframework.web.filter.OncePerRequestFilter; 12 | 13 | import javax.servlet.FilterChain; 14 | import javax.servlet.ServletException; 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.io.IOException; 18 | 19 | @Component 20 | public class AuthenticationTokenFilter extends OncePerRequestFilter { 21 | 22 | private final Cache caffeineCache; 23 | 24 | public AuthenticationTokenFilter(Cache caffeineCache) { 25 | this.caffeineCache = caffeineCache; 26 | } 27 | 28 | @Override 29 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { 30 | String bearerToken = request.getHeader("Authorization"); 31 | if (!StringUtils.hasText(bearerToken)){ 32 | filterChain.doFilter(request, response); 33 | return; 34 | } 35 | 36 | String[] tokenArray = bearerToken.split(" "); 37 | Long accountId = TokenUtils.decode(tokenArray[1]); 38 | caffeineCache.getIfPresent("accountId_" + accountId); 39 | UserDetail userDetail = (UserDetail) caffeineCache.asMap().get("accountId_" + accountId); 40 | 41 | UsernamePasswordAuthenticationToken authenticationToken = 42 | new UsernamePasswordAuthenticationToken(userDetail,null,userDetail.getAuthorities()); 43 | SecurityContextHolder.getContext().setAuthentication(authenticationToken); 44 | // AccountDTO accountDTO = AccountAssembler.toDTO(userDetail.getAccount()); 45 | // accountDTO.setPermissions(userDetail.getPermissions()); 46 | // accountDTO.setResources(userDetail.getResources()); 47 | CurrentProfileHolder.setContext(userDetail); 48 | //放行 49 | filterChain.doFilter(request, response); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/operation/infrastructure/mybatis/repository/OperationRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.operation.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.operation.domain.entity.Operation; 5 | import com.chomolungma.system.operation.domain.repository.IOperationRepository; 6 | import com.chomolungma.system.operation.infrastructure.converter.OperationConverter; 7 | import com.chomolungma.system.operation.infrastructure.dataobject.OperationDO; 8 | import com.chomolungma.system.operation.infrastructure.mybatis.repository.mapper.OperationMapper; 9 | import com.github.pagehelper.PageHelper; 10 | import com.github.pagehelper.PageInfo; 11 | import org.springframework.stereotype.Repository; 12 | import org.springframework.util.StringUtils; 13 | import java.util.List; 14 | 15 | /** 16 | * Automatically generated code by CDP-GENERATOR maven-plugin. 17 | * Thank you for your use. 18 | * Good Luck! 19 | */ 20 | 21 | 22 | @Repository 23 | public class OperationRepositoryImpl implements IOperationRepository { 24 | 25 | private final OperationMapper operationMapper; 26 | 27 | public OperationRepositoryImpl(OperationMapper operationMapper){ 28 | this.operationMapper = operationMapper; 29 | } 30 | @Override 31 | public void save(Operation operation) { 32 | OperationDO operationDO = OperationConverter.INSTANCE.toDO(operation); 33 | if (StringUtils.isEmpty(operationDO.getId())){ 34 | operationMapper.insert(operationDO); 35 | }else{ 36 | operationMapper.updateById(operationDO); 37 | } 38 | } 39 | 40 | @Override 41 | public void remove(List ids) { 42 | 43 | operationMapper.deleteBatchIds(ids); 44 | 45 | } 46 | 47 | @Override 48 | public Operation find(Long id) { 49 | 50 | return OperationConverter.INSTANCE.toEntity(operationMapper.selectById(id)); 51 | 52 | } 53 | 54 | @Override 55 | public PageInfo findPageList(Operation operation, int current, int size) { 56 | 57 | OperationDO operationDO = OperationConverter.INSTANCE.toDO(operation); 58 | 59 | PageHelper.startPage(current, size); 60 | 61 | List operations = operationMapper.selectLists(operationDO); 62 | 63 | PageInfo pageInfo = new PageInfo<>(operations); 64 | 65 | return pageInfo; 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/interfaces/controller/ResourceController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.interfaces.controller; 2 | 3 | import com.chomolungma.core.dto.PageDTO; 4 | import com.chomolungma.core.result.Result; 5 | import com.chomolungma.system.resource.application.ResourceService; 6 | import com.chomolungma.system.resource.domain.repository.IResourceRepository; 7 | import com.chomolungma.system.resource.interfaces.assembler.ResourceAssembler; 8 | import com.chomolungma.system.resource.interfaces.param.ResourceParam; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.Arrays; 12 | 13 | @RestController 14 | @RequestMapping("/api/v1/resource") 15 | public class ResourceController { 16 | 17 | private IResourceRepository iResourceRepository; 18 | 19 | private ResourceService resourceService; 20 | 21 | public ResourceController(IResourceRepository iResourceRepository, ResourceService resourceService){ 22 | this.iResourceRepository = iResourceRepository; 23 | this.resourceService = resourceService; 24 | } 25 | @GetMapping 26 | public Result pageList(PageDTO pageDTO, 27 | @RequestParam(required = false) String name, 28 | @RequestParam(required = false) String sign, 29 | @RequestParam(required = false) String url, 30 | @RequestParam(required = false) String method 31 | ){ 32 | return Result.success(iResourceRepository.find(pageDTO.getPage(), pageDTO.getLimit(), name, sign, url, method)); 33 | } 34 | 35 | @GetMapping("/{id}") 36 | public Result getResource(@PathVariable Long id){ 37 | return Result.success(ResourceAssembler.toDTO(iResourceRepository.find(id))); 38 | } 39 | 40 | @PostMapping 41 | public Result create(@RequestBody ResourceParam resourceParam){ 42 | resourceService.create(ResourceAssembler.toEntity(resourceParam)); 43 | return Result.success(); 44 | } 45 | 46 | @PutMapping 47 | public Result update(@RequestBody ResourceParam resourceParam){ 48 | resourceService.modify(ResourceAssembler.toEntity(resourceParam)); 49 | return Result.success(); 50 | } 51 | 52 | @DeleteMapping("/{ids}") 53 | public Result deleteResources(@PathVariable String ids){ 54 | iResourceRepository.remove(Arrays.asList(ids.split(","))); 55 | return Result.success(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/resource/infrastructure/mybatis/repository/ResourceRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.resource.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.resource.infrastructure.converter.ResourceConverter; 5 | import com.chomolungma.system.resource.infrastructure.dataobject.ResourceDO; 6 | import com.chomolungma.system.resource.domain.entity.ResourceEntity; 7 | import com.chomolungma.system.resource.domain.repository.IResourceRepository; 8 | import com.chomolungma.system.resource.infrastructure.mybatis.repository.mapper.ResourceMapper; 9 | import com.chomolungma.system.resource.interfaces.dto.ResourcePageDTO; 10 | import com.github.pagehelper.PageHelper; 11 | import com.github.pagehelper.PageInfo; 12 | import org.springframework.stereotype.Repository; 13 | 14 | import java.util.List; 15 | 16 | @Repository 17 | public class ResourceRepositoryImpl implements IResourceRepository { 18 | private ResourceMapper resourceMapper; 19 | 20 | public ResourceRepositoryImpl(ResourceMapper resourceMapper){ 21 | this.resourceMapper = resourceMapper; 22 | } 23 | 24 | @Override 25 | public void save(ResourceEntity resourceEntity) { 26 | ResourceDO resourceDO = ResourceConverter.INSTANCE.toDO(resourceEntity); 27 | if (resourceDO.getId() == null) { 28 | resourceMapper.insert(resourceDO); 29 | } else { 30 | resourceMapper.updateById(resourceDO); 31 | } 32 | } 33 | 34 | @Override 35 | public ResourcePageDTO find(int current, int size, String name, String sign, String url, String method) { 36 | PageHelper.startPage(current, size); 37 | ResourceDO resourceDO = new ResourceDO(); 38 | resourceDO.setName(name); 39 | resourceDO.setSign(sign); 40 | resourceDO.setUrl(url); 41 | resourceDO.setMethod(method); 42 | List resourceDOS = resourceMapper.selectList(resourceDO); 43 | PageInfo pageInfo = new PageInfo<>(resourceDOS); 44 | return ResourceConverter.INSTANCE.toDTO(pageInfo); 45 | } 46 | 47 | @Override 48 | public ResourceEntity find(Long id) { 49 | ResourceDO resourceDO = resourceMapper.selectById(id); 50 | return ResourceConverter.INSTANCE.toEntity(resourceDO); 51 | } 52 | 53 | @Override 54 | public void remove(List ids) { 55 | resourceMapper.deleteBatchIds(ids); 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/account/infrastructure/mybatis/repository/mapper/AccountMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | 37 | 38 | 39 | 55 | 56 | 57 | 58 | update sys_account set deleted = 1 59 | 60 | id in 61 | 62 | #{item, jdbcType=BIGINT} 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/interfaces/controller/DictController.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.interfaces.controller; 2 | 3 | 4 | import com.chomolungma.system.dict.application.service.DictService; 5 | import com.chomolungma.core.dto.PageDTO; 6 | import com.chomolungma.core.result.Result; 7 | import com.chomolungma.system.dict.domain.entity.DictEntity; 8 | import com.chomolungma.system.dict.domain.repository.IDictRepository; 9 | import com.chomolungma.system.dict.interfaces.assembler.DictAssembler; 10 | import com.chomolungma.system.dict.interfaces.param.DictParam; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.Arrays; 14 | import java.util.stream.Collectors; 15 | 16 | @RestController 17 | @RequestMapping("/api/v1/dict") 18 | public class DictController{ 19 | 20 | 21 | private final DictService dictService; 22 | 23 | private final IDictRepository iDictRepository; 24 | 25 | public DictController(DictService dictService, IDictRepository iDictRepository){ 26 | this.dictService = dictService; 27 | this.iDictRepository = iDictRepository; 28 | } 29 | 30 | @GetMapping 31 | public Result pageList(PageDTO pageDTO, @RequestParam(required = false) String param){ 32 | return Result.success(iDictRepository.find(pageDTO.getPage(), pageDTO.getLimit(), param)); 33 | } 34 | 35 | @GetMapping("/{id}") 36 | //@PreAuthorize("hasAuthority('system:dict:get')") 37 | public Result info(@PathVariable("id") Long id){ 38 | return Result.success(DictAssembler.toDTO(iDictRepository.find(id))); 39 | } 40 | 41 | @PostMapping 42 | //@PreAuthorize("hasAuthority('system:dict:add')") 43 | public Result createDict(@RequestBody DictParam dictParam){ 44 | dictService.createDict(DictAssembler.covertToEntity(dictParam)); 45 | return Result.success(); 46 | } 47 | 48 | @PutMapping("/{id}") 49 | //@PreAuthorize("hasAuthority('system:dict:edit')") 50 | public Result updateDict(@PathVariable("id") Long id, @RequestBody DictParam dictParam){ 51 | DictEntity dictEntity = DictAssembler.covertToEntity(dictParam); 52 | dictEntity.setId(id); 53 | return Result.success(dictService.updateDict(dictEntity)); 54 | } 55 | 56 | @DeleteMapping("/{ids}") 57 | //@PreAuthorize("hasAuthority('system:dict:delete')") 58 | public Result deleteDict(@PathVariable String ids){ 59 | iDictRepository.remove(Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList())); 60 | return Result.success(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/mybatis/repository/DictRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.chomolungma.system.dict.infrastructure.converter.DictConverter; 5 | import com.chomolungma.system.dict.infrastructure.dataobject.DictDO; 6 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 7 | import com.chomolungma.system.dict.infrastructure.mybatis.repository.mapper.DictItemMapper; 8 | import com.chomolungma.system.dict.domain.entity.DictEntity; 9 | import com.chomolungma.system.dict.domain.repository.IDictRepository; 10 | import com.chomolungma.system.dict.infrastructure.mybatis.repository.mapper.DictMapper; 11 | import com.chomolungma.system.dict.interfaces.assembler.DictAssembler; 12 | import com.chomolungma.system.dict.interfaces.dto.DictPageDTO; 13 | import com.github.pagehelper.PageHelper; 14 | import com.github.pagehelper.PageInfo; 15 | import org.springframework.stereotype.Repository; 16 | import org.springframework.transaction.annotation.Transactional; 17 | 18 | import java.util.List; 19 | 20 | @Repository 21 | public class DictRepositoryImpl implements IDictRepository { 22 | private final DictMapper dictMapper; 23 | 24 | private final DictItemMapper dictItemMapper; 25 | 26 | public DictRepositoryImpl(DictMapper dictMapper, DictItemMapper dictItemMapper) { 27 | this.dictMapper = dictMapper; 28 | this.dictItemMapper = dictItemMapper; 29 | } 30 | 31 | @Override 32 | public DictPageDTO find(int current, int size, String param) { 33 | PageHelper.startPage(current, size); 34 | List dictDOS = dictMapper.selectList(new QueryWrapper().like(param != null, "name", param).or().like(param != null, "code", param)); 35 | PageInfo pageInfo = new PageInfo<>(dictDOS); 36 | return DictAssembler.toDTO(pageInfo); 37 | } 38 | 39 | @Override 40 | public DictEntity find(Long id) { 41 | return DictConverter.INSTANCE.toEntity(dictMapper.selectById(id)); 42 | } 43 | 44 | @Override 45 | public void save(DictEntity dictEntity) { 46 | DictDO dictDO = DictConverter.INSTANCE.toDO(dictEntity); 47 | if (dictDO.getId() == null){ 48 | dictMapper.insert(dictDO); 49 | }else{ 50 | dictMapper.updateById(dictDO); 51 | } 52 | } 53 | 54 | @Override 55 | @Transactional 56 | public void remove(List ids) { 57 | dictMapper.deleteBatchIds(ids); 58 | dictItemMapper.delete(new QueryWrapper().in("dict_id", ids)); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /cdp-system/src/main/java/com/chomolungma/system/dict/infrastructure/mybatis/repository/DictItemRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.chomolungma.system.dict.infrastructure.mybatis.repository; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.chomolungma.system.dict.infrastructure.converter.DictItemConverter; 6 | import com.chomolungma.system.dict.infrastructure.dataobject.DictItemDO; 7 | import com.chomolungma.system.dict.infrastructure.mybatis.repository.mapper.DictItemMapper; 8 | import com.chomolungma.system.dict.domain.entity.DictItemEntity; 9 | import com.chomolungma.system.dict.domain.repository.IDictItemRepository; 10 | import com.chomolungma.system.dict.interfaces.assembler.DictItemAssembler; 11 | import com.chomolungma.system.dict.interfaces.dto.DictItemDTO; 12 | import com.chomolungma.system.dict.interfaces.dto.DictItemPageDTO; 13 | import com.github.pagehelper.PageHelper; 14 | import com.github.pagehelper.PageInfo; 15 | import org.springframework.stereotype.Repository; 16 | import org.springframework.util.StringUtils; 17 | 18 | import java.util.List; 19 | 20 | @Repository 21 | public class DictItemRepositoryImpl implements IDictItemRepository { 22 | private final DictItemMapper dictItemMapper; 23 | 24 | public DictItemRepositoryImpl(DictItemMapper dictItemMapper) { 25 | this.dictItemMapper = dictItemMapper; 26 | } 27 | 28 | @Override 29 | public DictItemPageDTO find(int current, int size,Long dictId, String name, String code) { 30 | PageHelper.startPage(current, size); 31 | List dictItemDOS = dictItemMapper.selectList(new QueryWrapper().eq("dict_id", dictId).and(!StringUtils.isEmpty(name),wrapper -> { 32 | wrapper.like( "name", name); 33 | }).and(!StringUtils.isEmpty(code), wrapper -> { 34 | wrapper.like("code", code); 35 | })); 36 | PageInfo pageInfo = new PageInfo<>(dictItemDOS); 37 | return DictItemAssembler.toDTO(pageInfo); 38 | } 39 | 40 | @Override 41 | public DictItemEntity find(Long id) { 42 | return DictItemConverter.INSTANCE.toEntity(dictItemMapper.selectById(id)); 43 | } 44 | 45 | @Override 46 | public List find(String code) { 47 | return DictItemAssembler.toDTO(dictItemMapper.selectListByDictCode(code)); 48 | } 49 | 50 | @Override 51 | public void save(DictItemEntity dictItemEntity) { 52 | DictItemDO dictItemDO = DictItemConverter.INSTANCE.toDO(dictItemEntity); 53 | if (dictItemDO.getId() == null){ 54 | dictItemMapper.insert(dictItemDO); 55 | }else{ 56 | dictItemMapper.updateById(dictItemDO); 57 | } 58 | } 59 | 60 | @Override 61 | public void remove(List ids) { 62 | dictItemMapper.deleteBatchIds(ids); 63 | } 64 | } 65 | --------------------------------------------------------------------------------