diff --git a/study-springboot-chapter01 b/study-springboot-chapter01 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/study-springboot-chapter01/pom.xml b/study-springboot-chapter01/pom.xml deleted file mode 100644 index 80018f4dd91ab81076f0c814e7634349fcbe8d74..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - com.cbitedu - study-springboot - 1.0.0 - - com.cbitedu - study-springboot-chapter01 - 1.0.0 - study-springboot-chapter01 - study-springboot-chapter01 - jar - - 1.8 - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - - - jdk18 - - true - 1.8 - - - 1.8 - 1.8 - 1.8 - - - - diff --git a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_12dr.java b/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_12dr.java deleted file mode 100644 index d69f3e6cdd486e77571c90b7b169afc6f3bf960f..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_12dr.java +++ /dev/null @@ -1,19 +0,0 @@ -package cn.hniu.utils; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -//12 -public class DateUtils_12dr { - private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; - private static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 获取当前日期字符串 - */ - public static String getCurrentDate() { - System.out.println("解决冲突_12dr"); - return LocalDate.now().format(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)); - } -} - diff --git a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_hhf41.java b/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_hhf41.java deleted file mode 100644 index fbb4838b0d5b5b787e45b0cf737fe1baae8b5536..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_hhf41.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.hniu.utils; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -public class DateUtils_hhf41 { - private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; - private static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 获取当前日期字符串 - */ - public static String getCurrentDate() { - return LocalDate.now().format(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)); - } -} diff --git a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zengjl.java b/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zengjl.java deleted file mode 100644 index 9e1c120061e4fec45e52fa90e76ea3f71b5ea653..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zengjl.java +++ /dev/null @@ -1,4 +0,0 @@ -package cn.hniu.utils; - -public class DateUtils_zengjl { -} diff --git a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zhujw.java b/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zhujw.java deleted file mode 100644 index a41aa61a690d9c983e9bb21a29a5bbc05e6cf4c6..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/cn/hniu/utils/DateUtils_zhujw.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.hniu.utils; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -public class DateUtils_zhujw { - private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; - private static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 获取当前日期字符串 - */ - public static String getCurrentDate() { - System.out.println("解决冲突_dr_dadfasfdsadf1");System.out.println("解决冲突_dr_dadf444444asfdsadf1"); - System.out.println("解决冲突——zhujw4545");System.out.println("解决冲突_dr_dadfasfdsadf1"); - System.out.println("abcdefg"); - System.out.println("解决冲突_zhu7237"); - return LocalDate.now().format(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)); - } -} diff --git a/study-springboot-chapter01/src/main/java/cn/hniu/utils/Dateutils_licongcong.java b/study-springboot-chapter01/src/main/java/cn/hniu/utils/Dateutils_licongcong.java deleted file mode 100644 index 47891821ee38c3379bfb39032f2df59cb31fa66d..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/cn/hniu/utils/Dateutils_licongcong.java +++ /dev/null @@ -1,16 +0,0 @@ -package cn.hniu.utils; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -public class Dateutils_licongcong { - private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; - private static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 获取当前日期字符串 - */ - public static String getCurrentDate() { - return LocalDate.now().format(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)); - } -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/StudySpringbootChapter01Application.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/StudySpringbootChapter01Application.java deleted file mode 100644 index 270203280b30c00efc677d9eeea0e818318c05cc..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/StudySpringbootChapter01Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cbitedu.springboot; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; - -@SpringBootApplication(exclude= DataSourceAutoConfiguration.class) -public class StudySpringbootChapter01Application { - - public static void main(String[] args) { - SpringApplication.run(StudySpringbootChapter01Application.class, args); - } - -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomProperties.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomProperties.java deleted file mode 100644 index 4d4092757656037ba7fb396a2d3941f923001570..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.cbitedu.springboot.config; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; - -@Configuration//保证该类会被扫描到 -@PropertySource("classpath:config/customconfig.properties") //定义了要读取的properties文件的位置 -@ConfigurationProperties(prefix = "config")//读取前缀为config 的内容 -public class CustomProperties { - private String picPath; - - @Override - public String toString() { - return "CustomProperties{" + - "picPath='" + picPath + '\'' + - ", videoPath='" + videoPath + '\'' + - ", serverDomain='" + serverDomain + '\'' + - '}'; - } - - public String getPicPath() { - return picPath; - } - - public void setPicPath(String picPath) { - this.picPath = picPath; - } - - public String getVideoPath() { - return videoPath; - } - - public void setVideoPath(String videoPath) { - this.videoPath = videoPath; - } - - public String getServerDomain() { - return serverDomain; - } - - public void setServerDomain(String serverDomain) { - this.serverDomain = serverDomain; - } - - private String videoPath; - private String serverDomain; -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomValue.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomValue.java deleted file mode 100644 index a3a5c5a0a8e3d5c72f76632a8f83ff23b7f829f8..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/CustomValue.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cbitedu.springboot.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; - -@Configuration//保证该类会被扫描到 -@PropertySource("classpath:config/customconfig.properties") //定义了要读取的properties文件的位置 -public class CustomValue { - @Override - public String toString() { - return "CustomValue{" + - "picPath='" + picPath + '\'' + - ", videoPath='" + videoPath + '\'' + - ", serverDomain='" + serverDomain + '\'' + - '}'; - } - - public String getPicPath() { - return picPath; - } - - public void setPicPath(String picPath) { - this.picPath = picPath; - } - - @Value("${config.picpath}") - private String picPath; - @Value("${config.videopath}") - private String videoPath; - @Value("${config.serverdomain}") - private String serverDomain; - -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/HomeProperties.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/HomeProperties.java deleted file mode 100644 index a041d3adff00d7cb5c98424d3306dfef1aa20ba2..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/HomeProperties.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cbitedu.springboot.config; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 家乡属性 - * - * Created by cbitedu on 17/04/2021. - */ -@Component -@ConfigurationProperties(prefix = "home") -public class HomeProperties { - - /** - * 省份 - */ - private String province; - - /** - * 城市 - */ - private String city; - - /** - * 描述 - */ - private String desc; - - public String getProvince() { - return province; - } - - public void setProvince(String province) { - this.province = province; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - @Override - public String toString() { - return "HomeProperties{" + - "province='" + province + '\'' + - ", city='" + city + '\'' + - ", desc='" + desc + '\'' + - '}'; - } -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/UserProperties.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/UserProperties.java deleted file mode 100644 index 4bc6e154f7e7bc5157d751c1b2c1489a417814cf..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/config/UserProperties.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.cbitedu.springboot.config; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * Created by cbitedu on 17/04/2021. - */ -@Component -@ConfigurationProperties(prefix = "user") -public class UserProperties { - /** - * 用户 ID - */ - private Long id; - - /** - * 年龄 - */ - private int age; - - /** - * 用户名称 - */ - private String desc; - - /** - * 用户 UUID - */ - private String uuid; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - - @Override - public String toString() { - return "UserProperties{" + - "id=" + id + - ", age=" + age + - ", desc='" + desc + '\'' + - ", uuid='" + uuid + '\'' + - '}'; - } -} diff --git a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/web/HelloWorldController.java b/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/web/HelloWorldController.java deleted file mode 100644 index bb9fa503ab9ea16f4723e01d20349cdcc1cb193f..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/cbitedu/springboot/web/HelloWorldController.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cbitedu.springboot.web; - -import ch.qos.logback.classic.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * Spring Boot HelloWorld 案例 - * - * Created by cbitedu on 17/04/2021. - */ -@RestController -public class HelloWorldController { -private final Logger logger = (Logger) LoggerFactory.getLogger(getClass()); - @RequestMapping("/") - public String sayHello() { - // System.out.println("99999999!"); - logger.info("99999999!"); - return "Hello,World!"; - } -} diff --git a/study-springboot-chapter01/src/main/java/com/hniu/utils/DateUtils_huanghf41.java b/study-springboot-chapter01/src/main/java/com/hniu/utils/DateUtils_huanghf41.java deleted file mode 100644 index e72793a91a2cf8fda5112bf16e8e8747879f12cc..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/java/com/hniu/utils/DateUtils_huanghf41.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hniu.utils; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -public class DateUtils_huanghf41 { - private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; - private static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - /** - * 获取当前日期字符串 - */ - public static String getCurrentDate() { - return LocalDate.now().format(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)); - } -} diff --git a/study-springboot-chapter01/src/main/resources/application-dev.properties b/study-springboot-chapter01/src/main/resources/application-dev.properties deleted file mode 100644 index d522df359e97a9f14cf392dc529abe019c8cbf15..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/application-dev.properties +++ /dev/null @@ -1,21 +0,0 @@ -##SpringBoot\u5185\u7F6E\u5C5E\u6027\u67E5\u8BE2 -##https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties -##\u5B98\u65B9\u6587\u6863\u4E2D\u53C2\u8003\u6587\u6863\u7B2C\u4E00\u9879\uFF1AApplication Properties -##\u4FEE\u6539\u670D\u52A1\u5668\u7AEF\u53E3 -server.port=8081 -server.servlet.context-path=/ -##\u5173\u95ED\u8FD0\u884C\u65E5\u5FD7\u56FE\u6807\uFF08banner\uFF09 -spring.main.banner-mode=off -##\u8BBE\u7F6E\u65E5\u5FD7\u76F8\u5173 -logging.level.root=info -logging.level.com.cbitedu=info -spring.datasource.url=jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=UTF-8&useSSL=false -## \u5BB6\u4E61\u5C5E\u6027 Dev -home.province=\u6E56\u5357\u7701 -home.city=\u957F\u6C99\u5E02 -home.desc=dev: \u7C4D\u8D2F\u6240\u5728\u5730\u4E3A${home.province} ${home.city}. -user.age=28 -user.desc=\u5F20\u4E09 - - - diff --git a/study-springboot-chapter01/src/main/resources/application-prod.properties b/study-springboot-chapter01/src/main/resources/application-prod.properties deleted file mode 100644 index 142faa395beca9ccb3cec53d6067b2bdcde58e8f..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/application-prod.properties +++ /dev/null @@ -1,15 +0,0 @@ -##SpringBoot\u5185\u7F6E\u5C5E\u6027\u67E5\u8BE2 -##https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties -##\u5B98\u65B9\u6587\u6863\u4E2D\u53C2\u8003\u6587\u6863\u7B2C\u4E00\u9879\uFF1AApplication Properties -##\u4FEE\u6539\u670D\u52A1\u5668\u7AEF\u53E3 -server.port=80 -##\u5173\u95ED\u8FD0\u884C\u65E5\u5FD7\u56FE\u6807\uFF08banner\uFF09 -spring.main.banner-mode=off -##\u8BBE\u7F6E\u65E5\u5FD7\u76F8\u5173 -logging.level.root=error -## \u5BB6\u4E61\u5C5E\u6027 Dev -home.province=\u5E7F\u4E1C\u7701 -home.city=\u5E7F\u5DDE\u5E02 -home.desc=dev: \u7C4D\u8D2F\u6240\u5728\u5730\u4E3A${home.province} ${home.city}. -user.age=82 -user.desc=\u674E\u56DB diff --git a/study-springboot-chapter01/src/main/resources/application.properties b/study-springboot-chapter01/src/main/resources/application.properties deleted file mode 100644 index 2130c79315cbf0a25ac8589a2514d346f33007cb..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -#\u6307\u5B9A\u9ED8\u8BA4\u7684\u73AF\u5883\u914D\u7F6E -spring.profiles.active=dev \ No newline at end of file diff --git a/study-springboot-chapter01/src/main/resources/application.yml b/study-springboot-chapter01/src/main/resources/application.yml deleted file mode 100644 index 95db8d45ae549a421f7bdfa1eb4f76abb991ada8..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/application.yml +++ /dev/null @@ -1,32 +0,0 @@ -#服务配置:key=value -server: - port: 81 -# #设置日志相关打印sql 语句 -logging: - level: - com.cbitedu: debug - org.springframework.web: debug -#关闭运行日志图标(banner) -spring: - datasource: - url: jdbc:mysql://localhost:3306/shopping?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC - username: root - password: 123456 - driver-class-name: com.mysql.cj.jdbc.Driver - #Thymeleaf模板引擎相关配置 - thymeleaf: - #prefix:指定模板所在的目录 - prefix: classpath:/templates/ - #check-tempate-location: 检查模板路径是否存在 - check-template-location: true - #cache: 是否缓存,开发模式下设置为false,避免改了模板还要重启服务器,线上设置为true,可以提高性能。 - cache: false - #suffix 配置模板后缀名 - suffix: .html - encoding: UTF-8 - mode: HTML5 - devtools: - restart: - enabled: true #设置开启热部署 - additional-paths: src/main/java #重启目录 - # exclude: static/**,public/**,db/**,i18n/**,templates/** #排除文件(不重启项目) \ No newline at end of file diff --git a/study-springboot-chapter01/src/main/resources/config/customconfig.properties b/study-springboot-chapter01/src/main/resources/config/customconfig.properties deleted file mode 100644 index 394f5805f566845832bb374138e3be52872051d2..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/config/customconfig.properties +++ /dev/null @@ -1,5 +0,0 @@ -#\u81EA\u5B9A\u4E49\u5C5E\u6027 -config.picpath=d:/upload/pic -config.videopath=d:/upload/video -#\u57DF\u540D\u670D\u52A1 -config.serverdomain=http://www.budaos.com diff --git a/study-springboot-chapter01/src/main/resources/logback-spring.xml b/study-springboot-chapter01/src/main/resources/logback-spring.xml deleted file mode 100644 index fb5715a24c65be5891dcdea85cf61211a4e2db27..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - %d{yyyy-MM-dd HH:mm:ss} [%level] - %m%n - - - DEBUG - ACCEPT - ACCEPT - - - - - log/mybatisplus_info.log - - %d{yyyy-MM-dd HH:mm:ss} [%class:%line] - %m%n - - - INFO - ACCEPT - DENY - - - log/mybatisplus_info.%d{yyyy-MM-dd}.log - 30 - - - - - log/mybatisplus_error.log - - %d{yyyy-MM-dd HH:mm:ss} [%class:%line] - %m%n - - - ERROR - ACCEPT - DENY - - - log/mybatisplus_error.%d{yyyy-MM-dd}.log - 30 - - - - - - - - - \ No newline at end of file diff --git a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/CustomConfigTest.java b/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/CustomConfigTest.java deleted file mode 100644 index 3c895493f1b12715bff7829c104c7d30ad3cac38..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/CustomConfigTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cbitedu.springboot.property; - -import com.cbitedu.springboot.config.CustomProperties; -import com.cbitedu.springboot.config.CustomValue; -import org.junit.Test; -import org.junit.runner.RunWith; -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; - -@RunWith(SpringRunner.class) -@SpringBootTest -//@EnableConfigurationProperties(CustomProperties.class) -public class CustomConfigTest { - private static final Logger LOGGER = LoggerFactory.getLogger(CustomConfigTest.class); - @Autowired - CustomProperties customProperties; - @Autowired - CustomValue customValue; - @Test - public void testConfig(){ - LOGGER.info("图片上传的路径为"+customValue.getPicPath()); - LOGGER.info("参数列表"+customValue.toString()); - } - - @Test - public void testConfig1(){ - LOGGER.info("图片上传的路径为"+customProperties.getPicPath()); - LOGGER.info("参数列表"+customProperties.toString()); - } -} diff --git a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/HomeProperties1.java b/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/HomeProperties1.java deleted file mode 100644 index 6391b0dd60f8eb66fd92227f4922b600161fa481..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/HomeProperties1.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.cbitedu.springboot.property; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -/** - * 家乡属性 - * - * Created by bysocket on 17/04/2017. - */ -@Component -public class HomeProperties1 { - - /** - * 省份 - */ - @Value("${home.province}") - private String province; - - /** - * 城市 - */ - @Value("${home.city}") - private String city; - - /** - * 描述 - */ - @Value("${home.desc}") - private String desc; - - public String getProvince() { - return province; - } - - public void setProvince(String province) { - this.province = province; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - @Override - public String toString() { - return "HomeProperties1{" + - "province='" + province + '\'' + - ", city='" + city + '\'' + - ", desc='" + desc + '\'' + - '}'; - } -} diff --git a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/PropertiesTest.java b/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/PropertiesTest.java deleted file mode 100644 index 28fdd169b5995071ec1e26b4bb2125fce20f64f3..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/property/PropertiesTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cbitedu.springboot.property; - -import com.cbitedu.springboot.config.HomeProperties; -import com.cbitedu.springboot.config.UserProperties; -import org.junit.Test; -import org.junit.runner.RunWith; -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; - -/** - * 读取配置文件测试类 - *

