commit 173d2d2e95690f84792edafed7facd6e22be8e1a Author: wxy <14293288+zysysys@user.noreply.gitee.com> Date: Mon Jul 22 09:25:06 2024 +0800 day4日考 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..c1ce1bb --- /dev/null +++ b/.idea/$PROJECT_FILE$ @@ -0,0 +1,468 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/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..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ 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..9fc3d5f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + 用户定义 + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..3dfd21f --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,465 @@ + + + + + \ No newline at end of file diff --git a/.idea/setting.xml b/.idea/setting.xml new file mode 100644 index 0000000..ed05fd8 --- /dev/null +++ b/.idea/setting.xml @@ -0,0 +1,8 @@ + + + + + \ 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/pom.xml b/pom.xml new file mode 100644 index 0000000..d4214d1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + com.bwie + day04 + 1.0-SNAPSHOT + + + 17 + 17 + UTF-8 + + + + + + + + org.springframework.boot + spring-boot-starter-web + 3.2.6 + + + + org.springframework.boot + spring-boot-starter-aop + 3.2.6 + + + + org.projectlombok + lombok + 1.18.30 + provided + + + + + + + diff --git a/src/main/java/com/bwie/Application.java b/src/main/java/com/bwie/Application.java new file mode 100644 index 0000000..74822e5 --- /dev/null +++ b/src/main/java/com/bwie/Application.java @@ -0,0 +1,17 @@ +package com.bwie; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @Author: wangxinyuan + * @Date: 2024/7/22 上午8:39 + */ +@SpringBootApplication +@EnableScheduling +public class Application { + public static void main(String[] args) { + SpringApplication.run(Application.class); + } +} diff --git a/src/main/java/com/bwie/ScheduledPrintNameService.java b/src/main/java/com/bwie/ScheduledPrintNameService.java new file mode 100644 index 0000000..0bb44b7 --- /dev/null +++ b/src/main/java/com/bwie/ScheduledPrintNameService.java @@ -0,0 +1,24 @@ +package com.bwie; +import lombok.extern.log4j.Log4j; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + + +/** + * @Author: wangxinyuan + * @Date: 2024/7/22 上午8:37 + */ +@Service +@Slf4j +public class ScheduledPrintNameService { //创建一个任务类 ScheduledPrintNameService + + + + @Scheduled(fixedDelay = 5000) + public void printName(){ + log.info("定时任务开始执行:"+"wangxinyuan"); + } +} diff --git a/src/main/java/com/bwie/images/5e0a046e7cd732dd9fa131bfee97a672.png b/src/main/java/com/bwie/images/5e0a046e7cd732dd9fa131bfee97a672.png new file mode 100644 index 0000000..13c90ef Binary files /dev/null and b/src/main/java/com/bwie/images/5e0a046e7cd732dd9fa131bfee97a672.png differ