♻️ Refactoring code.全参数构造器(AllArgsConstructor)更换为常量参数构造器(RequiredArgsConstructor)

This commit is contained in:
lishangbu 2020-05-13 13:09:40 +08:00
parent ca38a27a4d
commit 3e71bf24b0
41 changed files with 86 additions and 92 deletions

View File

@ -23,7 +23,7 @@ import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.security.component.PigWebResponseExceptionTranslator;
import com.pig4cloud.pig.common.security.service.PigClientDetailsService;
import com.pig4cloud.pig.common.security.service.PigUser;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -51,7 +51,7 @@ import java.util.Map;
* 认证服务器配置
*/
@Configuration
@AllArgsConstructor
@RequiredArgsConstructor
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
private final DataSource dataSource;

View File

@ -26,7 +26,7 @@ import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.security.annotation.Inner;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.core.ConvertingCursor;
@ -61,7 +61,7 @@ import java.util.Map;
*/
@Slf4j
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/token")
public class PigTokenEndpoint {
private final ClientDetailsService clientDetailsService;

View File

@ -24,7 +24,7 @@ import com.pig4cloud.pig.codegen.service.GenDatasourceConfService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.*;
* @date 2019-03-31 16:00:20
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/dsconf")
@Api(value = "dsconf", tags = "数据源管理模块")
public class GenDsConfController {

View File

@ -26,7 +26,7 @@ import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.*;
* @date 2019-08-12 15:55:35
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/form")
@Api(value = "form", tags = "表单管理")
public class GenFormConfController {

View File

@ -24,7 +24,7 @@ import com.pig4cloud.pig.codegen.entity.GenConfig;
import com.pig4cloud.pig.codegen.service.GeneratorService;
import com.pig4cloud.pig.common.core.util.R;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
@ -38,7 +38,7 @@ import javax.servlet.http.HttpServletResponse;
* @date 2018-07-30
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/generator")
@Api(value = "generator", tags = "代码生成模块")
public class GeneratorController {

View File

@ -27,7 +27,7 @@ import com.pig4cloud.pig.codegen.mapper.GenFormConfMapper;
import com.pig4cloud.pig.codegen.mapper.GeneratorMapper;
import com.pig4cloud.pig.codegen.service.GenFormConfService;
import com.pig4cloud.pig.codegen.util.CodeGenUtils;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.commons.lang.StringUtils;
import org.apache.velocity.Template;
@ -49,7 +49,7 @@ import java.util.Properties;
* @date 2019-08-12 15:55:35
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class GenFormConfServiceImpl extends ServiceImpl<GenFormConfMapper, GenFormConf> implements GenFormConfService {
private final GeneratorMapper generatorMapper;

View File

@ -32,7 +32,7 @@ import com.pig4cloud.pig.codegen.mapper.GenFormConfMapper;
import com.pig4cloud.pig.codegen.mapper.GeneratorMapper;
import com.pig4cloud.pig.codegen.service.GeneratorService;
import com.pig4cloud.pig.codegen.util.CodeGenUtils;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.io.ByteArrayOutputStream;
@ -47,7 +47,7 @@ import java.util.zip.ZipOutputStream;
* 代码生成器
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class GeneratorServiceImpl implements GeneratorService {
private final GeneratorMapper generatorMapper;
private final GenFormConfMapper genFormConfMapper;

View File

@ -26,7 +26,7 @@ import ${package}.${moduleName}.service.${className}Service;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.*;
* @date ${datetime}
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/${pathName}" )
@Api(value = "${pathName}", tags = "${comments}管理")
public class ${className}Controller {

View File

@ -18,7 +18,7 @@
package com.pig4cloud.pig.common.core.config;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
@ -36,7 +36,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
*/
@EnableCaching
@Configuration
@AllArgsConstructor
@RequiredArgsConstructor
@AutoConfigureBefore(RedisAutoConfiguration.class)
public class RedisTemplateConfig {
private final RedisConnectionFactory factory;

View File

@ -18,8 +18,8 @@
package com.pig4cloud.pig.common.core.constant.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author lengleng
@ -28,7 +28,7 @@ import lombok.Getter;
* 字典类型
*/
@Getter
@AllArgsConstructor
@RequiredArgsConstructor
public enum DictTypeEnum {
/**
* 字典类型-系统内置不可修改
@ -43,9 +43,9 @@ public enum DictTypeEnum {
/**
* 类型
*/
private String type;
private final String type;
/**
* 描述
*/
private String description;
private final String description;
}

View File

@ -18,8 +18,8 @@
package com.pig4cloud.pig.common.core.constant.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author lengleng
@ -27,7 +27,7 @@ import lombok.Getter;
* 社交登录类型
*/
@Getter
@AllArgsConstructor
@RequiredArgsConstructor
public enum LoginTypeEnum {
/**
* 账号密码登录

View File

@ -18,8 +18,8 @@
package com.pig4cloud.pig.common.core.constant.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* @author lengleng
@ -28,7 +28,7 @@ import lombok.Getter;
* 菜单类型
*/
@Getter
@AllArgsConstructor
@RequiredArgsConstructor
public enum MenuTypeEnum {
/**
@ -49,9 +49,9 @@ public enum MenuTypeEnum {
/**
* 类型
*/
private String type;
private final String type;
/**
* 描述
*/
private String description;
private final String description;
}

View File

@ -23,7 +23,7 @@ import com.baomidou.dynamic.datasource.provider.DynamicDataSourceProvider;
import com.pig4cloud.pig.common.datasource.config.DataSourceProperties;
import com.pig4cloud.pig.common.datasource.config.JdbcDynamicDataSourceProvider;
import com.pig4cloud.pig.common.datasource.config.LastParamDsProcessor;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.jasypt.encryption.StringEncryptor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -37,7 +37,7 @@ import org.springframework.context.annotation.Configuration;
* <p>
* 动态数据源切换配置
*/
@AllArgsConstructor
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(DataSourceAutoConfiguration.class)
@EnableConfigurationProperties(DataSourceProperties.class)

View File

@ -21,7 +21,7 @@ package com.pig4cloud.pig.common.log;
import com.pig4cloud.pig.admin.api.feign.RemoteLogService;
import com.pig4cloud.pig.common.log.aspect.SysLogAspect;
import com.pig4cloud.pig.common.log.event.SysLogListener;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -33,7 +33,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
* 日志自动配置
*/
@EnableAsync
@AllArgsConstructor
@RequiredArgsConstructor
@ConditionalOnWebApplication
@Configuration(proxyBeanMethods = false)
public class LogAutoConfiguration {

View File

@ -21,7 +21,7 @@ package com.pig4cloud.pig.common.log.event;
import com.pig4cloud.pig.admin.api.entity.SysLog;
import com.pig4cloud.pig.admin.api.feign.RemoteLogService;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
@ -33,7 +33,7 @@ import org.springframework.scheduling.annotation.Async;
* 异步监听日志事件
*/
@Slf4j
@AllArgsConstructor
@RequiredArgsConstructor
public class SysLogListener {
private final RemoteLogService remoteLogService;

View File

@ -28,7 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.exception.PigDeniedException;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.AccessDeniedException;
@ -46,7 +46,7 @@ import java.io.PrintWriter;
*/
@Slf4j
@Component
@AllArgsConstructor
@RequiredArgsConstructor
public class PigAccessDeniedHandler extends OAuth2AccessDeniedHandler {
private final ObjectMapper objectMapper;

View File

@ -21,7 +21,7 @@ package com.pig4cloud.pig.common.security.component;
import cn.hutool.core.util.StrUtil;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.security.annotation.Inner;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
@ -40,7 +40,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@Slf4j
@Aspect
@AllArgsConstructor
@RequiredArgsConstructor
public class PigSecurityInnerAspect implements Ordered {
private final HttpServletRequest request;

View File

@ -22,7 +22,7 @@ import cn.hutool.http.HttpStatus;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.AuthenticationException;
@ -41,7 +41,7 @@ import java.io.PrintWriter;
*/
@Slf4j
@Component
@AllArgsConstructor
@RequiredArgsConstructor
public class ResourceAuthExceptionEntryPoint implements AuthenticationEntryPoint {
private final ObjectMapper objectMapper;

View File

@ -19,7 +19,6 @@
package com.pig4cloud.pig.common.security.feign;
import feign.RequestInterceptor;
import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.security.oauth2.client.AccessTokenContextRelay;
import org.springframework.context.annotation.Bean;
@ -34,7 +33,6 @@ import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResour
* 使用hystrix 的信号量模式
*/
@Configuration
@AllArgsConstructor
@ConditionalOnProperty("security.oauth2.client.client-id")
public class PigFeignClientConfiguration {
@Bean

View File

@ -27,7 +27,7 @@ import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.Cache;
@ -51,7 +51,7 @@ import java.util.Set;
*/
@Slf4j
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class PigUserDetailsServiceImpl implements UserDetailsService {
private final RemoteUserService remoteUserService;
private final CacheManager cacheManager;

View File

@ -18,12 +18,8 @@
package com.pig4cloud.pig.gateway.config;
import com.pig4cloud.pig.gateway.handler.HystrixFallbackHandler;
import com.pig4cloud.pig.gateway.handler.ImageCodeHandler;
import com.pig4cloud.pig.gateway.handler.SwaggerResourceHandler;
import com.pig4cloud.pig.gateway.handler.SwaggerSecurityHandler;
import com.pig4cloud.pig.gateway.handler.SwaggerUiHandler;
import lombok.AllArgsConstructor;
import com.pig4cloud.pig.gateway.handler.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -39,7 +35,7 @@ import org.springframework.web.reactive.function.server.RouterFunctions;
*/
@Slf4j
@Configuration
@AllArgsConstructor
@RequiredArgsConstructor
public class RouterFunctionConfiguration {
private final HystrixFallbackHandler hystrixFallbackHandler;
private final ImageCodeHandler imageCodeHandler;

View File

@ -18,7 +18,7 @@
package com.pig4cloud.pig.gateway.config;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.support.NameUtils;
@ -36,7 +36,7 @@ import java.util.List;
*/
@Component
@Primary
@AllArgsConstructor
@RequiredArgsConstructor
public class SwaggerProviderConfiguration implements SwaggerResourcesProvider {
private static final String API_URI = "/v2/api-docs";
private final RouteLocator routeLocator;

View File

@ -27,7 +27,7 @@ import com.pig4cloud.pig.common.core.exception.ValidateCodeException;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.core.util.WebUtils;
import com.pig4cloud.pig.gateway.config.IgnoreClientConfiguration;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilter;
@ -46,7 +46,7 @@ import reactor.core.publisher.Mono;
*/
@Slf4j
@Component
@AllArgsConstructor
@RequiredArgsConstructor
public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory {
private final IgnoreClientConfiguration ignoreClient;
private final ObjectMapper objectMapper;

View File

@ -20,7 +20,7 @@ package com.pig4cloud.pig.gateway.handler;
import com.google.code.kaptcha.Producer;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.data.redis.core.RedisTemplate;
@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Component
@AllArgsConstructor
@RequiredArgsConstructor
public class ImageCodeHandler implements HandlerFunction<ServerResponse> {
private final Producer producer;
private final RedisTemplate redisTemplate;

View File

@ -18,7 +18,7 @@
package com.pig4cloud.pig.gateway.handler;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@ -37,7 +37,7 @@ import springfox.documentation.swagger.web.SwaggerResourcesProvider;
*/
@Slf4j
@Component
@AllArgsConstructor
@RequiredArgsConstructor
public class SwaggerResourceHandler implements HandlerFunction<ServerResponse> {
private final SwaggerResourcesProvider swaggerResources;

View File

@ -23,7 +23,7 @@ import com.pig4cloud.pig.admin.service.SysDeptService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -39,7 +39,7 @@ import java.time.LocalDateTime;
* @since 2019/2/1
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/dept")
@Api(value = "dept", tags = "部门管理模块")
public class DeptController {

View File

@ -30,7 +30,7 @@ import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.access.prepost.PreAuthorize;
@ -47,7 +47,7 @@ import javax.validation.Valid;
* @since 2019-03-19
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/dict")
@Api(value = "dict", tags = "字典管理模块")
public class DictController {

View File

@ -24,7 +24,7 @@ import com.pig4cloud.pig.admin.service.SysLogService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -39,7 +39,7 @@ import javax.validation.Valid;
* @since 2019/2/1
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/log")
@Api(value = "log", tags = "日志管理模块")
public class LogController {

View File

@ -25,7 +25,7 @@ import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @date 2017/10/31
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/menu")
@Api(value = "menu", tags = "菜单管理模块")
public class MenuController {

View File

@ -25,7 +25,7 @@ import com.pig4cloud.pig.admin.service.SysOauthClientDetailsService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -40,7 +40,7 @@ import javax.validation.Valid;
* @since 2018-05-15
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/client")
@Api(value = "client", tags = "客户端管理模块")
public class OauthClientDetailsController {

View File

@ -27,7 +27,7 @@ import com.pig4cloud.pig.admin.service.SysRoleService;
import com.pig4cloud.pig.common.core.util.R;
import com.pig4cloud.pig.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -38,7 +38,7 @@ import javax.validation.Valid;
* @date 2019/2/1
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/role")
@Api(value = "role", tags = "角色管理模块")
public class RoleController {

View File

@ -22,7 +22,7 @@ import com.pig4cloud.pig.admin.api.feign.RemoteTokenService;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.core.util.R;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -34,7 +34,7 @@ import java.util.Map;
* getTokenPage 管理
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/token")
@Api(value = "token", tags = "令牌管理模块")
public class TokenController {

View File

@ -29,7 +29,7 @@ import com.pig4cloud.pig.common.log.annotation.SysLog;
import com.pig4cloud.pig.common.security.annotation.Inner;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -40,7 +40,7 @@ import javax.validation.Valid;
* @date 2019/2/1
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/user")
@Api(value = "user", tags = "用户管理模块")
public class UserController {

View File

@ -25,7 +25,7 @@ import com.pig4cloud.pig.admin.api.entity.SysDept;
import com.pig4cloud.pig.admin.api.entity.SysDeptRelation;
import com.pig4cloud.pig.admin.mapper.SysDeptRelationMapper;
import com.pig4cloud.pig.admin.service.SysDeptRelationService;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -41,7 +41,7 @@ import java.util.stream.Collectors;
* @since 2019/2/1
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysDeptRelationServiceImpl extends ServiceImpl<SysDeptRelationMapper, SysDeptRelation> implements SysDeptRelationService {
private final SysDeptRelationMapper sysDeptRelationMapper;

View File

@ -29,7 +29,7 @@ import com.pig4cloud.pig.admin.mapper.SysDeptMapper;
import com.pig4cloud.pig.admin.service.SysDeptRelationService;
import com.pig4cloud.pig.admin.service.SysDeptService;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -47,7 +47,7 @@ import java.util.stream.Collectors;
* @since 2019/2/1
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService {
private final SysDeptRelationService sysDeptRelationService;

View File

@ -26,7 +26,7 @@ import com.pig4cloud.pig.admin.service.SysDictService;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.enums.DictTypeEnum;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
@ -37,7 +37,7 @@ import org.springframework.stereotype.Service;
* @date 2019/03/19
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements SysDictItemService {
private final SysDictService dictService;

View File

@ -27,7 +27,7 @@ import com.pig4cloud.pig.admin.service.SysDictService;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.enums.DictTypeEnum;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -39,7 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
* @date 2019/03/19
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> implements SysDictService {
private final SysDictItemMapper dictItemMapper;

View File

@ -33,7 +33,7 @@ import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.constant.enums.MenuTypeEnum;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@ -53,7 +53,7 @@ import java.util.stream.Collectors;
* @since 2017-10-29
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
private final SysRoleMenuMapper sysRoleMenuMapper;

View File

@ -25,7 +25,7 @@ import com.pig4cloud.pig.admin.api.entity.SysRoleMenu;
import com.pig4cloud.pig.admin.mapper.SysRoleMenuMapper;
import com.pig4cloud.pig.admin.service.SysRoleMenuService;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
@ -44,7 +44,7 @@ import java.util.stream.Collectors;
* @since 2019/2/1
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements SysRoleMenuService {
private final CacheManager cacheManager;

View File

@ -26,7 +26,7 @@ import com.pig4cloud.pig.admin.mapper.SysRoleMapper;
import com.pig4cloud.pig.admin.mapper.SysRoleMenuMapper;
import com.pig4cloud.pig.admin.service.SysRoleService;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -42,9 +42,9 @@ import java.util.List;
* @since 2019/2/1
*/
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
private SysRoleMenuMapper sysRoleMenuMapper;
private final SysRoleMenuMapper sysRoleMenuMapper;
/**
* 通过用户ID查询角色信息

View File

@ -37,7 +37,7 @@ import com.pig4cloud.pig.admin.service.*;
import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
@ -59,7 +59,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
@AllArgsConstructor
@RequiredArgsConstructor
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
private final SysMenuService sysMenuService;