From 398b2800c1ade98a61a18bf4c2f85fd92b4f4fb6 Mon Sep 17 00:00:00 2001 From: cunyu1943 <747731461@qq.com> Date: Sat, 4 Jun 2022 22:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=B2=20=20security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- springboot-security-demo/pom.xml | 71 +++++++++++++++++++ .../SpringbootSecurityDemoApplication.java | 13 ++++ .../controller/HelloController.java | 25 +++++++ .../src/main/resources/application.yml | 5 ++ ...pringbootSecurityDemoApplicationTests.java | 13 ++++ 5 files changed, 127 insertions(+) create mode 100644 springboot-security-demo/pom.xml create mode 100644 springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplication.java create mode 100644 springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/controller/HelloController.java create mode 100644 springboot-security-demo/src/main/resources/application.yml create mode 100644 springboot-security-demo/src/test/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplicationTests.java diff --git a/springboot-security-demo/pom.xml b/springboot-security-demo/pom.xml new file mode 100644 index 0000000..490b25d --- /dev/null +++ b/springboot-security-demo/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.6.8 + + + site.cunyu1943 + springboot-security-demo + 0.0.1-SNAPSHOT + springboot-security-demo + springboot-security-demo + + 11 + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplication.java b/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplication.java new file mode 100644 index 0000000..c5cf66d --- /dev/null +++ b/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplication.java @@ -0,0 +1,13 @@ +package site.cunyu1943.springbootsecuritydemo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringbootSecurityDemoApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringbootSecurityDemoApplication.class, args); + } + +} diff --git a/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/controller/HelloController.java b/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/controller/HelloController.java new file mode 100644 index 0000000..553517d --- /dev/null +++ b/springboot-security-demo/src/main/java/site/cunyu1943/springbootsecuritydemo/controller/HelloController.java @@ -0,0 +1,25 @@ +package site.cunyu1943.springbootsecuritydemo.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Created with IntelliJ IDEA. + * + * @Package : site.cunyu1943.springbootsecuritydemo.controller + * @ClassName : HelloController.java + * @CreateTime : 2022/6/4 21:59 + * @Version : 1.0 + * @Author : 村雨遥 + * @Email : 747731461@qq.com + * @公众号 : 村雨遥 + * @Website : https://cunyu1943.github.io/JavaPark + * @Description : + */ +@RestController +public class HelloController { + @GetMapping(value ="/hello") + public String hello() { + return "Hello World!"; + } +} diff --git a/springboot-security-demo/src/main/resources/application.yml b/springboot-security-demo/src/main/resources/application.yml new file mode 100644 index 0000000..f90ed78 --- /dev/null +++ b/springboot-security-demo/src/main/resources/application.yml @@ -0,0 +1,5 @@ +spring: + security: + user: + name: cunyu1943 + password: cunyu1943@ diff --git a/springboot-security-demo/src/test/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplicationTests.java b/springboot-security-demo/src/test/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplicationTests.java new file mode 100644 index 0000000..32b0e16 --- /dev/null +++ b/springboot-security-demo/src/test/java/site/cunyu1943/springbootsecuritydemo/SpringbootSecurityDemoApplicationTests.java @@ -0,0 +1,13 @@ +package site.cunyu1943.springbootsecuritydemo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class SpringbootSecurityDemoApplicationTests { + + @Test + void contextLoads() { + } + +} -- GitLab