去除final使用@Autowired
This commit is contained in:
@@ -17,7 +17,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -33,12 +32,13 @@ import java.util.List;
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
@RequestMapping("/common/file")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class FileController {
|
||||
|
||||
private final FileService fileService;
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
|
||||
private final Cache cache;
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
@ApiOperation(value = "获取自己的图片资源")
|
||||
@GetMapping
|
||||
|
||||
@@ -6,7 +6,6 @@ import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@Api(tags = "文件管理管理接口")
|
||||
@RequestMapping("/common/logo")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class LogoController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -9,7 +9,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -25,11 +24,10 @@ import java.util.List;
|
||||
@RestController
|
||||
@Api(tags = "地址信息接口")
|
||||
@RequestMapping("/common/region")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class RegionController {
|
||||
|
||||
|
||||
private final RegionService regionService;
|
||||
@Autowired
|
||||
private RegionService regionService;
|
||||
|
||||
@ApiOperation(value = "点地图获取地址信息")
|
||||
@ApiImplicitParams({
|
||||
|
||||
@@ -8,7 +8,6 @@ import cn.lili.common.verification.service.VerificationService;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,11 +20,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RequestMapping("/common/slider")
|
||||
@RestController
|
||||
@Api(tags = "滑块验证码接口")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class SliderImageController {
|
||||
|
||||
|
||||
private final VerificationService verificationService;
|
||||
@Autowired
|
||||
private VerificationService verificationService;
|
||||
|
||||
//一分钟同一个ip请求10次
|
||||
@LimitPoint(name = "slider_image", key = "verification")
|
||||
|
||||
@@ -11,7 +11,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -24,12 +23,12 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RestController
|
||||
@Api(tags = "短信验证码接口")
|
||||
@RequestMapping("/common/sms")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class SmsController {
|
||||
|
||||
private final SmsUtil smsUtil;
|
||||
|
||||
private final VerificationService verificationService;
|
||||
@Autowired
|
||||
private SmsUtil smsUtil;
|
||||
@Autowired
|
||||
private VerificationService verificationService;
|
||||
|
||||
//一分钟同一个ip请求1次
|
||||
@LimitPoint(name = "sms_send", key = "sms")
|
||||
|
||||
@@ -20,7 +20,6 @@ import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -41,16 +40,16 @@ import java.io.InputStream;
|
||||
@RestController
|
||||
@Api(tags = "文件上传接口")
|
||||
@RequestMapping("/common/upload")
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class UploadController {
|
||||
|
||||
private final FileService fileService;
|
||||
|
||||
private final SettingService settingService;
|
||||
|
||||
private final FileManagerPlugin fileManagerPlugin;
|
||||
|
||||
private final Cache cache;
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
@Autowired
|
||||
private FileManagerPlugin fileManagerPlugin;
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
@ApiOperation(value = "文件上传")
|
||||
@PostMapping(value = "/file")
|
||||
|
||||
@@ -3,7 +3,6 @@ package cn.lili.controller.security;
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.security.CustomAccessDeniedHandler;
|
||||
import cn.lili.config.properties.IgnoredUrlsProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -24,24 +23,23 @@ import org.springframework.web.cors.CorsConfigurationSource;
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
|
||||
/**
|
||||
* 忽略验权配置
|
||||
*/
|
||||
private final IgnoredUrlsProperties ignoredUrlsProperties;
|
||||
|
||||
@Autowired
|
||||
private IgnoredUrlsProperties ignoredUrlsProperties;
|
||||
/**
|
||||
* spring security -》 权限不足处理
|
||||
*/
|
||||
private final CustomAccessDeniedHandler accessDeniedHandler;
|
||||
|
||||
|
||||
private final Cache<String> cache;
|
||||
|
||||
private final CorsConfigurationSource corsConfigurationSource;
|
||||
@Autowired
|
||||
private CustomAccessDeniedHandler accessDeniedHandler;
|
||||
@Autowired
|
||||
private Cache<String> cache;
|
||||
@Autowired
|
||||
private CorsConfigurationSource corsConfigurationSource;
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user