最低版本要求jdk17, 升级spring boot3.0

This commit is contained in:
FrozenWatermelon
2023-03-16 15:37:04 +08:00
parent 07f919b8ab
commit 324d91bc0a
84 changed files with 248 additions and 455 deletions

View File

@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import jakarta.validation.Valid;
/**
* @author 菠萝凤梨

View File

@@ -23,7 +23,7 @@ public class MallWebSecurityConfigurerAdapter {
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeRequests().requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
.and()
.authorizeRequests().antMatchers(
.authorizeRequests().requestMatchers(
"/**").permitAll().and().build();
}

View File

@@ -21,7 +21,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import javax.servlet.DispatcherType;
import jakarta.servlet.DispatcherType;
/**
* 授权配置

View File

@@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
/**
* @author 菠萝凤梨

View File

@@ -15,13 +15,13 @@ import com.yami.shop.security.common.dto.RefreshTokenDTO;
import com.yami.shop.security.common.manager.TokenStore;
import com.yami.shop.security.common.vo.TokenInfoVO;
import io.swagger.v3.oas.annotations.tags.Tag;
import ma.glasnost.orika.MapperFacade;
import cn.hutool.core.bean.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import jakarta.validation.Valid;
/**
* @author 菠萝凤梨
@@ -34,15 +34,13 @@ public class TokenController {
@Autowired
private TokenStore tokenStore;
@Autowired
private MapperFacade mapperFacade;
@PostMapping("/token/refresh")
public ServerResponseEntity<TokenInfoVO> refreshToken(@Valid @RequestBody RefreshTokenDTO refreshTokenDTO) {
TokenInfoBO tokenInfoServerResponseEntity = tokenStore
.refreshToken(refreshTokenDTO.getRefreshToken());
return ServerResponseEntity
.success(mapperFacade.map(tokenInfoServerResponseEntity, TokenInfoVO.class));
.success(BeanUtil.copyProperties(tokenInfoServerResponseEntity, TokenInfoVO.class));
}
}

View File

@@ -12,7 +12,7 @@ package com.yami.shop.security.common.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;
/**
* 用于登陆传递账号密码

View File

@@ -11,7 +11,7 @@ package com.yami.shop.security.common.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;
/**
* 刷新token

View File

@@ -25,9 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.AntPathMatcher;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.*;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;