init version
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" dumb="true">
|
||||
<sourceFolder url="file://$MODULE_DIR$/lib" type="java-resource" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
<License>
|
||||
<Data>
|
||||
<Products>
|
||||
<Product>Aspose.Total for Java</Product>
|
||||
<Product>Aspose.Words for Java</Product>
|
||||
</Products>
|
||||
<EditionType>Enterprise</EditionType>
|
||||
<SubscriptionExpiry>20991231</SubscriptionExpiry>
|
||||
<LicenseExpiry>20991231</LicenseExpiry>
|
||||
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
|
||||
</Data>
|
||||
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
|
||||
</License>
|
||||
@@ -0,0 +1,15 @@
|
||||
<License>
|
||||
<Data>
|
||||
<Products>
|
||||
<Product>Aspose.Total for Java</Product>
|
||||
<Product>Aspose.Words for Java</Product>
|
||||
</Products>
|
||||
<EditionType>Enterprise</EditionType>
|
||||
<SubscriptionExpiry>20991231</SubscriptionExpiry>
|
||||
<LicenseExpiry>20991231</LicenseExpiry>
|
||||
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
|
||||
</Data>
|
||||
<Signature>
|
||||
sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=
|
||||
</Signature>
|
||||
</License>
|
||||
126
joju-module-system/joju-module-system-biz/pom.xml
Normal file
126
joju-module-system/joju-module-system-biz/pom.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-module-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>joju-module-system-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
system 模块下,我们放通用业务,支撑上层的核心业务。
|
||||
例如说:用户、部门、权限、数据字典等等
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>aspose-cells</artifactId>
|
||||
<version>8.5.2</version>
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/lib/aspose-cells-8.5.2.jar</systemPath>-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-sms</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-dict</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-social</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Job 定时任务相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 消息队列相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>com.jojubanking.boot</groupId>
|
||||
<artifactId>joju-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-mp</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.5.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<version>12.4.2.jre8</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.jojubanking.boot.module.system.api.dept;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.dept.dto.DeptRespDTO;
|
||||
import com.jojubanking.boot.module.system.convert.dept.DeptConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.jojubanking.boot.module.system.service.dept.DeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class DeptApiImpl implements DeptApi {
|
||||
|
||||
@Resource
|
||||
private DeptService deptService;
|
||||
|
||||
@Override
|
||||
public DeptRespDTO getDept(Long id) {
|
||||
DeptDO dept = deptService.getDept(id);
|
||||
return DeptConvert.INSTANCE.convert03(dept);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptRespDTO> getDepts(Collection<Long> ids) {
|
||||
List<DeptDO> depts = deptService.getDepts(ids);
|
||||
return DeptConvert.INSTANCE.convertList03(depts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validDepts(Collection<Long> ids) {
|
||||
deptService.validDepts(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.api.dept;
|
||||
|
||||
import com.jojubanking.boot.module.system.service.dept.PostService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 岗位 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class PostApiImpl implements PostApi {
|
||||
|
||||
@Resource
|
||||
private PostService postService;
|
||||
|
||||
@Override
|
||||
public void validPosts(Collection<Long> ids) {
|
||||
postService.validPosts(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.jojubanking.boot.module.system.api.dict;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import com.jojubanking.boot.module.system.convert.dict.DictDataConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import com.jojubanking.boot.module.system.service.dict.DictDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 字典数据 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class DictDataApiImpl implements DictDataApi {
|
||||
|
||||
@Resource
|
||||
private DictDataService dictDataService;
|
||||
|
||||
@Override
|
||||
public void validDictDatas(String dictType, Collection<String> values) {
|
||||
dictDataService.validDictDatas(dictType, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictDataRespDTO getDictData(String dictType, String value) {
|
||||
DictDataDO dictData = dictDataService.getDictData(dictType, value);
|
||||
return DictDataConvert.INSTANCE.convert02(dictData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictDataRespDTO parseDictData(String dictType, String label) {
|
||||
DictDataDO dictData = dictDataService.parseDictData(dictType, label);
|
||||
return DictDataConvert.INSTANCE.convert02(dictData);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jojubanking.boot.module.system.api.errorcode;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO;
|
||||
import com.jojubanking.boot.module.system.api.errorcode.dto.ErrorCodeRespDTO;
|
||||
import com.jojubanking.boot.module.system.service.errorcode.ErrorCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 错误码 Api 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class ErrorCodeApiImpl implements ErrorCodeApi {
|
||||
|
||||
@Resource
|
||||
private ErrorCodeService errorCodeService;
|
||||
|
||||
@Override
|
||||
public void autoGenerateErrorCodes(List<ErrorCodeAutoGenerateReqDTO> autoGenerateDTOs) {
|
||||
errorCodeService.autoGenerateErrorCodes(autoGenerateDTOs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ErrorCodeRespDTO> getErrorCodeList(String applicationName, Date minUpdateTime) {
|
||||
return errorCodeService.getErrorCodeList(applicationName, minUpdateTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jojubanking.boot.module.system.api.logger;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import com.jojubanking.boot.module.system.service.logger.LoginLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 登录日志的 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class LoginLogApiImpl implements LoginLogApi {
|
||||
|
||||
@Resource
|
||||
private LoginLogService loginLogService;
|
||||
|
||||
@Override
|
||||
public void createLoginLog(LoginLogCreateReqDTO reqDTO) {
|
||||
loginLogService.createLoginLog(reqDTO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jojubanking.boot.module.system.api.logger;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.logger.dto.OperateLogCreateReqDTO;
|
||||
import com.jojubanking.boot.module.system.service.logger.OperateLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 操作日志 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OperateLogApiImpl implements OperateLogApi {
|
||||
|
||||
@Resource
|
||||
private OperateLogService operateLogService;
|
||||
|
||||
@Override
|
||||
public void createOperateLog(OperateLogCreateReqDTO createReqDTO) {
|
||||
operateLogService.createOperateLog(createReqDTO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.jojubanking.boot.module.system.api.oauth2;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.oauth2.dto.OAuth2AccessTokenCheckRespDTO;
|
||||
import com.jojubanking.boot.module.system.api.oauth2.dto.OAuth2AccessTokenCreateReqDTO;
|
||||
import com.jojubanking.boot.module.system.api.oauth2.dto.OAuth2AccessTokenRespDTO;
|
||||
import com.jojubanking.boot.module.system.convert.auth.OAuth2TokenConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
|
||||
import com.jojubanking.boot.module.system.service.oauth2.OAuth2TokenService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* OAuth2.0 Token API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class OAuth2TokenApiImpl implements OAuth2TokenApi {
|
||||
|
||||
@Resource
|
||||
private OAuth2TokenService oauth2TokenService;
|
||||
|
||||
@Override
|
||||
public OAuth2AccessTokenRespDTO createAccessToken(OAuth2AccessTokenCreateReqDTO reqDTO) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(
|
||||
reqDTO.getUserId(), reqDTO.getUserType(), reqDTO.getClientId(), reqDTO.getScopes());
|
||||
return OAuth2TokenConvert.INSTANCE.convert2(accessTokenDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2AccessTokenCheckRespDTO checkAccessToken(String accessToken) {
|
||||
return OAuth2TokenConvert.INSTANCE.convert(oauth2TokenService.checkAccessToken(accessToken));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2AccessTokenRespDTO removeAccessToken(String accessToken) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.removeAccessToken(accessToken);
|
||||
return OAuth2TokenConvert.INSTANCE.convert2(accessTokenDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2AccessTokenRespDTO refreshAccessToken(String refreshToken, String clientId) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.refreshAccessToken(refreshToken, clientId);
|
||||
return OAuth2TokenConvert.INSTANCE.convert2(accessTokenDO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.jojubanking.boot.module.system.api.permission;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.permission.dto.DeptDataPermissionRespDTO;
|
||||
import com.jojubanking.boot.module.system.service.permission.PermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 权限 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class PermissionApiImpl implements PermissionApi {
|
||||
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
|
||||
@Override
|
||||
public Set<Long> getUserRoleIdListByRoleIds(Collection<Long> roleIds) {
|
||||
return permissionService.getUserRoleIdListByRoleIds(roleIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAnyPermissions(Long userId, String... permissions) {
|
||||
return permissionService.hasAnyPermissions(userId, permissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAnyRoles(Long userId, String... roles) {
|
||||
return permissionService.hasAnyRoles(userId, roles);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeptDataPermissionRespDTO getDeptDataPermission(Long userId) {
|
||||
return permissionService.getDeptDataPermission(userId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.api.permission;
|
||||
|
||||
import com.jojubanking.boot.module.system.service.permission.RoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 角色 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class RoleApiImpl implements RoleApi {
|
||||
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
|
||||
@Override
|
||||
public void validRoles(Collection<Long> ids) {
|
||||
roleService.validRoles(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jojubanking.boot.module.system.api.sensitiveword;
|
||||
|
||||
import com.jojubanking.boot.module.system.service.sensitiveword.SensitiveWordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 敏感词 API 实现类
|
||||
*
|
||||
* @author 永不言败
|
||||
*/
|
||||
@Service
|
||||
public class SensitiveWordApiImpl implements SensitiveWordApi {
|
||||
|
||||
@Resource
|
||||
private SensitiveWordService sensitiveWordService;
|
||||
|
||||
@Override
|
||||
public List<String> validateText(String text, List<String> tags) {
|
||||
return sensitiveWordService.validateText(text, tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTextValid(String text, List<String> tags) {
|
||||
return sensitiveWordService.isTextValid(text, tags);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.jojubanking.boot.module.system.api.sms;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.sms.dto.code.SmsCodeCheckReqDTO;
|
||||
import com.jojubanking.boot.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
|
||||
import com.jojubanking.boot.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
import com.jojubanking.boot.module.system.service.sms.SmsCodeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 短信验证码 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SmsCodeApiImpl implements SmsCodeApi {
|
||||
|
||||
@Resource
|
||||
private SmsCodeService smsCodeService;
|
||||
|
||||
@Override
|
||||
public void sendSmsCode(SmsCodeSendReqDTO reqDTO) {
|
||||
smsCodeService.sendSmsCode(reqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useSmsCode(SmsCodeUseReqDTO reqDTO) {
|
||||
smsCodeService.useSmsCode(reqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkSmsCode(SmsCodeCheckReqDTO reqDTO) {
|
||||
smsCodeService.checkSmsCode(reqDTO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jojubanking.boot.module.system.api.sms;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import com.jojubanking.boot.module.system.service.sms.SmsSendService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 短信发送 API 接口
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SmsSendApiImpl implements SmsSendApi {
|
||||
|
||||
@Resource
|
||||
private SmsSendService smsSendService;
|
||||
|
||||
@Override
|
||||
public Long sendSingleSmsToAdmin(SmsSendSingleToUserReqDTO reqDTO) {
|
||||
return smsSendService.sendSingleSmsToAdmin(reqDTO.getMobile(), reqDTO.getUserId(),
|
||||
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sendSingleSmsToMember(SmsSendSingleToUserReqDTO reqDTO) {
|
||||
return smsSendService.sendSingleSmsToMember(reqDTO.getMobile(), reqDTO.getUserId(),
|
||||
reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jojubanking.boot.module.system.api.social;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.social.dto.SocialUserBindReqDTO;
|
||||
import com.jojubanking.boot.module.system.api.social.dto.SocialUserUnbindReqDTO;
|
||||
import com.jojubanking.boot.module.system.service.social.SocialUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 社交用户的 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SocialUserApiImpl implements SocialUserApi {
|
||||
|
||||
@Resource
|
||||
private SocialUserService socialUserService;
|
||||
|
||||
@Override
|
||||
public String getAuthorizeUrl(Integer type, String redirectUri) {
|
||||
return socialUserService.getAuthorizeUrl(type, redirectUri);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindSocialUser(SocialUserBindReqDTO reqDTO) {
|
||||
socialUserService.bindSocialUser(reqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbindSocialUser(SocialUserUnbindReqDTO reqDTO) {
|
||||
socialUserService.unbindSocialUser(reqDTO.getUserId(), reqDTO.getUserType(),
|
||||
reqDTO.getType(), reqDTO.getUnionId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getBindUserId(Integer userType, Integer type, String code, String state) {
|
||||
return socialUserService.getBindUserId(userType, type, code, state);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jojubanking.boot.module.system.api.tenant;
|
||||
|
||||
import com.jojubanking.boot.module.system.service.tenant.TenantService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 多租户的 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class TenantApiImpl implements TenantApi {
|
||||
|
||||
@Resource
|
||||
private TenantService tenantService;
|
||||
|
||||
@Override
|
||||
public List<Long> getTenantIds() {
|
||||
return tenantService.getTenantIds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validTenant(Long id) {
|
||||
tenantService.validTenant(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.jojubanking.boot.module.system.api.user;
|
||||
|
||||
import com.jojubanking.boot.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.jojubanking.boot.module.system.convert.user.UserConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.jojubanking.boot.module.system.service.user.AdminUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Admin 用户 API 实现类
|
||||
*
|
||||
* @author TW
|
||||
*/
|
||||
@Service
|
||||
public class AdminUserApiImpl implements AdminUserApi {
|
||||
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
|
||||
@Override
|
||||
public AdminUserRespDTO getUser(Long id) {
|
||||
AdminUserDO user = userService.getUser(id);
|
||||
return UserConvert.INSTANCE.convert4(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsers(Collection<Long> ids) {
|
||||
List<AdminUserDO> users = userService.getUsers(ids);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsersByDeptIds(Collection<Long> deptIds) {
|
||||
List<AdminUserDO> users = userService.getUsersByDeptIds(deptIds);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds) {
|
||||
List<AdminUserDO> users = userService.getUsersByPostIds(postIds);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validUsers(Set<Long> ids) {
|
||||
userService.validUsers(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
### 请求 /login 接口 => 成功
|
||||
POST {{baseUrl}}/system/auth/login
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
{
|
||||
"username": "admin",
|
||||
"password": "admin123",
|
||||
"uuid": "3acd87a09a4f48fb9118333780e94883",
|
||||
"code": "1024"
|
||||
}
|
||||
|
||||
### 请求 /login 接口 => 成功(无验证码)
|
||||
POST {{baseUrl}}/system/auth/login
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
{
|
||||
"username": "admin",
|
||||
"password": "admin123"
|
||||
}
|
||||
|
||||
### 请求 /get-permission-info 接口 => 成功
|
||||
GET {{baseUrl}}/system/auth/get-permission-info
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
### 请求 /list-menus 接口 => 成功
|
||||
GET {{baseUrl}}/system/list-menus
|
||||
Authorization: Bearer {{token}}
|
||||
#Authorization: Bearer a6aa7714a2e44c95aaa8a2c5adc2a67a
|
||||
tenant-id: {{adminTenentId}}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.jojubanking.boot.framework.common.enums.CommonStatusEnum;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.framework.common.util.collection.SetUtils;
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.jojubanking.boot.framework.security.config.SecurityProperties;
|
||||
import com.jojubanking.boot.module.system.controller.admin.auth.vo.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.auth.vo.*;
|
||||
import com.jojubanking.boot.module.system.convert.auth.AuthConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.permission.MenuDO;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.permission.RoleDO;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.jojubanking.boot.module.system.enums.logger.LoginLogTypeEnum;
|
||||
import com.jojubanking.boot.module.system.enums.permission.MenuTypeEnum;
|
||||
import com.jojubanking.boot.module.system.service.auth.AdminAuthService;
|
||||
import com.jojubanking.boot.module.system.service.permission.PermissionService;
|
||||
import com.jojubanking.boot.module.system.service.permission.RoleService;
|
||||
import com.jojubanking.boot.module.system.service.social.SocialUserService;
|
||||
import com.jojubanking.boot.module.system.service.user.AdminUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
import static com.jojubanking.boot.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static com.jojubanking.boot.framework.security.core.util.SecurityFrameworkUtils.obtainAuthorization;
|
||||
import static java.util.Collections.singleton;
|
||||
|
||||
@Api(tags = "管理后台 - 认证")
|
||||
@RestController
|
||||
@RequestMapping("/system/auth")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class AuthController {
|
||||
|
||||
@Resource
|
||||
private AdminAuthService authService;
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
@Resource
|
||||
private SocialUserService socialUserService;
|
||||
|
||||
@Resource
|
||||
private SecurityProperties securityProperties;
|
||||
|
||||
@PostMapping("/login")
|
||||
@PermitAll
|
||||
@ApiOperation("使用账号密码登录")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> login(@RequestBody @Valid AuthLoginReqVO reqVO) {
|
||||
return success(authService.login(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
@PermitAll
|
||||
@ApiOperation("登出系统")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<Boolean> logout(HttpServletRequest request) {
|
||||
String token = obtainAuthorization(request, securityProperties.getTokenHeader());
|
||||
if (StrUtil.isNotBlank(token)) {
|
||||
authService.logout(token, LoginLogTypeEnum.LOGOUT_SELF.getType());
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/refresh-token")
|
||||
@PermitAll
|
||||
@ApiOperation("刷新令牌")
|
||||
@ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class)
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> refreshToken(@RequestParam("refreshToken") String refreshToken) {
|
||||
return success(authService.refreshToken(refreshToken));
|
||||
}
|
||||
|
||||
@GetMapping("/get-permission-info")
|
||||
@ApiOperation("获取登录用户的权限信息")
|
||||
public CommonResult<AuthPermissionInfoRespVO> getPermissionInfo() {
|
||||
// 获得用户信息
|
||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
// 获得角色列表
|
||||
Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
List<RoleDO> roleList = roleService.getRolesFromCache(roleIds);
|
||||
// 获得菜单列表
|
||||
List<MenuDO> menuList = permissionService.getRoleMenuListFromCache(roleIds,
|
||||
SetUtils.asSet(MenuTypeEnum.DIR.getType(), MenuTypeEnum.MENU.getType(), MenuTypeEnum.BUTTON.getType()),
|
||||
singleton(CommonStatusEnum.ENABLE.getStatus())); // 只要开启的
|
||||
// 拼接结果返回
|
||||
return success(AuthConvert.INSTANCE.convert(user, roleList, menuList));
|
||||
}
|
||||
|
||||
@GetMapping("/list-menus")
|
||||
@ApiOperation("获得登录用户的菜单列表")
|
||||
public CommonResult<List<AuthMenuRespVO>> getMenus() {
|
||||
// 获得角色列表
|
||||
Set<Long> roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
// 获得用户拥有的菜单列表
|
||||
List<MenuDO> menuList = permissionService.getRoleMenuListFromCache(roleIds,
|
||||
SetUtils.asSet(MenuTypeEnum.DIR.getType(), MenuTypeEnum.MENU.getType()), // 只要目录和菜单类型
|
||||
singleton(CommonStatusEnum.ENABLE.getStatus())); // 只要开启的
|
||||
// 转换成 Tree 结构返回
|
||||
return success(AuthConvert.INSTANCE.buildMenuTree(menuList));
|
||||
}
|
||||
|
||||
// ========== 短信登录相关 ==========
|
||||
|
||||
@PostMapping("/sms-login")
|
||||
@PermitAll
|
||||
@ApiOperation("使用短信验证码登录")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> smsLogin(@RequestBody @Valid AuthSmsLoginReqVO reqVO) {
|
||||
return success(authService.smsLogin(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/send-sms-code")
|
||||
@PermitAll
|
||||
@ApiOperation(value = "发送手机验证码")
|
||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<Boolean> sendLoginSmsCode(@RequestBody @Valid AuthSmsSendReqVO reqVO) {
|
||||
authService.sendSmsCode(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// ========== 社交登录相关 ==========
|
||||
|
||||
@GetMapping("/social-auth-redirect")
|
||||
@PermitAll
|
||||
@ApiOperation("社交授权的跳转")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class)
|
||||
})
|
||||
public CommonResult<String> socialLogin(@RequestParam("type") Integer type,
|
||||
@RequestParam("redirectUri") String redirectUri) {
|
||||
return CommonResult.success(socialUserService.getAuthorizeUrl(type, redirectUri));
|
||||
}
|
||||
|
||||
@PostMapping("/social-login")
|
||||
@PermitAll
|
||||
@ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户")
|
||||
// @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||
public CommonResult<AuthLoginRespVO> socialQuickLogin(@RequestBody @Valid AuthSocialLoginReqVO reqVO) {
|
||||
return success(authService.socialLogin(reqVO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.jojubanking.boot.framework.common.validation.InEnum;
|
||||
import com.jojubanking.boot.module.system.enums.social.SocialTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@ApiModel(value = "管理后台 - 账号密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
public class AuthLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "账号", required = true, example = "jojuyuanma")
|
||||
@NotEmpty(message = "登录账号不能为空")
|
||||
@Length(min = 4, max = 16, message = "账号长度为 4-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "buzhidao")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
// ========== 图片验证码相关 ==========
|
||||
|
||||
@ApiModelProperty(value = "验证码", required = true, example = "1024", notes = "验证码开启时,需要传递")
|
||||
@NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "验证码的唯一标识", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62", notes = "验证码开启时,需要传递")
|
||||
@NotEmpty(message = "唯一标识不能为空", groups = CodeEnableGroup.class)
|
||||
private String uuid;
|
||||
|
||||
// ========== 绑定社交登录时,需要传递如下参数 ==========
|
||||
|
||||
@ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
private Integer socialType;
|
||||
|
||||
@ApiModelProperty(value = "授权码", required = true, example = "1024")
|
||||
private String socialCode;
|
||||
|
||||
@ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
private String socialState;
|
||||
|
||||
/**
|
||||
* 开启验证码的 Group
|
||||
*/
|
||||
public interface CodeEnableGroup {}
|
||||
|
||||
@AssertTrue(message = "授权码不能为空")
|
||||
public boolean isSocialCodeValid() {
|
||||
return socialType == null || StrUtil.isNotEmpty(socialCode);
|
||||
}
|
||||
|
||||
@AssertTrue(message = "授权 state 不能为空")
|
||||
public boolean isSocialState() {
|
||||
return socialType == null || StrUtil.isNotEmpty(socialState);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("管理后台 - 登录 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthLoginRespVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "访问令牌", required = true, example = "happy")
|
||||
private String accessToken;
|
||||
|
||||
@ApiModelProperty(value = "刷新令牌", required = true, example = "nice")
|
||||
private String refreshToken;
|
||||
|
||||
@ApiModelProperty(value = "过期时间", required = true)
|
||||
private Date expiresTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("管理后台 - 登录用户的菜单信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthMenuRespVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
|
||||
private String component;
|
||||
|
||||
@ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty(value = "是否可见", required = true, example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
@ApiModelProperty(value = "是否缓存", required = true, example = "false")
|
||||
private Boolean keepAlive;
|
||||
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
private List<AuthMenuRespVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ApiModel(value = "管理后台 - 登录用户的权限信息 Response VO", description = "额外包括用户信息和角色列表")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthPermissionInfoRespVO {
|
||||
|
||||
@ApiModelProperty(value = "用户信息", required = true)
|
||||
private UserVO user;
|
||||
|
||||
@ApiModelProperty(value = "角色标识数组", required = true)
|
||||
private Set<String> roles;
|
||||
|
||||
@ApiModelProperty(value = "操作权限数组", required = true)
|
||||
private Set<String> permissions;
|
||||
|
||||
@ApiModel("用户信息 VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class UserVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称", required = true, example = "TW")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像", required = true, example = "http://www.iocoder.cn/xx.jpg")
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import com.jojubanking.boot.framework.common.validation.Mobile;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@ApiModel("管理后台 - 短信验证码的登录 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSmsLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "jojuyuanma")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "短信验证码", required = true, example = "1024")
|
||||
@NotEmpty(message = "验证码不能为空")
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import com.jojubanking.boot.framework.common.validation.InEnum;
|
||||
import com.jojubanking.boot.framework.common.validation.Mobile;
|
||||
import com.jojubanking.boot.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 发送手机验证码 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSmsSendReqVO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", required = true, example = "jojuyuanma")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
@Mobile
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "短信场景", required = true, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.auth.vo;
|
||||
|
||||
import com.jojubanking.boot.framework.common.validation.InEnum;
|
||||
import com.jojubanking.boot.module.system.enums.social.SocialTypeEnum;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthSocialLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "授权码", required = true, example = "1024")
|
||||
@NotEmpty(message = "授权码不能为空")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@NotEmpty(message = "state 不能为空")
|
||||
private String state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building;
|
||||
|
||||
import com.jojubanking.boot.framework.common.enums.CommonStatusEnum;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO;
|
||||
import com.jojubanking.boot.module.system.convert.dept.DeptConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dept.DeptDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.building.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.building.BuildingDO;
|
||||
import com.jojubanking.boot.module.system.convert.building.BuildingConvert;
|
||||
import com.jojubanking.boot.module.system.service.building.BuildingService;
|
||||
|
||||
@Api(tags = "管理后台 - 楼层导视")
|
||||
@RestController
|
||||
@RequestMapping("/system/building")
|
||||
@Validated
|
||||
public class BuildingController {
|
||||
|
||||
@Resource
|
||||
private BuildingService buildingService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建楼层导视")
|
||||
@PreAuthorize("@ss.hasPermission('system:building:create')")
|
||||
public CommonResult<Long> createBuilding(@Valid @RequestBody BuildingCreateReqVO createReqVO) {
|
||||
return success(buildingService.createBuilding(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新楼层导视")
|
||||
@PreAuthorize("@ss.hasPermission('system:building:update')")
|
||||
public CommonResult<Boolean> updateBuilding(@Valid @RequestBody BuildingUpdateReqVO updateReqVO) {
|
||||
buildingService.updateBuilding(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除楼层导视")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:building:delete')")
|
||||
public CommonResult<Boolean> deleteBuilding(@RequestParam("id") Long id) {
|
||||
buildingService.deleteBuilding(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得楼层导视")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:building:query')")
|
||||
public CommonResult<BuildingRespVO> getBuilding(@RequestParam("id") Long id) {
|
||||
BuildingDO building = buildingService.getBuilding(id);
|
||||
return success(BuildingConvert.INSTANCE.convert(building));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得楼层导视列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:building:query')")
|
||||
public CommonResult<List<BuildingRespVO>> getBuildingList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<BuildingDO> list = buildingService.getBuildingList(ids);
|
||||
return success(BuildingConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/list01")
|
||||
@ApiOperation("获得楼层导视列表01")
|
||||
@PreAuthorize("@ss.hasPermission('system:building:query')")
|
||||
public CommonResult<List<BuildingRespVO>> listDepts(BuildingListReqVO reqVO) {
|
||||
List<BuildingDO> list = buildingService.getSimpleBuildings(reqVO);
|
||||
list.sort(Comparator.comparing(BuildingDO::getFid));
|
||||
return success(BuildingConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取楼层精简信息列表", notes = "只包含被开启的,主要用于前端的下拉选项")
|
||||
public CommonResult<List<BuildingSimpleRespVO>> getSimpleBuildings() {
|
||||
// 获得部门列表,只要开启状态的
|
||||
BuildingListReqVO reqVO = new BuildingListReqVO();
|
||||
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
List<BuildingDO> list = buildingService.getSimpleBuildings(reqVO);
|
||||
// 排序后,返回给前端
|
||||
list.sort(Comparator.comparing(BuildingDO::getFid));
|
||||
return success(BuildingConvert.INSTANCE.convertList03(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得楼层导视分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:building:query')")
|
||||
public CommonResult<PageResult<BuildingRespVO>> getBuildingPage(@Valid BuildingPageReqVO pageVO) {
|
||||
PageResult<BuildingDO> pageResult = buildingService.getBuildingPage(pageVO);
|
||||
return success(BuildingConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出楼层导视 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:building:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportBuildingExcel(@Valid BuildingExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<BuildingDO> list = buildingService.getBuildingList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<BuildingExcelVO> datas = BuildingConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "楼层导视.xls", "数据", BuildingExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 楼层导视 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class BuildingBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "大楼名称", required = true)
|
||||
@NotNull(message = "大楼名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父大楼id", required = true)
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "大楼状态(0正常 1停用)", required = true)
|
||||
@NotNull(message = "大楼状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "楼层id")
|
||||
@NotNull(message = "楼层id不能为空")
|
||||
private Integer fid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 楼层导视创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuildingCreateReqVO extends BuildingBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 楼层导视 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class BuildingExcelVO {
|
||||
|
||||
@ExcelProperty("大楼id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("大楼名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("父大楼id")
|
||||
private Long parentId;
|
||||
|
||||
@ExcelProperty("大楼状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("楼层id")
|
||||
private Integer fid;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 楼层导视 Excel 导出 Request VO", description = "参数和 BuildingPageReqVO 是一致的")
|
||||
@Data
|
||||
public class BuildingExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "大楼名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父大楼id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "大楼状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "楼层id")
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BuildingListReqVO {
|
||||
@ApiModelProperty(value = "大楼名称", example = "门诊", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "大楼状态", example = "1", notes = "参见 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 楼层导视分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuildingPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "大楼名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父大楼id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "大楼状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "楼层id")
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 楼层导视 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuildingRespVO extends BuildingBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "大楼id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 部门精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BuildingSimpleRespVO {
|
||||
@ApiModelProperty(value = "大楼编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "大楼名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父大楼 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.building.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 楼层导视更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BuildingUpdateReqVO extends BuildingBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "大楼id", required = true)
|
||||
@NotNull(message = "大楼id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.carousel.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.carousel.CarouselDO;
|
||||
import com.jojubanking.boot.module.system.convert.carousel.CarouselConvert;
|
||||
import com.jojubanking.boot.module.system.service.carousel.CarouselService;
|
||||
|
||||
@Api(tags = "管理后台 - 轮播图")
|
||||
@RestController
|
||||
@RequestMapping("/system/carousel")
|
||||
@Validated
|
||||
public class CarouselController {
|
||||
|
||||
@Resource
|
||||
private CarouselService carouselService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建轮播图")
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:create')")
|
||||
public CommonResult<Integer> createCarousel(@Valid @RequestBody CarouselCreateReqVO createReqVO) {
|
||||
return success(carouselService.createCarousel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新轮播图")
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:update')")
|
||||
public CommonResult<Boolean> updateCarousel(@Valid @RequestBody CarouselUpdateReqVO updateReqVO) {
|
||||
carouselService.updateCarousel(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除轮播图")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:delete')")
|
||||
public CommonResult<Boolean> deleteCarousel(@RequestParam("id") Integer id) {
|
||||
carouselService.deleteCarousel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得轮播图")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:query')")
|
||||
public CommonResult<CarouselRespVO> getCarousel(@RequestParam("id") Integer id) {
|
||||
CarouselDO carousel = carouselService.getCarousel(id);
|
||||
return success(CarouselConvert.INSTANCE.convert(carousel));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得轮播图列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:query')")
|
||||
public CommonResult<List<CarouselRespVO>> getCarouselList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<CarouselDO> list = carouselService.getCarouselList(ids);
|
||||
return success(CarouselConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得轮播图分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:query')")
|
||||
public CommonResult<PageResult<CarouselRespVO>> getCarouselPage(@Valid CarouselPageReqVO pageVO) {
|
||||
PageResult<CarouselDO> pageResult = carouselService.getCarouselPage(pageVO);
|
||||
return success(CarouselConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出轮播图 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:carousel:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportCarouselExcel(@Valid CarouselExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<CarouselDO> list = carouselService.getCarouselList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<CarouselExcelVO> datas = CarouselConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "轮播图.xls", "数据", CarouselExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 轮播图 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class CarouselBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "轮播图标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "轮播图")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "分类(1、首页轮播图 2、体检轮播图)")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 轮播图创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CarouselCreateReqVO extends CarouselBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 轮播图 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class CarouselExcelVO {
|
||||
|
||||
@ExcelProperty("用户ID")
|
||||
private Integer id;
|
||||
|
||||
@ExcelProperty("轮播图标题")
|
||||
private String title;
|
||||
|
||||
@ExcelProperty("轮播图")
|
||||
private String img;
|
||||
|
||||
@ExcelProperty("分类(1、首页轮播图 2、体检轮播图)")
|
||||
private Integer type;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 轮播图 Excel 导出 Request VO", description = "参数和 CarouselPageReqVO 是一致的")
|
||||
@Data
|
||||
public class CarouselExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "轮播图标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "轮播图")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "分类(1、首页轮播图 2、体检轮播图)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 轮播图分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CarouselPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "轮播图标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "轮播图")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "分类(1、首页轮播图 2、体检轮播图)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 轮播图 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CarouselRespVO extends CarouselBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户ID", required = true)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "轮播图标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "轮播图")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "分类(1、首页轮播图 2、体检轮播图)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.carousel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 轮播图更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CarouselUpdateReqVO extends CarouselBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户ID", required = true)
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Integer id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem;
|
||||
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.item.ItemDO;
|
||||
import com.jojubanking.boot.module.system.service.item.ItemService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.childitem.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.childitem.ChilditemDO;
|
||||
import com.jojubanking.boot.module.system.convert.childitem.ChilditemConvert;
|
||||
import com.jojubanking.boot.module.system.service.childitem.ChilditemService;
|
||||
|
||||
@Api(tags = "管理后台 - 检查项目子")
|
||||
@RestController
|
||||
@RequestMapping("/system/childitem")
|
||||
@Validated
|
||||
public class ChilditemController {
|
||||
|
||||
@Resource
|
||||
private ChilditemService childitemService;
|
||||
@Resource
|
||||
private ItemService itemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建检查项目子")
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:create')")
|
||||
public CommonResult<Long> createChilditem(@Valid @RequestBody ChilditemCreateReqVO createReqVO) {
|
||||
DecimalFormat df = new DecimalFormat("#");
|
||||
Double number = Double.parseDouble(createReqVO.getItemprice())*100;
|
||||
createReqVO.setItemprice(df.format(number));
|
||||
|
||||
return success(childitemService.createChilditem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新检查项目子")
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:update')")
|
||||
public CommonResult<Boolean> updateChilditem(@Valid @RequestBody ChilditemUpdateReqVO updateReqVO) {
|
||||
childitemService.updateChilditem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除检查项目子")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:delete')")
|
||||
public CommonResult<Boolean> deleteChilditem(@RequestParam("id") Long id) {
|
||||
childitemService.deleteChilditem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得检查项目子")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:query')")
|
||||
public CommonResult<ChilditemRespVO> getChilditem(@RequestParam("id") Long id) {
|
||||
ChilditemDO childitem = childitemService.getChilditem(id);
|
||||
return success(ChilditemConvert.INSTANCE.convert(childitem));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得检查项目子列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:query')")
|
||||
public CommonResult<List<ChilditemRespVO>> getChilditemList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ChilditemDO> list = childitemService.getChilditemList(ids);
|
||||
return success(ChilditemConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得检查项目子分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:query')")
|
||||
public CommonResult<PageResult<ChilditemRespVO>> getChilditemPage(@Valid ChilditemPageReqVO pageVO) {
|
||||
PageResult<ChilditemDO> pageResult = childitemService.getChilditemPage(pageVO);
|
||||
return success(ChilditemConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出检查项目子 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:childitem:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportChilditemExcel(@Valid ChilditemExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ChilditemDO> list = childitemService.getChilditemList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ChilditemExcelVO> datas = ChilditemConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "检查项目子.xls", "数据", ChilditemExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 检查项目子 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class ChilditemBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "套餐代码 目前只有一个基础包", required = true)
|
||||
@NotNull(message = "套餐代码 目前只有一个基础包不能为空")
|
||||
private String packageno;
|
||||
|
||||
@ApiModelProperty(value = "标识(1小项目 2临床 )", required = true)
|
||||
@NotNull(message = "标识(1小项目 2临床 )不能为空")
|
||||
private Integer itemflag;
|
||||
|
||||
@ApiModelProperty(value = "项目代码", required = true)
|
||||
@NotNull(message = "项目代码不能为空")
|
||||
private String itemno;
|
||||
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String itemname;
|
||||
|
||||
@ApiModelProperty(value = "代价 单位分")
|
||||
private String itemprice;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 检查项目子创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ChilditemCreateReqVO extends ChilditemBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 检查项目子 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class ChilditemExcelVO {
|
||||
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("套餐代码 目前只有一个基础包")
|
||||
private String packageno;
|
||||
|
||||
@ExcelProperty("标识(1小项目 2临床 )")
|
||||
private Integer itemflag;
|
||||
|
||||
@ExcelProperty("项目代码")
|
||||
private String itemno;
|
||||
|
||||
@ExcelProperty("项目名称")
|
||||
private String itemname;
|
||||
|
||||
@ExcelProperty("代价 单位分")
|
||||
private String itemprice;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 检查项目子 Excel 导出 Request VO", description = "参数和 ChilditemPageReqVO 是一致的")
|
||||
@Data
|
||||
public class ChilditemExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "套餐代码 目前只有一个基础包")
|
||||
private String packageno;
|
||||
|
||||
@ApiModelProperty(value = "标识(1小项目 2临床 )")
|
||||
private Integer itemflag;
|
||||
|
||||
@ApiModelProperty(value = "项目代码")
|
||||
private String itemno;
|
||||
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String itemname;
|
||||
|
||||
@ApiModelProperty(value = "代价 单位分")
|
||||
private String itemprice;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 检查项目子分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ChilditemPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "套餐代码 目前只有一个基础包")
|
||||
private String packageno;
|
||||
|
||||
@ApiModelProperty(value = "标识(1小项目 2临床 )")
|
||||
private Integer itemflag;
|
||||
|
||||
@ApiModelProperty(value = "项目代码")
|
||||
private String itemno;
|
||||
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String itemname;
|
||||
|
||||
@ApiModelProperty(value = "代价 单位分")
|
||||
private String itemprice;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 检查项目子 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ChilditemRespVO extends ChilditemBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "ID", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.childitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 检查项目子更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ChilditemUpdateReqVO extends ChilditemBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "ID", required = true)
|
||||
@NotNull(message = "ID不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
### 请求 /captcha/get-image 接口 => 成功
|
||||
GET {{baseUrl}}/system/captcha/get-image
|
||||
tenant-id: {{adminTenentId}}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.common;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.module.system.controller.admin.common.vo.CaptchaImageRespVO;
|
||||
import com.jojubanking.boot.module.system.service.common.CaptchaService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 验证码")
|
||||
@RestController
|
||||
@RequestMapping("/system/captcha")
|
||||
public class CaptchaController {
|
||||
|
||||
@Resource
|
||||
private CaptchaService captchaService;
|
||||
|
||||
@GetMapping("/get-image")
|
||||
@PermitAll
|
||||
@ApiOperation("生成图片验证码")
|
||||
public CommonResult<CaptchaImageRespVO> getCaptchaImage() {
|
||||
return success(captchaService.getCaptchaImage());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@ApiModel("管理后台 - 验证码图片 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class CaptchaImageRespVO {
|
||||
|
||||
@ApiModelProperty(value = "是否开启", required = true, example = "true", notes = "如果为 false,则关闭验证码功能")
|
||||
private Boolean enable;
|
||||
|
||||
@ApiModelProperty(value = "uuid", example = "1b3b7d00-83a8-4638-9e37-d67011855968",
|
||||
notes = "enable = true 时,非空!通过该 uuid 作为该验证码的标识")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "图片", notes = "enable = true 时,非空!验证码的图片内容,使用 Base64 编码")
|
||||
private String img;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept;
|
||||
|
||||
import com.jojubanking.boot.framework.common.enums.CommonStatusEnum;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.*;
|
||||
import com.jojubanking.boot.module.system.convert.dept.DeptConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dept.DeptDO;
|
||||
import com.jojubanking.boot.module.system.service.dept.DeptService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "管理后台 - 部门")
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
@Validated
|
||||
public class DeptController {
|
||||
|
||||
@Resource
|
||||
private DeptService deptService;
|
||||
|
||||
@PostMapping("create")
|
||||
@ApiOperation("创建部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||
public CommonResult<Long> createDept(@Valid @RequestBody DeptCreateReqVO reqVO) {
|
||||
Long deptId = deptService.createDept(reqVO);
|
||||
return success(deptId);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("更新部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||
public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptUpdateReqVO reqVO) {
|
||||
deptService.updateDept(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("delete")
|
||||
@ApiOperation("删除部门")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:delete')")
|
||||
public CommonResult<Boolean> deleteDept(@RequestParam("id") Long id) {
|
||||
deptService.deleteDept(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获取部门列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
public CommonResult<List<DeptRespVO>> listDepts(DeptListReqVO reqVO) {
|
||||
List<DeptDO> list = deptService.getSimpleDepts(reqVO);
|
||||
list.sort(Comparator.comparing(DeptDO::getSort));
|
||||
return success(DeptConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
public CommonResult<List<DeptSimpleRespVO>> getSimpleDepts() {
|
||||
// 获得部门列表,只要开启状态的
|
||||
DeptListReqVO reqVO = new DeptListReqVO();
|
||||
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
List<DeptDO> list = deptService.getSimpleDepts(reqVO);
|
||||
// 排序后,返回给前端
|
||||
list.sort(Comparator.comparing(DeptDO::getSort));
|
||||
return success(DeptConvert.INSTANCE.convertList02(list));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得部门信息")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) {
|
||||
return success(DeptConvert.INSTANCE.convert(deptService.getDept(id)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept;
|
||||
|
||||
import com.jojubanking.boot.framework.common.enums.CommonStatusEnum;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.post.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.post.*;
|
||||
import com.jojubanking.boot.module.system.convert.dept.PostConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dept.PostDO;
|
||||
import com.jojubanking.boot.module.system.service.dept.PostService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 岗位")
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
@Validated
|
||||
public class PostController {
|
||||
|
||||
@Resource
|
||||
private PostService postService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:create')")
|
||||
public CommonResult<Long> createPost(@Valid @RequestBody PostCreateReqVO reqVO) {
|
||||
Long postId = postService.createPost(reqVO);
|
||||
return success(postId);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:update')")
|
||||
public CommonResult<Boolean> updatePost(@Valid @RequestBody PostUpdateReqVO reqVO) {
|
||||
postService.updatePost(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除岗位")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:delete')")
|
||||
public CommonResult<Boolean> deletePost(@RequestParam("id") Long id) {
|
||||
postService.deletePost(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get")
|
||||
@ApiOperation("获得岗位信息")
|
||||
@ApiImplicitParam(name = "id", value = "岗位编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
public CommonResult<PostRespVO> getPost(@RequestParam("id") Long id) {
|
||||
return success(PostConvert.INSTANCE.convert(postService.getPost(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项")
|
||||
public CommonResult<List<PostSimpleRespVO>> getSimplePosts() {
|
||||
// 获得岗位列表,只要开启状态的
|
||||
List<PostDO> list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
// 排序后,返回给前端
|
||||
list.sort(Comparator.comparing(PostDO::getSort));
|
||||
return success(PostConvert.INSTANCE.convertList02(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得岗位分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
public CommonResult<PageResult<PostRespVO>> getPostPage(@Validated PostPageReqVO reqVO) {
|
||||
return success(PostConvert.INSTANCE.convertPage(postService.getPostPage(reqVO)));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("岗位管理")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException {
|
||||
List<PostDO> posts = postService.getPosts(reqVO);
|
||||
List<PostExcelVO> data = PostConvert.INSTANCE.convertList03(posts);
|
||||
// 输出
|
||||
ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 部门 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true)
|
||||
@NotNull(message = "部门名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id", required = true)
|
||||
@NotNull(message = "父部门id不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序", required = true)
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)", required = true)
|
||||
@NotNull(message = "部门状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptCreateReqVO extends DeptBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 部门 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class DeptExcelVO {
|
||||
|
||||
@ExcelProperty("部门id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ExcelProperty("显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty("负责人")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ExcelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
@ExcelProperty("部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 部门 Excel 导出 Request VO", description = "参数和 DeptPageReqVO 是一致的")
|
||||
@Data
|
||||
public class DeptExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 部门分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptRespVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptUpdateReqVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门id", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 部门 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(max = 30, message = "部门名称长度不能超过30个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父菜单 ID", example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人的用户编号", example = "2048")
|
||||
private Long leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话", example = "15601691000")
|
||||
@Size(max = 11, message = "联系电话长度不能超过11个字符")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱", example = "joju@iocoder.cn")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(max = 50, message = "邮箱长度不能超过50个字符")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@ApiModel("管理后台 - 部门创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptCreateReqVO extends DeptBaseVO {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("管理后台 - 部门列表 Request VO")
|
||||
@Data
|
||||
public class DeptListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("管理后台 - 部门信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptRespVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 部门精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeptSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.dept;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 部门更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptUpdateReqVO extends DeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
@NotNull(message = "部门编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 岗位 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", required = true, example = "小博主")
|
||||
@NotBlank(message = "岗位名称不能为空")
|
||||
@Size(max = 50, message = "岗位名称长度不能超过50个字符")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", required = true, example = "joju")
|
||||
@NotBlank(message = "岗位编码不能为空")
|
||||
@Size(max = 64, message = "岗位编码长度不能超过64个字符")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostCreateReqVO extends PostBaseVO {
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.annotations.DictFormat;
|
||||
import com.jojubanking.boot.framework.excel.core.convert.DictConvert;
|
||||
import com.jojubanking.boot.module.system.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 岗位 Excel 导出响应 VO
|
||||
*/
|
||||
@Data
|
||||
public class PostExcelVO {
|
||||
|
||||
@ExcelProperty("岗位序号")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("岗位编码")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("岗位名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("岗位排序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 PostExcelVO 是一致的")
|
||||
@Data
|
||||
public class PostExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", example = "joju", notes = "模糊匹配")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位列表 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostListReqVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 岗位分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "岗位编码", example = "joju", notes = "模糊匹配")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("管理后台 - 岗位信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostRespVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位序号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 岗位精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PostSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dept.vo.post;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("管理后台 - 岗位更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PostUpdateReqVO extends PostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编号", required = true, example = "1024")
|
||||
@NotNull(message = "岗位编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq;
|
||||
|
||||
import com.jojubanking.boot.framework.common.enums.CommonStatusEnum;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO;
|
||||
import com.jojubanking.boot.module.system.convert.dept.DeptConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dept.DeptDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.deptxq.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.deptxq.DeptXqDO;
|
||||
import com.jojubanking.boot.module.system.convert.deptxq.DeptXqConvert;
|
||||
import com.jojubanking.boot.module.system.service.deptxq.DeptXqService;
|
||||
|
||||
@Api(tags = "管理后台 - 部门")
|
||||
@RestController
|
||||
@RequestMapping("/system/dept-xq")
|
||||
@Validated
|
||||
public class DeptXqController {
|
||||
|
||||
@Resource
|
||||
private DeptXqService deptXqService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:create')")
|
||||
public CommonResult<Long> createDeptXq(@Valid @RequestBody DeptXqCreateReqVO createReqVO) {
|
||||
return success(deptXqService.createDeptXq(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新部门")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:update')")
|
||||
public CommonResult<Boolean> updateDeptXq(@Valid @RequestBody DeptXqUpdateReqVO updateReqVO) {
|
||||
deptXqService.updateDeptXq(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除部门")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:delete')")
|
||||
public CommonResult<Boolean> deleteDeptXq(@RequestParam("id") Long id) {
|
||||
deptXqService.deleteDeptXq(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得部门")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:query')")
|
||||
public CommonResult<DeptXqRespVO> getDeptXq(@RequestParam("id") Long id) {
|
||||
DeptXqDO deptXq = deptXqService.getDeptXq(id);
|
||||
return success(DeptXqConvert.INSTANCE.convert(deptXq));
|
||||
}
|
||||
|
||||
// @GetMapping("/list")
|
||||
// @ApiOperation("获得部门列表")
|
||||
// @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept-xq:query')")
|
||||
// public CommonResult<List<DeptXqRespVO>> getDeptXqList(@RequestParam("ids") Collection<Long> ids) {
|
||||
// List<DeptXqDO> list = deptXqService.getDeptXqList(ids);
|
||||
// return success(DeptXqConvert.INSTANCE.convertList(list));
|
||||
// }
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得部门分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:query')")
|
||||
public CommonResult<PageResult<DeptXqRespVO>> getDeptXqPage(@Valid DeptXqPageReqVO pageVO) {
|
||||
PageResult<DeptXqDO> pageResult = deptXqService.getDeptXqPage(pageVO);
|
||||
return success(DeptXqConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出部门 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDeptXqExcel(@Valid DeptXqExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<DeptXqDO> list = deptXqService.getDeptXqList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<DeptXqExcelVO> datas = DeptXqConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "部门.xls", "数据", DeptXqExcelVO.class, datas);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获取部门列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept-xq:query')")
|
||||
public CommonResult<List<DeptXqRespVO>> listDepts(DeptXqListReqVO reqVO) {
|
||||
List<DeptXqDO> list = deptXqService.getSimpleXqDepts(reqVO);
|
||||
list.sort(Comparator.comparing(DeptXqDO::getSort));
|
||||
return success(DeptXqConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
public CommonResult<List<DeptXqSimpleRespVO>> getSimpleDepts() {
|
||||
// 获得部门列表,只要开启状态的
|
||||
DeptXqListReqVO reqVO = new DeptXqListReqVO();
|
||||
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
List<DeptXqDO> list = deptXqService.getSimpleXqDepts(reqVO);
|
||||
// 排序后,返回给前端
|
||||
list.sort(Comparator.comparing(DeptXqDO::getSort));
|
||||
return success(DeptXqConvert.INSTANCE.convertList03(list));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 部门 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class DeptXqBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true)
|
||||
@NotNull(message = "部门名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id", required = true)
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序", required = true)
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)", required = true)
|
||||
@NotNull(message = "部门状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptXqCreateReqVO extends DeptXqBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 部门 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class DeptXqExcelVO {
|
||||
|
||||
@ExcelProperty("部门id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ExcelProperty("显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty("负责人")
|
||||
private String leaderUserId;
|
||||
|
||||
@ExcelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ExcelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
@ExcelProperty("部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 部门 Excel 导出 Request VO", description = "参数和 DeptXqPageReqVO 是一致的")
|
||||
@Data
|
||||
public class DeptXqExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("管理后台 - 部门列表 Request VO")
|
||||
@Data
|
||||
public class DeptXqListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 部门分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptXqPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String leaderUserId;
|
||||
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "部门状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptXqRespVO extends DeptXqBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@ApiModel("管理后台 - 部门精简信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeptXqSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "父部门 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.deptxq.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 部门更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeptXqUpdateReqVO extends DeptXqBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门id", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
### 请求 /menu/list 接口 => 成功
|
||||
GET {{baseUrl}}/system/dict-data/list-all-simple
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.dict.vo.data.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dict.vo.data.*;
|
||||
import com.jojubanking.boot.module.system.convert.dict.DictDataConvert;
|
||||
import com.jojubanking.boot.module.system.service.dict.DictDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 字典数据")
|
||||
@RestController
|
||||
@RequestMapping("/system/dict-data")
|
||||
@Validated
|
||||
public class DictDataController {
|
||||
|
||||
@Resource
|
||||
private DictDataService dictDataService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("新增字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:create')")
|
||||
public CommonResult<Long> createDictData(@Valid @RequestBody DictDataCreateReqVO reqVO) {
|
||||
Long dictDataId = dictDataService.createDictData(reqVO);
|
||||
return success(dictDataId);
|
||||
}
|
||||
|
||||
@PutMapping("update")
|
||||
@ApiOperation("修改字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:update')")
|
||||
public CommonResult<Boolean> updateDictData(@Valid @RequestBody DictDataUpdateReqVO reqVO) {
|
||||
dictDataService.updateDictData(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除字典数据")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:delete')")
|
||||
public CommonResult<Boolean> deleteDictData(Long id) {
|
||||
dictDataService.deleteDictData(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地")
|
||||
// 无需添加权限认证,因为前端全局都需要
|
||||
public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDatas() {
|
||||
List<DictDataDO> list = dictDataService.getDictDatas();
|
||||
return success(DictDataConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("/获得字典类型的分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<PageResult<DictDataRespVO>> getDictTypePage(@Valid DictDataPageReqVO reqVO) {
|
||||
return success(DictDataConvert.INSTANCE.convertPage(dictDataService.getDictDataPage(reqVO)));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/get")
|
||||
@ApiOperation("/查询字典数据详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<DictDataRespVO> getDictData(@RequestParam("id") Long id) {
|
||||
return success(DictDataConvert.INSTANCE.convert(dictDataService.getDictData(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ApiOperation("导出字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException {
|
||||
List<DictDataDO> list = dictDataService.getDictDatas(reqVO);
|
||||
List<DictDataExcelVO> data = DictDataConvert.INSTANCE.convertList02(list);
|
||||
// 输出
|
||||
ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dict.vo.type.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.dict.vo.type.*;
|
||||
import com.jojubanking.boot.module.system.convert.dict.DictTypeConvert;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.dict.DictTypeDO;
|
||||
import com.jojubanking.boot.module.system.service.dict.DictTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Api(tags = "管理后台 - 字典类型")
|
||||
@RestController
|
||||
@RequestMapping("/system/dict-type")
|
||||
@Validated
|
||||
public class DictTypeController {
|
||||
|
||||
@Resource
|
||||
private DictTypeService dictTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:create')")
|
||||
public CommonResult<Long> createDictType(@Valid @RequestBody DictTypeCreateReqVO reqVO) {
|
||||
Long dictTypeId = dictTypeService.createDictType(reqVO);
|
||||
return success(dictTypeId);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("修改字典类型")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:update')")
|
||||
public CommonResult<Boolean> updateDictType(@Valid @RequestBody DictTypeUpdateReqVO reqVO) {
|
||||
dictTypeService.updateDictType(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:delete')")
|
||||
public CommonResult<Boolean> deleteDictType(Long id) {
|
||||
dictTypeService.deleteDictType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("/获得字典类型的分页列表")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<PageResult<DictTypeRespVO>> pageDictTypes(@Valid DictTypePageReqVO reqVO) {
|
||||
return success(DictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO)));
|
||||
}
|
||||
|
||||
@ApiOperation("/查询字典类型详细")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
||||
@GetMapping(value = "/get")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
public CommonResult<DictTypeRespVO> getDictType(@RequestParam("id") Long id) {
|
||||
return success(DictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/list-all-simple")
|
||||
@ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项")
|
||||
// 无需添加权限认证,因为前端全局都需要
|
||||
public CommonResult<List<DictTypeSimpleRespVO>> listSimpleDictTypes() {
|
||||
List<DictTypeDO> list = dictTypeService.getDictTypeList();
|
||||
return success(DictTypeConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据类型")
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:query')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export(HttpServletResponse response, @Valid DictTypeExportReqVO reqVO) throws IOException {
|
||||
List<DictTypeDO> list = dictTypeService.getDictTypeList(reqVO);
|
||||
List<DictTypeExcelVO> data = DictTypeConvert.INSTANCE.convertList02(list);
|
||||
// 输出
|
||||
ExcelUtils.write(response, "字典类型.xls", "类型列表", DictTypeExcelVO.class, data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 字典数据 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class DictDataBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "字典标签", required = true, example = "芋道")
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "字典值", required = true, example = "iocoder")
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(max = 100, message = "字典键值长度不能超过100个字符")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(max = 100, message = "字典类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
private String colorType;
|
||||
@ApiModelProperty(value = "css 样式", example = "btn-visible")
|
||||
private String cssClass;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是一个角色")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("管理后台 - 字典数据创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DictDataCreateReqVO extends DictDataBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.annotations.DictFormat;
|
||||
import com.jojubanking.boot.framework.excel.core.convert.DictConvert;
|
||||
import com.jojubanking.boot.module.system.enums.DictTypeConstants;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 字典数据 Excel 导出响应 VO
|
||||
*/
|
||||
@Data
|
||||
public class DictDataExcelVO {
|
||||
|
||||
@ExcelProperty("字典编码")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("字典排序")
|
||||
private Integer sort;
|
||||
|
||||
@ExcelProperty("字典标签")
|
||||
private String label;
|
||||
|
||||
@ExcelProperty("字典键值")
|
||||
private String value;
|
||||
|
||||
@ExcelProperty("字典类型")
|
||||
private String dictType;
|
||||
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.dict.vo.data;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@ApiModel("管理后台 - 字典类型导出 Request VO")
|
||||
@Data
|
||||
public class DictDataExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "字典标签", example = "芋道")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user