Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

springboot3.1支持 #180

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/captcha-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<version>3.1.0</version>
</parent>

<groupId>com.anji-plus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
*/
package com.anji.captcha.controller;

import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService;
import com.anji.captcha.util.StringUtils;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService;
import com.anji.captcha.util.StringUtils;

import jakarta.servlet.http.HttpServletRequest;


@RestController
Expand Down
10 changes: 8 additions & 2 deletions service/springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<version>3.1.0</version>
</parent>

<groupId>com.anji.captcha</groupId>
Expand All @@ -21,7 +21,7 @@

<properties>
<java.version>1.8</java.version>
<spring-boot-version>2.3.5.RELEASE</spring-boot-version>
<spring-boot-version>3.1.0</spring-boot-version>
<skipTests>true</skipTests>
</properties>

Expand Down Expand Up @@ -49,6 +49,12 @@
<version>1.2.70</version>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* 打包发布请注释该类,可能会造成一定的影响,解决本地启动跨域问题
* Created by raodeming on 2020/3/17.
*/

import org.springframework.context.annotation.Configuration;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.*;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(filterName = "CorsFilter ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import com.alibaba.fastjson.JSONObject;
import com.anji.captcha.demo.StartApplication;
import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService;
import com.anji.captcha.service.impl.ClickWordCaptchaServiceImpl;
import com.anji.captcha.util.AESUtil;
import com.anji.captcha.util.RandomUtils;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
* Created by raodeming on 2020/4/30.
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = StartApplication.class)
public class CaptchaServiceImplTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package com.anji.captcha.service.test;

import com.anji.captcha.demo.StartApplication;
import com.anji.captcha.model.common.CaptchaTypeEnum;
import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.InputStream;
import java.util.Properties;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import com.anji.captcha.demo.StartApplication;
import com.anji.captcha.model.common.CaptchaTypeEnum;
import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService;

/**
* 针对同一个客户端组件的请求,做如下限制:
Expand All @@ -33,7 +30,7 @@
* @author WongBin
* @date 2021/1/21
*/
@RunWith(SpringRunner.class)
//@RunWith(SpringRunner.class)
@SpringBootTest(classes = StartApplication.class)
public class FrequencyLimitTest {

Expand All @@ -44,7 +41,8 @@ public class FrequencyLimitTest {
int cnt = 100;
private String clientUid = "login-"+UUID.randomUUID().toString();

@Before
// @Before
@BeforeEach
public void init() {
req.setCaptchaType(CaptchaTypeEnum.BLOCKPUZZLE.getCodeValue());
//req.setClientUid(clientUid);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.anji.captcha.service.test;

import java.util.Arrays;
import java.util.List;

import org.junit.jupiter.api.Test;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.anji.captcha.model.vo.PointVO;
import com.anji.captcha.util.JsonUtil;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

/**
*
Expand Down
2 changes: 1 addition & 1 deletion service/springmvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<java.version>1.8</java.version>
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.12</log4j.version>
<spring.version>5.0.16.RELEASE</spring.version>
<spring.version>6.0.9</spring.version>
</properties>

<dependencies>
Expand Down