commit f1defe3ab0ed1fdceb3cadcc42ddc6b023497490 Author: Yueng <14617246+YuengMeYuuer@user.noreply.gitee.com> Date: Mon Jul 22 10:34:52 2024 +0800 day_03.1 日考 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/$PROJECT_FILE$ b/.idea/$PROJECT_FILE$ new file mode 100644 index 0000000..58b7e3e --- /dev/null +++ b/.idea/$PROJECT_FILE$ @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63574ec --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8d66637 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2b05e07 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,23 @@ + + + + { + "isMigrated": true +} + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..9a7566c --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/day_3/day_4/.gitignore b/day_3/day_4/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/day_3/day_4/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/day_3/day_4/.idea/$PROJECT_FILE$ b/day_3/day_4/.idea/$PROJECT_FILE$ new file mode 100644 index 0000000..58b7e3e --- /dev/null +++ b/day_3/day_4/.idea/$PROJECT_FILE$ @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/day_3/day_4/.idea/.gitignore b/day_3/day_4/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/day_3/day_4/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/day_3/day_4/.idea/encodings.xml b/day_3/day_4/.idea/encodings.xml new file mode 100644 index 0000000..1033739 --- /dev/null +++ b/day_3/day_4/.idea/encodings.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day_3/day_4/.idea/inspectionProfiles/Project_Default.xml b/day_3/day_4/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8d66637 --- /dev/null +++ b/day_3/day_4/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/day_3/day_4/.idea/misc.xml b/day_3/day_4/.idea/misc.xml new file mode 100644 index 0000000..2b05e07 --- /dev/null +++ b/day_3/day_4/.idea/misc.xml @@ -0,0 +1,23 @@ + + + + { + "isMigrated": true +} + + + + + + + + + + + \ No newline at end of file diff --git a/day_3/day_4/.idea/qaplug_profiles.xml b/day_3/day_4/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..9a7566c --- /dev/null +++ b/day_3/day_4/.idea/qaplug_profiles.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/day_3/day_4/.idea/uiDesigner.xml b/day_3/day_4/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/day_3/day_4/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/day_3/day_4/bwie-common/pom.xml b/day_3/day_4/bwie-common/pom.xml new file mode 100644 index 0000000..b183d96 --- /dev/null +++ b/day_3/day_4/bwie-common/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + + com.bwie + day_4 + 1.0-SNAPSHOT + + + bwie-common + + + 8 + 8 + UTF-8 + + + + + + javax.servlet + javax.servlet-api + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + io.jsonwebtoken + jjwt + 0.9.1 + + + + com.alibaba + fastjson + 1.2.80 + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.apache.commons + commons-lang3 + + + + org.projectlombok + lombok + + + + cn.hutool + hutool-all + 5.8.3 + + + + com.aliyun + dysmsapi20170525 + 2.0.1 + + + + org.springframework.boot + spring-boot-starter-amqp + + + diff --git a/day_3/day_4/bwie-common/src/main/java/com/bwie/Main.java b/day_3/day_4/bwie-common/src/main/java/com/bwie/Main.java new file mode 100644 index 0000000..894d72f --- /dev/null +++ b/day_3/day_4/bwie-common/src/main/java/com/bwie/Main.java @@ -0,0 +1,14 @@ +package com.bwie; + +/** + * @Author:yang + * @Package:com.bwie + * @Project:Default (Template) Project + * @name:${NAME} + * @Date:2024/7/22 8:48 + */ +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/day_3/day_4/bwie-moudles/bwie-list/pom.xml b/day_3/day_4/bwie-moudles/bwie-list/pom.xml new file mode 100644 index 0000000..b1d6e77 --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + com.bwie + day_4 + 1.0-SNAPSHOT + ../../pom.xml + + + bwie-list + + + 8 + 8 + UTF-8 + + + + + com.bwie + bwie-common + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba + druid-spring-boot-starter + 1.2.8 + + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.4.1 + + + + org.springframework.boot + spring-boot-starter-test + test + + + com.github.tobato + fastdfs-client + 1.26.5 + + + + diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/ListApplication.java b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/ListApplication.java new file mode 100644 index 0000000..8d51a62 --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/ListApplication.java @@ -0,0 +1,13 @@ +package com.bwie; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@EnableScheduling +public class ListApplication { + public static void main(String[] args) { + SpringApplication.run(ListApplication.class,args); + } +} diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/config/InitEsRes.java b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/config/InitEsRes.java new file mode 100644 index 0000000..6547abf --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/config/InitEsRes.java @@ -0,0 +1,26 @@ +package com.bwie.config;//package com.bwie.loginlog.config; +// +//import lombok.Data; +//import org.apache.http.HttpHost; +//import org.elasticsearch.client.RestClient; +//import org.elasticsearch.client.RestHighLevelClient; +//import org.springframework.boot.context.properties.ConfigurationProperties; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +// +//@Configuration +//@ConfigurationProperties(prefix = "es") +//@Data +//public class InitEsRes { +// private String host; +// private int port; +// private String scheme; +// +// @Bean +// public RestHighLevelClient +// restHighLevelClient(){ +// return new RestHighLevelClient( +// RestClient.builder(new HttpHost(host,port,scheme)) +// ); +// } +//} diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/controller/ScheduledPrintNameController.java b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/controller/ScheduledPrintNameController.java new file mode 100644 index 0000000..1fbe5c1 --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/controller/ScheduledPrintNameController.java @@ -0,0 +1,30 @@ +package com.bwie.controller; + +import com.bwie.service.ScheduledPrintNameService; +import lombok.AllArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Controller; + +/** + * @Author:yang + * @Package:com.bwie.controller + * @Project:day_4 + * @name:ScheduledPrintNameController + * @Date:2024/7/22 8:50 + */ +@Controller +@AllArgsConstructor +public class ScheduledPrintNameController { + + private final ScheduledPrintNameService service; + private final static String BY_NAME = "me.yueng"; + + /** + * 打印名字 + */ + @Scheduled(cron = "0/5 * * * * ?") + public void ScheduledByName(){ + service.ScheduledByName(BY_NAME); + } + +} diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/ScheduledPrintNameService.java b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/ScheduledPrintNameService.java new file mode 100644 index 0000000..4799e20 --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/ScheduledPrintNameService.java @@ -0,0 +1,12 @@ +package com.bwie.service; + +/** + * @Author:yang + * @Package:com.bwie.service + * @Project:day_4 + * @name:ScheduledPrintNameService + * @Date:2024/7/22 8:50 + */ +public interface ScheduledPrintNameService { + void ScheduledByName(String byName); +} diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/impl/ScheduledPrintNameServiceImpl.java b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/impl/ScheduledPrintNameServiceImpl.java new file mode 100644 index 0000000..a2157ba --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/java/com/bwie/service/impl/ScheduledPrintNameServiceImpl.java @@ -0,0 +1,21 @@ +package com.bwie.service.impl; + +import com.bwie.service.ScheduledPrintNameService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author:yang + * @Package:com.bwie.service.impl + * @Project:day_4 + * @name:ScheduledPrintNameServiceImpl + * @Date:2024/7/22 8:51 + */ +@Service +@Slf4j +public class ScheduledPrintNameServiceImpl implements ScheduledPrintNameService { + @Override + public void ScheduledByName(String byName) { + log.info("byName值为:{}",byName); + } +} diff --git a/day_3/day_4/bwie-moudles/bwie-list/src/main/resources/bootstrap.yml b/day_3/day_4/bwie-moudles/bwie-list/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..afe4033 --- /dev/null +++ b/day_3/day_4/bwie-moudles/bwie-list/src/main/resources/bootstrap.yml @@ -0,0 +1,29 @@ +# Tomcat +server: + port: 9007 +# Spring +spring: + main: + allow-circular-references: true + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + application: + # 应用名称 + name: bwie-list + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 110.41.47.6:8848 + config: + # 配置中心地址 + server-addr: 110.41.47.6:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/day_3/day_4/bwie-moudles/pom.xml b/day_3/day_4/bwie-moudles/pom.xml new file mode 100644 index 0000000..92a0775 --- /dev/null +++ b/day_3/day_4/bwie-moudles/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + com.bwie + day_4 + 1.0-SNAPSHOT + + + bwie-moudles + + + 8 + 8 + UTF-8 + + + diff --git a/day_3/day_4/pom.xml b/day_3/day_4/pom.xml new file mode 100644 index 0000000..e82128d --- /dev/null +++ b/day_3/day_4/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.bwie + day_4 + 1.0-SNAPSHOT + pom + + bwie-common + bwie-moudles + bwie-moudles/bwie-list + + + + 8 + 8 + UTF-8 + + + + + + spring-boot-starter-parent + org.springframework.boot + 2.6.2 + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + 2021.0.0 + pom + import + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + 2021.1 + pom + import + + + + com.alibaba.nacos + nacos-client + 2.0.4 + + + + + com.bwie + bwie-common + 1.0-SNAPSHOT + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..61bc237 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.bwie + day_03.1 + 1.0-SNAPSHOT + + + 8 + 8 + UTF-8 + + + diff --git a/效果展示.doc b/效果展示.doc new file mode 100644 index 0000000..3bc15cc Binary files /dev/null and b/效果展示.doc differ diff --git a/理论/img.png b/理论/img.png new file mode 100644 index 0000000..4b41464 Binary files /dev/null and b/理论/img.png differ diff --git a/理论/img_1.png b/理论/img_1.png new file mode 100644 index 0000000..d6519a6 Binary files /dev/null and b/理论/img_1.png differ