- * Created by cbitedu on 17/04/2021. - */ -@RunWith(SpringRunner.class) -@SpringBootTest -public class PropertiesTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(PropertiesTest.class); - - @Autowired - private UserProperties userProperties; - - @Autowired - private HomeProperties homeProperties; - - @Test - public void getHomeProperties() { - LOGGER.info("\n\n" + homeProperties.toString() + "\n"); - } - - @Test - public void randomTestUser() { - LOGGER.info("\n\n" + userProperties.toString() + "\n"); - } - -} diff --git a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/web/HelloWorldControllerTest.java b/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/web/HelloWorldControllerTest.java deleted file mode 100644 index cdb596f6f665c2ed2d6d93a59fb36880427e3a08..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/java/com/cbitedu/springboot/web/HelloWorldControllerTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cbitedu.springboot.web; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -/** - * Spring Boot HelloWorldController 测试 - {@link HelloWorldController} - * - * Created by cbitedu on 17/04/2021. - */ -public class HelloWorldControllerTest { - - @Test - public void testSayHello() { - assertEquals("Hello,World!",new HelloWorldController().sayHello()); - } -} diff --git a/study-springboot-chapter01/src/test/resouorces/application.yml b/study-springboot-chapter01/src/test/resouorces/application.yml deleted file mode 100644 index b52d7b1de75d3e892d3ef956c493e086ed96bb1c..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/resouorces/application.yml +++ /dev/null @@ -1,23 +0,0 @@ -#服务配置 -server: - port: 81 - -#关闭运行日志图标(banner) -spring: - main: - banner-mode:off - #设置日志相关 - logging.level.root=error - -## 家乡属性 -home: - province: 浙江省 - city: 温岭松门 - desc: 我家住在${home.province}的${home.city} - -## 随机属性 -user: - id: ${random.long} - age: ${random.int[1,200]} - desc: 程序员叫做${random.value} - uuid: ${random.uuid} \ No newline at end of file diff --git a/study-springboot-chapter01/src/test/resources/application.yml b/study-springboot-chapter01/src/test/resources/application.yml deleted file mode 100644 index 4c2c8925b4ed1966d641c2be508d1a201d95eae0..0000000000000000000000000000000000000000 --- a/study-springboot-chapter01/src/test/resources/application.yml +++ /dev/null @@ -1,17 +0,0 @@ -#服务配置 -server: - port: 81 -# #设置日志相关打印sql 语句 -logging: - level: - top.lrshuai.plus.springbootmybatisplus.test.mapper.ShipmentMapper: debug -#关闭运行日志图标(banner) -spring: - datasource: - url: jdbc:mysql://localhost:3306/shopping?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC - username: root - password: 123456 - driver-class-name: com.mysql.cj.jdbc.Driver -#mybatis-plus配置 -mybatis-plus: - mapper-locations: classpath*:mapper/*.xml \ No newline at end of file