commit 87ead839b0d9165f7bbc6ada124c0660136e5eff Author: zhang chengzhi <3144712872@qq.com> Date: Thu Jul 25 09:23:58 2024 +0800 7.25日考 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..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..0e6e289 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..aacffef --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..fc5db5e --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,311 @@ + + + + + \ 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/bwie-common/pom.xml b/bwie-common/pom.xml new file mode 100644 index 0000000..d5ab2f6 --- /dev/null +++ b/bwie-common/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.bwie + test_day07 + 1.0-SNAPSHOT + + + bwie-common + + + 17 + 17 + UTF-8 + + + + + + javax.servlet + javax.servlet-api + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + + io.jsonwebtoken + jjwt + 0.9.1 + + + + com.alibaba + fastjson + 1.2.80 + + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.apache.commons + commons-lang3 + + + + org.projectlombok + lombok + + + + diff --git a/bwie-common/src/main/java/com/bwie/common/domain/Stu.java b/bwie-common/src/main/java/com/bwie/common/domain/Stu.java new file mode 100644 index 0000000..24c6a72 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/domain/Stu.java @@ -0,0 +1,30 @@ +package com.bwie.common.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author:zhangchengzhi + * @Package:com.bwie.common.domain + * @Project:test_day06 + * @name:Stu + * @Date:2024/7/25 8:40 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Stu { +//学生id +private Integer stuId; +//学生姓名 +private String stuName; +//学生性别 +private String stuSex; +//学生分数 +private Integer stuScore; +//学生年龄 +private Integer stuAge; + + +} diff --git a/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java b/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java new file mode 100644 index 0000000..d14b7ca --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java @@ -0,0 +1,24 @@ +package com.bwie.common.domain.response; + +import lombok.Data; + +/** + * @ClassName: + * @Description: 登录相应实体类 + * @Author: zhuwenqiang + * @Date: 2024/2/24 + */ +@Data +public class JwtResponse { + + /** + * token 令牌 + */ + private String token; + + /** + * 过期时间 + */ + private String expireTimeStr; + +} diff --git a/bwie-system/pom.xml b/bwie-system/pom.xml new file mode 100644 index 0000000..b094753 --- /dev/null +++ b/bwie-system/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + + com.bwie + test_day07 + 1.0-SNAPSHOT + + + bwie-system + + + 17 + 17 + UTF-8 + + + + + com.bwie + bwie-common + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba + druid-spring-boot-starter + 1.2.8 + + + + mysql + mysql-connector-java + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.2.2 + + + + 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/bwie-system/src/main/java/com/bwie/system/SystemApplication.java b/bwie-system/src/main/java/com/bwie/system/SystemApplication.java new file mode 100644 index 0000000..e08e9d3 --- /dev/null +++ b/bwie-system/src/main/java/com/bwie/system/SystemApplication.java @@ -0,0 +1,28 @@ +package com.bwie.system; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @Author:zhangchengzhi + * @Package:com.bwie.system + * @Project:test_day06 + * @name:SystemApplication + * @Date:2024/7/25 8:44 + */ +@SpringBootApplication +public class SystemApplication { + + + + + public static void main(String[] args) { + SpringApplication.run(SystemApplication.class); + } + + + + + + +} diff --git a/bwie-system/src/main/java/com/bwie/system/controller/SystemController.java b/bwie-system/src/main/java/com/bwie/system/controller/SystemController.java new file mode 100644 index 0000000..3b95e43 --- /dev/null +++ b/bwie-system/src/main/java/com/bwie/system/controller/SystemController.java @@ -0,0 +1,66 @@ +package com.bwie.system.controller; + +import com.bwie.common.domain.Stu; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * @Author:zhangchengzhi + * @Package:com.bwie.system.controller + * @Project:test_day06 + * @name:SystemController + * @Date:2024/7/25 8:45 + */ +@RestController +@RequestMapping("stu") + +public class SystemController implements ApplicationRunner { + + + public static void main(String[] args) { + + + // 创建HashMap对象。 + HashMap stuHashMap = new HashMap<>(); + +//创建两个学生对象。 + Stu stu1 = new Stu(1,"张三","男",30,22); + + Stu stu2 = new Stu(2, "李四", "女", 60, 20); +//保存到HashMap集合中,键为学生编号,值为学生对象 + stuHashMap.put(stu1.getStuId(),stu1); + stuHashMap.put(stu2.getStuId(),stu2); + + System.out.println("第一种方式"); + stuHashMap.forEach((integer, stu) -> { + System.out.println(stu); + }); + + System.out.println("第二种方式"); + Set> entrySet = stuHashMap.entrySet(); + + for (Map.Entry stuEntry : entrySet) { + System.out.println(stuEntry.getValue()); + } + + System.out.println("第三种方式"); + Iterator> entryIterator = entrySet.iterator(); + while (entryIterator.hasNext()){ + Map.Entry stuEntry = entryIterator.next(); + Stu value = stuEntry.getValue(); + System.out.println(value); + } + } + + @Override + public void run(ApplicationArguments args) throws Exception { + + } +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..eb2cb79 --- /dev/null +++ b/pom.xml @@ -0,0 +1,64 @@ + + + 4.0.0 + + com.bwie + test_day07 + 1.0-SNAPSHOT + pom + + bwie-common + bwie-system + + + + 17 + 17 + 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/理论/img.png b/理论/img.png new file mode 100644 index 0000000..8b1d9c8 Binary files /dev/null and b/理论/img.png differ