From cb1352b3ff2382a77af16f7dfddc8f28cec16661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=90=E7=AD=B1=E7=AD=B1?= <1851433261@qq.com> Date: Thu, 9 Jul 2026 23:17:25 +0800 Subject: [PATCH] 1 --- "Redis\344\275\234\344\270\232/.gitignore" | 33 - .../.idea/.gitignore" | 10 + .../.idea/claudeCodeTabState.xml" | 20 + .../.idea/compiler.xml" | 15 + .../.idea/dataSources.xml" | 17 + .../.idea/encodings.xml" | 7 + .../.idea/jarRepositories.xml" | 20 + .../.idea/misc.xml" | 67 ++ "Redis\344\275\234\344\270\232/.idea/vcs.xml" | 6 + "Redis\344\275\234\344\270\232/1.txt" | 0 "Redis\344\275\234\344\270\232/HELP.md" | 20 + "Redis\344\275\234\344\270\232/openapi.json" | 392 ------------ "Redis\344\275\234\344\270\232/pom.xml" | 134 ---- .../chenghao/student/StudentApplication.java" | 13 - .../student/annotation/Loggable.java" | 11 - .../annotation/MonitorPerformance.java" | 12 - .../student/aspect/LoggingAspect.java" | 24 - .../student/aspect/PerformanceAspect.java" | 33 - .../student/common/BusinessException.java" | 28 - .../common/GlobalExceptionHandler.java" | 90 --- .../com/chenghao/student/common/Result.java" | 44 -- .../chenghao/student/config/RedisConfig.java" | 26 - .../student/controller/DemoController.java" | 20 - .../controller/StudentController.java" | 53 -- .../student/dto/StudentCreateDTO.java" | 24 - .../chenghao/student/dto/StudentQuery.java" | 20 - .../com/chenghao/student/entity/Student.java" | 18 - .../student/mapper/StudentMapper.java" | 32 - .../student/service/StudentService.java" | 15 - .../student/service/impl/DemoService.java" | 20 - .../service/impl/StudentServiceImpl.java" | 108 ---- .../com/chenghao/student/util/RedisUtil.java" | 374 ------------ .../com/chenghao/student/vo/StudentVO.java" | 15 - .../student/IocApplicationTests.java" | 13 - .../target/classes/application.yml" | 38 -- .../student/StudentApplication.class" | Bin 0 -> 720 bytes .../student/annotation/Loggable.class" | Bin 0 -> 401 bytes .../annotation/MonitorPerformance.class" | Bin 0 -> 421 bytes .../student/aspect/LoggingAspect.class" | Bin 0 -> 1662 bytes .../student/aspect/PerformanceAspect.class" | Bin 0 -> 2062 bytes .../student/common/BusinessException.class" | Bin 0 -> 1126 bytes .../common/GlobalExceptionHandler.class" | Bin 0 -> 7292 bytes .../com/chenghao/student/common/Result.class" | Bin 0 -> 4587 bytes .../controller/StudentController.class" | Bin 0 -> 3825 bytes .../student/dto/StudentCreateDTO.class" | Bin 0 -> 2821 bytes .../chenghao/student/dto/StudentQuery.class" | Bin 0 -> 3318 bytes .../chenghao/student/entity/Student.class" | Bin 0 -> 4203 bytes .../student/mapper/StudentMapper.class" | Bin 0 -> 1178 bytes .../student/service/StudentService.class" | Bin 0 -> 638 bytes .../service/impl/StudentServiceImpl.class" | Bin 0 -> 6373 bytes .../com/chenghao/student/vo/StudentVO.class" | Bin 0 -> 3748 bytes .../target/classes/mapper/StudentMapper.xml" | 0 .../compile/default-compile/createdFiles.lst" | 10 + .../compile/default-compile/inputFiles.lst" | 10 + .../student/IocApplicationTests.class" | Bin 0 -> 536 bytes ...347\273\237API\346\226\207\346\241\243.md" | 573 ------------------ 56 files changed, 202 insertions(+), 2163 deletions(-) delete mode 100644 "Redis\344\275\234\344\270\232/.gitignore" create mode 100644 "Redis\344\275\234\344\270\232/.idea/.gitignore" create mode 100644 "Redis\344\275\234\344\270\232/.idea/claudeCodeTabState.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/compiler.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/dataSources.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/encodings.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/jarRepositories.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/misc.xml" create mode 100644 "Redis\344\275\234\344\270\232/.idea/vcs.xml" create mode 100644 "Redis\344\275\234\344\270\232/1.txt" create mode 100644 "Redis\344\275\234\344\270\232/HELP.md" delete mode 100644 "Redis\344\275\234\344\270\232/openapi.json" delete mode 100644 "Redis\344\275\234\344\270\232/pom.xml" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/StudentApplication.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/Loggable.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/MonitorPerformance.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/LoggingAspect.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/PerformanceAspect.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/BusinessException.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/GlobalExceptionHandler.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/Result.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/config/RedisConfig.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/DemoController.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/StudentController.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentCreateDTO.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentQuery.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/entity/Student.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/mapper/StudentMapper.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/StudentService.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/DemoService.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/StudentServiceImpl.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/util/RedisUtil.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/vo/StudentVO.java" delete mode 100644 "Redis\344\275\234\344\270\232/src/test/java/com/chenghao/student/IocApplicationTests.java" rename "Redis\344\275\234\344\270\232/src/main/resources/application.yml" => "Redis\344\275\234\344\270\232/target/classes/application.yml" (65%) create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/StudentApplication.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/Loggable.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/MonitorPerformance.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/aspect/LoggingAspect.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/aspect/PerformanceAspect.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/common/BusinessException.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/common/GlobalExceptionHandler.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/common/Result.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/controller/StudentController.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentCreateDTO.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentQuery.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/entity/Student.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/mapper/StudentMapper.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/StudentService.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/impl/StudentServiceImpl.class" create mode 100644 "Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/vo/StudentVO.class" rename "Redis\344\275\234\344\270\232/src/main/resources/mapper/StudentMapper.xml" => "Redis\344\275\234\344\270\232/target/classes/mapper/StudentMapper.xml" (100%) create mode 100644 "Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" create mode 100644 "Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" create mode 100644 "Redis\344\275\234\344\270\232/target/test-classes/com/chenghao/student/IocApplicationTests.class" delete mode 100644 "Redis\344\275\234\344\270\232/\345\255\246\347\224\237\347\256\241\347\220\206\347\263\273\347\273\237API\346\226\207\346\241\243.md" diff --git "a/Redis\344\275\234\344\270\232/.gitignore" "b/Redis\344\275\234\344\270\232/.gitignore" deleted file mode 100644 index 549e00a..0000000 --- "a/Redis\344\275\234\344\270\232/.gitignore" +++ /dev/null @@ -1,33 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ diff --git "a/Redis\344\275\234\344\270\232/.idea/.gitignore" "b/Redis\344\275\234\344\270\232/.idea/.gitignore" new file mode 100644 index 0000000..30cf57e --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/.gitignore" @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/Redis\344\275\234\344\270\232/.idea/claudeCodeTabState.xml" "b/Redis\344\275\234\344\270\232/.idea/claudeCodeTabState.xml" new file mode 100644 index 0000000..1b85f06 --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/claudeCodeTabState.xml" @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/compiler.xml" "b/Redis\344\275\234\344\270\232/.idea/compiler.xml" new file mode 100644 index 0000000..2f1aeac --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/compiler.xml" @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/dataSources.xml" "b/Redis\344\275\234\344\270\232/.idea/dataSources.xml" new file mode 100644 index 0000000..b6625b1 --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/dataSources.xml" @@ -0,0 +1,17 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://localhost:3306/spring_ioc_demo + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/encodings.xml" "b/Redis\344\275\234\344\270\232/.idea/encodings.xml" new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/encodings.xml" @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/jarRepositories.xml" "b/Redis\344\275\234\344\270\232/.idea/jarRepositories.xml" new file mode 100644 index 0000000..abb532a --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/jarRepositories.xml" @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/misc.xml" "b/Redis\344\275\234\344\270\232/.idea/misc.xml" new file mode 100644 index 0000000..c50f98b --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/misc.xml" @@ -0,0 +1,67 @@ + + + + + + + + + + + + + CastNumeric issuesJava + + + Compiler issuesJava + + + EmbeddedPerformanceJava + + + Java + + + Java 5Java language level migration aidsJava + + + Java 9Java language level migration aidsJava + + + Java interop issuesKotlin + + + Java language level migration aidsJava + + + Kotlin + + + Numeric issuesJava + + + PerformanceJava + + + Probable bugsKotlin + + + Style issuesKotlin + + + + + User defined + + + + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/.idea/vcs.xml" "b/Redis\344\275\234\344\270\232/.idea/vcs.xml" new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ "b/Redis\344\275\234\344\270\232/.idea/vcs.xml" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/1.txt" "b/Redis\344\275\234\344\270\232/1.txt" new file mode 100644 index 0000000..e69de29 diff --git "a/Redis\344\275\234\344\270\232/HELP.md" "b/Redis\344\275\234\344\270\232/HELP.md" new file mode 100644 index 0000000..5a8c912 --- /dev/null +++ "b/Redis\344\275\234\344\270\232/HELP.md" @@ -0,0 +1,20 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.6/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.6/maven-plugin/reference/html/#build-image) +* [Spring Web](https://docs.spring.io/spring-boot/docs/2.7.6/reference/htmlsingle/#web) +* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.7.6/reference/htmlsingle/#using.devtools) + +### Guides + +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) + diff --git "a/Redis\344\275\234\344\270\232/openapi.json" "b/Redis\344\275\234\344\270\232/openapi.json" deleted file mode 100644 index e30fa59..0000000 --- "a/Redis\344\275\234\344\270\232/openapi.json" +++ /dev/null @@ -1,392 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "学生管理系统API", - "description": "学生信息管理系统的RESTful API接口文档", - "version": "1.0.0" - }, - "servers": [ - { - "url": "http://localhost:8080", - "description": "本地开发环境" - } - ], - "tags": [ - { - "name": "学生管理", - "description": "学生信息的增删改查操作" - } - ], - "paths": { - "/api/student/{id}": { - "get": { - "tags": ["学生管理"], - "summary": "根据ID查询学生", - "operationId": "getStudentById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 - }, - "message": { - "type": "string", - "example": "成功" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "email": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "createdAt": { - "type": "string", - "format": "date-time" - } - } - } - } - } - } - } - } - } - }, - "put": { - "tags": ["学生管理"], - "summary": "更新学生信息", - "operationId": "updateStudent", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["name", "phone"], - "properties": { - "name": { - "type": "string", - "minLength": 2, - "maxLength": 20, - "example": "张三" - }, - "phone": { - "type": "string", - "pattern": "^1[3-9]\\d{9}$", - "example": "13800138000" - }, - "email": { - "type": "string", - "format": "email", - "example": "zhangsan@example.com" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 - }, - "message": { - "type": "string", - "example": "更新成功" - }, - "data": { - "type": "object", - "nullable": true - } - } - } - } - } - } - } - }, - "delete": { - "tags": ["学生管理"], - "summary": "删除学生", - "operationId": "deleteStudent", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 - }, - "message": { - "type": "string", - "example": "删除成功" - }, - "data": { - "type": "object", - "nullable": true - } - } - } - } - } - } - } - } - }, - "/api/student": { - "post": { - "tags": ["学生管理"], - "summary": "创建学生", - "operationId": "createStudent", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["name", "phone"], - "properties": { - "name": { - "type": "string", - "minLength": 2, - "maxLength": 20, - "example": "王五" - }, - "phone": { - "type": "string", - "pattern": "^1[3-9]\\d{9}$", - "example": "13900139000" - }, - "email": { - "type": "string", - "format": "email", - "example": "wangwu@example.com" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 - }, - "message": { - "type": "string", - "example": "创建成功" - }, - "data": { - "type": "integer", - "format": "int64", - "example": 3 - } - } - } - } - } - } - } - } - }, - "/api/student/page": { - "get": { - "tags": ["学生管理"], - "summary": "分页查询学生列表", - "operationId": "pageStudent", - "parameters": [ - { - "name": "pageNum", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "minimum": 1, - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "minimum": 1, - "default": 10 - } - }, - { - "name": "keyword", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "enum": [0, 1] - } - } - ], - "responses": { - "200": { - "description": "成功", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "example": 200 - }, - "message": { - "type": "string", - "example": "成功" - }, - "data": { - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "list": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "email": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "createdAt": { - "type": "string", - "format": "date-time" - } - } - } - }, - "pageNum": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "pages": { - "type": "integer" - }, - "isFirstPage": { - "type": "boolean" - }, - "isLastPage": { - "type": "boolean" - }, - "hasPreviousPage": { - "type": "boolean" - }, - "hasNextPage": { - "type": "boolean" - } - } - } - } - } - } - } - } - } - } - } - } -} diff --git "a/Redis\344\275\234\344\270\232/pom.xml" "b/Redis\344\275\234\344\270\232/pom.xml" deleted file mode 100644 index 07e2da4..0000000 --- "a/Redis\344\275\234\344\270\232/pom.xml" +++ /dev/null @@ -1,134 +0,0 @@ - - - 4.0.0 - com.chenghao - student - 0.0.1-SNAPSHOT - IOC - IOC - - 1.8 - UTF-8 - UTF-8 - 2.7.18 - - - - - org.springframework.boot - spring-boot-starter-web - - - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-aop - - - - - org.projectlombok - lombok - - - - org.mybatis.spring.boot - mybatis-spring-boot-starter - 2.3.0 - - - - - com.mysql - mysql-connector-j - runtime - - - - - org.springframework.boot - spring-boot-starter-jdbc - - - - com.alibaba - druid-spring-boot-starter - 1.2.1 - - - org.springframework.boot - spring-boot-starter-validation - - - - com.github.pagehelper - pagehelper-spring-boot-starter - 1.4.7 - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - UTF-8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - com.chenghao.student.StudentApplication - true - - - - repackage - - repackage - - - - - - - \ No newline at end of file diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/StudentApplication.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/StudentApplication.java" deleted file mode 100644 index 14c9558..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/StudentApplication.java" +++ /dev/null @@ -1,13 +0,0 @@ -package com.chenghao.student; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class StudentApplication { - - public static void main(String[] args) { - SpringApplication.run(StudentApplication.class, args); - } - -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/Loggable.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/Loggable.java" deleted file mode 100644 index 140923f..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/Loggable.java" +++ /dev/null @@ -1,11 +0,0 @@ -package com.chenghao.student.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface Loggable { -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/MonitorPerformance.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/MonitorPerformance.java" deleted file mode 100644 index 145ef6b..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/annotation/MonitorPerformance.java" +++ /dev/null @@ -1,12 +0,0 @@ -package com.chenghao.student.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface MonitorPerformance { - -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/LoggingAspect.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/LoggingAspect.java" deleted file mode 100644 index 0c30e97..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/LoggingAspect.java" +++ /dev/null @@ -1,24 +0,0 @@ -package com.chenghao.student.aspect; - -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Aspect -@Component -@Slf4j -public class LoggingAspect { - - @Around("@annotation(com.chenghao.student.annotation.Loggable)") - public Object logMethod(ProceedingJoinPoint joinPoint) throws Throwable{ - String methodName = joinPoint.getSignature().toShortString(); - Object[] args = joinPoint.getArgs(); - log.info("[调用开始] 方法:{},参数:{}",methodName,args); - - Object result = joinPoint.proceed(); - log.info("[调用结束] 方法:{},返回值:{}",methodName,result); - return result; - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/PerformanceAspect.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/PerformanceAspect.java" deleted file mode 100644 index 89400ba..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/aspect/PerformanceAspect.java" +++ /dev/null @@ -1,33 +0,0 @@ -package com.chenghao.student.aspect; - -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Component -@Aspect -@Slf4j -public class PerformanceAspect { - - @Around("@annotation(com.chenghao.student.annotation.MonitorPerformance)") - public Object monitorPerformance(ProceedingJoinPoint joinPoint) throws Throwable{ - long startTime = System.currentTimeMillis(); - String methodName = joinPoint.getSignature().getName(); - - try { - Object result = joinPoint.proceed(); - long endTime = System.currentTimeMillis(); - long duration = endTime- startTime; - - log.info("执行时间为:{}",duration); - return result; - }catch (Exception e){ - long endTime = System.currentTimeMillis(); - log.error("方法{}执行失败,耗时{}ms,错误{}", - methodName,endTime-startTime,e.getMessage()); - throw e; - } - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/BusinessException.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/BusinessException.java" deleted file mode 100644 index 504b6c5..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/BusinessException.java" +++ /dev/null @@ -1,28 +0,0 @@ -package com.chenghao.student.common; - -import lombok.Getter; - -@Getter -public class BusinessException extends RuntimeException { - private Integer code; - - public BusinessException(String message) { - super(message); - this.code = 400; - } - - public BusinessException(Integer code, String message) { - super(message); - this.code = code; - } - - public BusinessException(String message, Throwable cause) { - super(message, cause); - this.code = 400; - } - - public BusinessException(Integer code, String message, Throwable cause) { - super(message, cause); - this.code = code; - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/GlobalExceptionHandler.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/GlobalExceptionHandler.java" deleted file mode 100644 index ce49fd2..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/GlobalExceptionHandler.java" +++ /dev/null @@ -1,90 +0,0 @@ -package com.chenghao.student.common; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindException; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; - -import javax.servlet.http.HttpServletRequest; -import java.util.stream.Collectors; - -@Slf4j -@RestControllerAdvice -public class GlobalExceptionHandler { - - /** - * 业务异常处理 - */ - @ExceptionHandler(BusinessException.class) - public Result handleBusinessException(BusinessException e, HttpServletRequest request) { - log.warn("业务异常: uri={}, message={}", request.getRequestURI(), e.getMessage()); - return Result.error(e.getCode(), e.getMessage()); - } - - /** - * 参数校验异常(@Valid 注解校验失败) - */ - @ExceptionHandler(MethodArgumentNotValidException.class) - public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e, HttpServletRequest request) { - String errorMessage = e.getBindingResult().getFieldErrors().stream() - .map(FieldError::getDefaultMessage) - .collect(Collectors.joining(", ")); - log.warn("参数校验失败: uri={}, message={}", request.getRequestURI(), errorMessage); - return Result.error(400, "参数校验失败: " + errorMessage); - } - - /** - * 参数绑定异常(表单提交校验失败) - */ - @ExceptionHandler(BindException.class) - public Result handleBindException(BindException e, HttpServletRequest request) { - String errorMessage = e.getBindingResult().getFieldErrors().stream() - .map(FieldError::getDefaultMessage) - .collect(Collectors.joining(", ")); - log.warn("参数绑定失败: uri={}, message={}", request.getRequestURI(), errorMessage); - return Result.error(400, "参数错误: " + errorMessage); - } - - /** - * 参数类型不匹配异常 - */ - @ExceptionHandler(MethodArgumentTypeMismatchException.class) - public Result handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) { - log.warn("参数类型不匹配: uri={}, param={}, message={}", - request.getRequestURI(), e.getName(), e.getMessage()); - return Result.error(400, "参数类型错误: " + e.getName()); - } - - /** - * 空指针异常 - */ - @ExceptionHandler(NullPointerException.class) - public Result handleNullPointerException(NullPointerException e, HttpServletRequest request) { - log.error("空指针异常: uri={}", request.getRequestURI(), e); - return Result.error(500, "系统内部错误"); - } - - /** - * 非法参数异常 - */ - @ExceptionHandler(IllegalArgumentException.class) - public Result handleIllegalArgumentException(IllegalArgumentException e, HttpServletRequest request) { - log.warn("非法参数异常: uri={}, message={}", request.getRequestURI(), e.getMessage()); - return Result.error(400, e.getMessage()); - } - - /** - * 通用异常处理(兜底) - */ - @ExceptionHandler(Exception.class) - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - public Result handleException(Exception e, HttpServletRequest request) { - log.error("系统异常: uri={}, message={}", request.getRequestURI(), e.getMessage(), e); - return Result.error(500, "系统异常,请联系管理员"); - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/Result.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/Result.java" deleted file mode 100644 index 0278795..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/common/Result.java" +++ /dev/null @@ -1,44 +0,0 @@ -package com.chenghao.student.common; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class Result { - - private Integer code; - private String message; - private T data; - - public Result(int code, String message) { - this.code = code; - this.message = message; - } - - public static Result success() { - return new Result<>(200, "成功", null); - } - - public static Result success(T data) { - return new Result<>(200, "成功", data); - } - public static Result success(String message) { - return new Result<>(200, message); - } - - public static Result error(String message) { - return new Result<>(400, message, null); - } - - public static Result error(Integer code, String message) { - return new Result<>(code, message, null); - } - public static Result success(String message, T data) { - return new Result<>( 200 ,message, data); - } - - -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/config/RedisConfig.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/config/RedisConfig.java" deleted file mode 100644 index 2156890..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/config/RedisConfig.java" +++ /dev/null @@ -1,26 +0,0 @@ -package com.chenghao.student.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -@Configuration -public class RedisConfig { - - @Bean - public RedisTemplate redisTemplate(RedisConnectionFactory factory){ - RedisTemplate template = new RedisTemplate<>(); - template.setConnectionFactory(factory); - - template.setKeySerializer(new StringRedisSerializer()); - template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); - template.setHashKeySerializer(new StringRedisSerializer()); - template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer()); - - template.afterPropertiesSet(); - return template; - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/DemoController.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/DemoController.java" deleted file mode 100644 index 1a19517..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/DemoController.java" +++ /dev/null @@ -1,20 +0,0 @@ -package com.chenghao.student.controller; - -import com.chenghao.student.common.Result; -import com.chenghao.student.service.impl.DemoService; -import lombok.AllArgsConstructor; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/api/demo") -@AllArgsConstructor -public class DemoController { - - private final DemoService demoService; - - @GetMapping("/test") - public Result test() { - demoService.demo(); - return Result.success("Redis 操作完成"); - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/StudentController.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/StudentController.java" deleted file mode 100644 index 047f3f0..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/controller/StudentController.java" +++ /dev/null @@ -1,53 +0,0 @@ -package com.chenghao.student.controller; - -import com.chenghao.student.common.Result; -import com.chenghao.student.dto.StudentCreateDTO; -import com.chenghao.student.dto.StudentQuery; -import com.chenghao.student.entity.Student; -import com.chenghao.student.service.StudentService; -import com.chenghao.student.vo.StudentVO; -import com.github.pagehelper.PageInfo; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -@RestController -@RequestMapping("/api/student") -@AllArgsConstructor -public class StudentController { - - private final StudentService studentService; - - @GetMapping("/{id}") - Result getById(@PathVariable Long id){ - StudentVO studentVO = studentService.getById(id); - return Result.success(studentVO); - } - - @GetMapping("/page") - Result> page(@Valid StudentQuery query){ - PageInfo pageInfo = studentService.page(query); - return Result.success(pageInfo); - } - - @PostMapping - Result create(@Valid @RequestBody StudentCreateDTO dto){ - Long id = studentService.create(dto); - return Result.success("创建成功",id); - } - - @PutMapping("/{id}") - public Result update(@PathVariable Long id, - @Valid @RequestBody StudentCreateDTO dto){ - studentService.update(id,dto); - return Result.success("更新成功"); - } - - @DeleteMapping("/{id}") - Result delete(@PathVariable Long id){ - studentService.delete(id); - return Result.success("删除成功"); - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentCreateDTO.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentCreateDTO.java" deleted file mode 100644 index 7dbf685..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentCreateDTO.java" +++ /dev/null @@ -1,24 +0,0 @@ -package com.chenghao.student.dto; - -import lombok.Data; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; -import java.math.BigDecimal; - -@Data -public class StudentCreateDTO { - - @NotBlank(message = "姓名不能为空") - @Size(min = 2 ,max = 20,message = "姓名长度为2-20个字符") - private String name; - - @NotBlank(message = "手机号不能为空") - @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式不正确") - private String phone; - - @Email(message = "邮箱格式不正确") - private String email; -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentQuery.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentQuery.java" deleted file mode 100644 index 016c821..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/dto/StudentQuery.java" +++ /dev/null @@ -1,20 +0,0 @@ -package com.chenghao.student.dto; - -import lombok.Data; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; - -@Data -public class StudentQuery { - private String keyword; - private Integer status; - - @NotNull(message = "页码不能为空") - @Min(value = 1, message = "页码最小为1") - private Integer pageNum = 1; - - @NotNull(message = "每页大小不能为空") - @Min(value = 1,message = "每页大小最小为1") - private Integer pageSize = 10; -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/entity/Student.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/entity/Student.java" deleted file mode 100644 index 4e9cde1..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/entity/Student.java" +++ /dev/null @@ -1,18 +0,0 @@ -package com.chenghao.student.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; - - -@Data -public class Student { - private Long id; - private String name; - private String phone; - private String email; - private Integer status; - private LocalDateTime createdAt; - private LocalDateTime updatedAt; -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/mapper/StudentMapper.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/mapper/StudentMapper.java" deleted file mode 100644 index 3cfff4b..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/mapper/StudentMapper.java" +++ /dev/null @@ -1,32 +0,0 @@ -package com.chenghao.student.mapper; - -import com.chenghao.student.entity.Student; -import com.chenghao.student.vo.StudentVO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -@Mapper -public interface StudentMapper { - - - Student selectById(@Param("id") Long id); - - List selectList(@Param("status")Integer status,@Param("keyword")String keyword); - - int insert(Student student); - - int update(Student student); - - List selectByIds(List idsList); - - void insertBatch(List studentsList); - - int deleteById(@Param("id") Long id); - - int softDeleteById(@Param("id") Long id); - - int countByPhone(@Param("phone") String phone); -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/StudentService.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/StudentService.java" deleted file mode 100644 index 047101e..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/StudentService.java" +++ /dev/null @@ -1,15 +0,0 @@ -package com.chenghao.student.service; - -import com.chenghao.student.dto.StudentCreateDTO; -import com.chenghao.student.dto.StudentQuery; -import com.chenghao.student.entity.Student; -import com.chenghao.student.vo.StudentVO; -import com.github.pagehelper.PageInfo; - -public interface StudentService { - StudentVO getById(Long id); - PageInfo page(StudentQuery query); - Long create(StudentCreateDTO dto); - void update(Long id,StudentCreateDTO dto); - void delete(Long id); -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/DemoService.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/DemoService.java" deleted file mode 100644 index b2e4dbc..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/DemoService.java" +++ /dev/null @@ -1,20 +0,0 @@ -package com.chenghao.student.service.impl; - -import com.chenghao.student.util.RedisUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class DemoService { - - @Autowired - private RedisUtil redisUtil; - public void demo(){ - redisUtil.set("name","张三"); - Object name = redisUtil.get("name"); - System.out.println("name = " + name); - redisUtil.hSet("user:1","name","zhangsan"); - Object username = redisUtil.hGet("user:1", "name"); - - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/StudentServiceImpl.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/StudentServiceImpl.java" deleted file mode 100644 index a890362..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/service/impl/StudentServiceImpl.java" +++ /dev/null @@ -1,108 +0,0 @@ -package com.chenghao.student.service.impl; - -import com.chenghao.student.common.BusinessException; -import com.chenghao.student.dto.StudentCreateDTO; -import com.chenghao.student.dto.StudentQuery; -import com.chenghao.student.entity.Student; -import com.chenghao.student.mapper.StudentMapper; -import com.chenghao.student.service.StudentService; -import com.chenghao.student.vo.StudentVO; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import lombok.AllArgsConstructor; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.stream.Collectors; - -@Service -@AllArgsConstructor -public class StudentServiceImpl implements StudentService { - - private final StudentMapper studentMapper; - @Override - public StudentVO getById(Long id) { - Student student = studentMapper.selectById(id); - if (student == null){ - throw new BusinessException("学生不存在!"); - } - return toVO(student); - } - - @Override - public PageInfo page(StudentQuery query) { - PageHelper.startPage(query.getPageNum(),query.getPageSize()); - List students = studentMapper.selectList(query.getStatus(), query.getKeyword()); - List voList = students.stream().map(this::toVO).collect(Collectors.toList()); - PageInfo pageInfo = new PageInfo<>(voList); - return pageInfo; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Long create(StudentCreateDTO dto) { - if (studentMapper.countByPhone(dto.getPhone())>0){ - throw new BusinessException("手机号已被注册!"); - } - Student student = new Student(); - BeanUtils.copyProperties(dto,student); - student.setStatus(1); - studentMapper.insert(student); - return student.getId(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Long id, StudentCreateDTO dto) { - Student existing = studentMapper.selectById(id); - if (existing == null){ - throw new BusinessException("学生不存在!"); - } - if (StringUtils.hasText(dto.getPhone()) - && !existing.getPhone().equals(dto.getPhone()) - && studentMapper.countByPhone(dto.getPhone())>0){ - throw new BusinessException("手机号已经被其他学生使用!"); - } - Student student = new Student(); - BeanUtils.copyProperties(dto,student); - student.setId(id); - studentMapper.update(student); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(Long id) { - if (studentMapper.selectById(id)==null){ - throw new BusinessException("学生不存在!"); - } - studentMapper.deleteById(id); - } - - void testCRUD(){ - Student student = new Student(); - student.setName("张三"); - student.setPhone("13800138000"); - student.setStatus(1); - int rows = studentMapper.insert(student); - System.out.println("插入行数:"+ rows); - System.out.println("自增id:"+student.getId()); - - Student found = studentMapper.selectById(student.getId()); - System.out.println("查询结果:"+found.getName()); - - found.setName("张三(已修改)"); - found.setUpdatedAt(LocalDateTime.now()); - int updateRows = studentMapper.update(found); - System.out.println("更新行数:"+ updateRows); - - } - private StudentVO toVO(Student student){ - StudentVO studentVO = new StudentVO(); - BeanUtils.copyProperties(student,studentVO); - return studentVO; - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/util/RedisUtil.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/util/RedisUtil.java" deleted file mode 100644 index 5827673..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/util/RedisUtil.java" +++ /dev/null @@ -1,374 +0,0 @@ -package com.chenghao.student.util; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.redis.core.*; -import org.springframework.stereotype.Component; - -import java.util.*; -import java.util.concurrent.TimeUnit; - -@Slf4j -@Component -@RequiredArgsConstructor -public class RedisUtil { - - private final RedisTemplate redisTemplate; - - // ==================== Key ==================== - - public boolean hasKey(String key) { - try { - return Boolean.TRUE.equals(redisTemplate.hasKey(key)); - } catch (Exception e) { - log.error("redis hasKey error, key: {}", key, e); - return false; - } - } - - public boolean expire(String key, long timeout, TimeUnit unit) { - try { - return Boolean.TRUE.equals(redisTemplate.expire(key, timeout, unit)); - } catch (Exception e) { - log.error("redis expire error, key: {}, timeout: {}, unit: {}", key, timeout, unit, e); - return false; - } - } - - public long getExpire(String key, TimeUnit unit) { - Long expire = redisTemplate.getExpire(key, unit); - return expire != null ? expire : -2; - } - - public boolean delete(String key) { - try { - return Boolean.TRUE.equals(redisTemplate.delete(key)); - } catch (Exception e) { - log.error("redis delete error, key: {}", key, e); - return false; - } - } - - public long delete(Collection keys) { - try { - Long count = redisTemplate.delete(keys); - return count != null ? count : 0; - } catch (Exception e) { - log.error("redis batch delete error, keys: {}", keys, e); - return 0; - } - } - - public Set keys(String pattern) { - try { - return redisTemplate.keys(pattern); - } catch (Exception e) { - log.error("redis keys error, pattern: {}", pattern, e); - return Collections.emptySet(); - } - } - - // ==================== String ==================== - - public void set(String key, Object value) { - try { - redisTemplate.opsForValue().set(key, value); - log.debug("redis set, key: {}, value: {}", key, value); - } catch (Exception e) { - log.error("redis set error, key: {}, value: {}", key, value, e); - } - } - - public void set(String key, Object value, long timeout, TimeUnit unit) { - try { - redisTemplate.opsForValue().set(key, value, timeout, unit); - log.debug("redis set with timeout, key: {}, value: {}, timeout: {}, unit: {}", key, value, timeout, unit); - } catch (Exception e) { - log.error("redis set error, key: {}, value: {}, timeout: {}, unit: {}", key, value, timeout, unit, e); - } - } - - public boolean setIfAbsent(String key, Object value) { - try { - return Boolean.TRUE.equals(redisTemplate.opsForValue().setIfAbsent(key, value)); - } catch (Exception e) { - log.error("redis setIfAbsent error, key: {}, value: {}", key, value, e); - return false; - } - } - - public Object get(String key) { - try { - return key == null ? null : redisTemplate.opsForValue().get(key); - } catch (Exception e) { - log.error("redis get error, key: {}", key, e); - return null; - } - } - - @SuppressWarnings("unchecked") - public T get(String key, Class clazz) { - Object value = get(key); - if (value == null) { - return null; - } - if (clazz.isInstance(value)) { - return (T) value; - } - log.warn("redis get type mismatch, key: {}, expected: {}, actual: {}", key, clazz.getSimpleName(), value.getClass().getSimpleName()); - return null; - } - - public long incr(String key, long delta) { - try { - Long result = redisTemplate.opsForValue().increment(key, delta); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis incr error, key: {}, delta: {}", key, delta, e); - return 0; - } - } - - // ==================== Hash ==================== - - public void hSet(String key, String hashKey, Object value) { - try { - redisTemplate.opsForHash().put(key, hashKey, value); - log.debug("redis hSet, key: {}, hashKey: {}, value: {}", key, hashKey, value); - } catch (Exception e) { - log.error("redis hSet error, key: {}, hashKey: {}, value: {}", key, hashKey, value, e); - } - } - - public void hSetAll(String key, Map map) { - try { - redisTemplate.opsForHash().putAll(key, map); - log.debug("redis hSetAll, key: {}, map: {}", key, map); - } catch (Exception e) { - log.error("redis hSetAll error, key: {}, map: {}", key, map, e); - } - } - - public Object hGet(String key, String hashKey) { - try { - return redisTemplate.opsForHash().get(key, hashKey); - } catch (Exception e) { - log.error("redis hGet error, key: {}, hashKey: {}", key, hashKey, e); - return null; - } - } - - public Map hGetAll(String key) { - try { - return redisTemplate.opsForHash().entries(key); - } catch (Exception e) { - log.error("redis hGetAll error, key: {}", key, e); - return Collections.emptyMap(); - } - } - - public long hDelete(String key, Object... hashKeys) { - try { - Long result = redisTemplate.opsForHash().delete(key, hashKeys); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis hDelete error, key: {}, hashKeys: {}", key, hashKeys, e); - return 0; - } - } - - public boolean hHasKey(String key, String hashKey) { - try { - return redisTemplate.opsForHash().hasKey(key, hashKey); - } catch (Exception e) { - log.error("redis hHasKey error, key: {}, hashKey: {}", key, hashKey, e); - return false; - } - } - - public long hIncr(String key, String hashKey, long delta) { - try { - Long result = redisTemplate.opsForHash().increment(key, hashKey, delta); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis hIncr error, key: {}, hashKey: {}, delta: {}", key, hashKey, delta, e); - return 0; - } - } - - // ==================== List ==================== - - public long lLeftPush(String key, Object value) { - try { - Long result = redisTemplate.opsForList().leftPush(key, value); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis lLeftPush error, key: {}, value: {}", key, value, e); - return 0; - } - } - - public long lRightPush(String key, Object value) { - try { - Long result = redisTemplate.opsForList().rightPush(key, value); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis lRightPush error, key: {}, value: {}", key, value, e); - return 0; - } - } - - public Object lLeftPop(String key) { - try { - return redisTemplate.opsForList().leftPop(key); - } catch (Exception e) { - log.error("redis lLeftPop error, key: {}", key, e); - return null; - } - } - - public Object lRightPop(String key) { - try { - return redisTemplate.opsForList().rightPop(key); - } catch (Exception e) { - log.error("redis lRightPop error, key: {}", key, e); - return null; - } - } - - public List lRange(String key, long start, long end) { - try { - return redisTemplate.opsForList().range(key, start, end); - } catch (Exception e) { - log.error("redis lRange error, key: {}, start: {}, end: {}", key, start, end, e); - return Collections.emptyList(); - } - } - - public long lSize(String key) { - try { - Long result = redisTemplate.opsForList().size(key); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis lSize error, key: {}", key, e); - return 0; - } - } - - // ==================== Set ==================== - - public long sAdd(String key, Object... values) { - try { - Long result = redisTemplate.opsForSet().add(key, values); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis sAdd error, key: {}, values: {}", key, values, e); - return 0; - } - } - - public long sRemove(String key, Object... values) { - try { - Long result = redisTemplate.opsForSet().remove(key, values); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis sRemove error, key: {}, values: {}", key, values, e); - return 0; - } - } - - public Set sMembers(String key) { - try { - return redisTemplate.opsForSet().members(key); - } catch (Exception e) { - log.error("redis sMembers error, key: {}", key, e); - return Collections.emptySet(); - } - } - - public boolean sIsMember(String key, Object value) { - try { - return Boolean.TRUE.equals(redisTemplate.opsForSet().isMember(key, value)); - } catch (Exception e) { - log.error("redis sIsMember error, key: {}, value: {}", key, value, e); - return false; - } - } - - public long sSize(String key) { - try { - Long result = redisTemplate.opsForSet().size(key); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis sSize error, key: {}", key, e); - return 0; - } - } - - // ==================== ZSet ==================== - - public boolean zAdd(String key, Object value, double score) { - try { - return Boolean.TRUE.equals(redisTemplate.opsForZSet().add(key, value, score)); - } catch (Exception e) { - log.error("redis zAdd error, key: {}, value: {}, score: {}", key, value, score, e); - return false; - } - } - - public long zRemove(String key, Object... values) { - try { - Long result = redisTemplate.opsForZSet().remove(key, values); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis zRemove error, key: {}, values: {}", key, values, e); - return 0; - } - } - - public Set zRange(String key, long start, long end) { - try { - return redisTemplate.opsForZSet().range(key, start, end); - } catch (Exception e) { - log.error("redis zRange error, key: {}, start: {}, end: {}", key, start, end, e); - return Collections.emptySet(); - } - } - - public Set zRangeByScore(String key, double min, double max) { - try { - return redisTemplate.opsForZSet().rangeByScore(key, min, max); - } catch (Exception e) { - log.error("redis zRangeByScore error, key: {}, min: {}, max: {}", key, min, max, e); - return Collections.emptySet(); - } - } - - public Set> zRangeWithScores(String key, long start, long end) { - try { - return redisTemplate.opsForZSet().rangeWithScores(key, start, end); - } catch (Exception e) { - log.error("redis zRangeWithScores error, key: {}, start: {}, end: {}", key, start, end, e); - return Collections.emptySet(); - } - } - - public Double zScore(String key, Object value) { - try { - return redisTemplate.opsForZSet().score(key, value); - } catch (Exception e) { - log.error("redis zScore error, key: {}, value: {}", key, value, e); - return null; - } - } - - public long zSize(String key) { - try { - Long result = redisTemplate.opsForZSet().size(key); - return result != null ? result : 0; - } catch (Exception e) { - log.error("redis zSize error, key: {}", key, e); - return 0; - } - } -} diff --git "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/vo/StudentVO.java" "b/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/vo/StudentVO.java" deleted file mode 100644 index e3cbb1d..0000000 --- "a/Redis\344\275\234\344\270\232/src/main/java/com/chenghao/student/vo/StudentVO.java" +++ /dev/null @@ -1,15 +0,0 @@ -package com.chenghao.student.vo; - -import lombok.Data; - -import java.time.LocalDateTime; - -@Data -public class StudentVO { - private Long id; - private String name; - private String phone; - private String email; - private Integer status; - private LocalDateTime createdAt; -} diff --git "a/Redis\344\275\234\344\270\232/src/test/java/com/chenghao/student/IocApplicationTests.java" "b/Redis\344\275\234\344\270\232/src/test/java/com/chenghao/student/IocApplicationTests.java" deleted file mode 100644 index 1f0463d..0000000 --- "a/Redis\344\275\234\344\270\232/src/test/java/com/chenghao/student/IocApplicationTests.java" +++ /dev/null @@ -1,13 +0,0 @@ -package com.chenghao.student; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class IocApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git "a/Redis\344\275\234\344\270\232/src/main/resources/application.yml" "b/Redis\344\275\234\344\270\232/target/classes/application.yml" similarity index 65% rename from "Redis\344\275\234\344\270\232/src/main/resources/application.yml" rename to "Redis\344\275\234\344\270\232/target/classes/application.yml" index 114ff6d..a3781df 100644 --- "a/Redis\344\275\234\344\270\232/src/main/resources/application.yml" +++ "b/Redis\344\275\234\344\270\232/target/classes/application.yml" @@ -58,44 +58,6 @@ spring: enabled: true url-pattern: /* exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" - redis: - host: localhost - port: 6379 - password: - database: 0 - # 连接超时时间(毫秒) - timeout: 5000 - # 连接超时时间(毫秒),必须小于 timeout - connect-timeout: 3000 - # 读取超时时间(毫秒) - read-timeout: 3000 - - # Lettuce 客户端配置(Spring Boot 默认使用 Lettuce) - lettuce: - pool: - # 最大活跃连接数 - max-active: 16 - # 最大空闲连接数 - max-idle: 8 - # 最小空闲连接数 - min-idle: 4 - # 连接池最大阻塞等待时间(使用负值表示没有限制) - max-wait: 3000ms - # 连接耗尽时是否阻塞等待,false 则抛异常,true 则阻塞直到超时 - block-when-exhausted: true - # 空闲连接检查周期 - time-between-eviction-runs: 30s - # 连接最小空闲时间(达到此值后空闲连接将被移除) - min-evictable-idle-time: 60s - # 关闭超时时间(毫秒) - shutdown-timeout: 100ms - # 集群模式配置(单机模式请注释掉 cluster 节点) - # cluster: - # refresh: - # # 自动刷新集群拓扑 - # adaptive: true - # # 刷新间隔 - # period: 30s mybatis: type-aliases-package: com.chenghao.student.entity diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/StudentApplication.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/StudentApplication.class" new file mode 100644 index 0000000000000000000000000000000000000000..00766c853291e35fbcab1ff1f092111a633a9823 GIT binary patch literal 720 zcma)4O;6iE5Pcg04sHrG6ew*koJewDFBO+mNHh{B3#6tB2Tp6VI1Bb}v|a;$ixa2^ zegHoTG3y{D5<$X;8O_&w^Je|@{QnWaFZ>Kq$JYQGAvUoU;2XozZ>5zxU|48(h79$- zIhPEpk<#+G%wuW)i8!N7D>8}5hQcZzzb5N$qzZ;kl$e|+BdODoFuZW(xzvsiCjM|d z&Qv0tGP*|uxlo#6vwap_ifh3$p;PL#N~gVQ0bx^uT%S{B2nVLLi9Aw%qpi32dmfTu z`){e8%H>cMik3ap+PI3JfDa;LQ(lZc;e{2syfOBQ$Hq7=N@o(IFH~Au$p=--A1cfW zXkrmd47(o`9ALYN@A$#6HdT8PU&_QWbl=@%!ac)F&tpqETil+xT0av-(VKIq&RmTo z&BzuHJI+v0+LwFSL5=8rCZN1ugQPYaMt28w$OF literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/Loggable.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/Loggable.class" new file mode 100644 index 0000000000000000000000000000000000000000..4fc603fb16254a30f583fb98e3629225db7433ac GIT binary patch literal 401 zcmaiw&q@O^5XQez+tq5d9z{g)P&~O8Z=M8KDzsMC)r+Sz4%?J$BHe7EujauA@S%!R zLAQs3ha~go$2a-rYw__3;0lKk_9Glb=nz^@zM5*jGnNVMzRzZS56^wT!;iSK0Vyj#ptG`B^scFvPn$VajTZ!iRdM>eCunXDzods?VlB_qp zC7i9NQw{>lU}3xeAdlV}Jr^)apC7XOK|;9DzKHdhT|QPmE<^PuYOBBg^-bv1u7;xt u>p(cIODjg}WpoLI4LO^#T}ZU`b2reG_gL~sdfTrc#tvH8U1p3uw7&r#jC7p< literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/MonitorPerformance.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/annotation/MonitorPerformance.class" new file mode 100644 index 0000000000000000000000000000000000000000..8e6a683da2ccfda63d1f9b89f399c55de9f9260e GIT binary patch literal 421 zcmaiw&q~8U5XQez+i3k)Pa-0UhaL@xH%|p43dWWgy?ENjG2OD+m1I-st9kGNd?<11 z!4xcbn4OuOAK&hLpI`4E04}f>U?;$CfG(l);Oa8tYi*dYA3LkPD~DXZy0TC<9t_ZU++kC8CSo!)z)E0mJ z*8xJe*>5nKaOMfe&DFxnjV(O_VMSt99EVhEKW7VV$%oPhGFyKJF*eY_=DcHUVf!0` C;(aRs literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/aspect/LoggingAspect.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/aspect/LoggingAspect.class" new file mode 100644 index 0000000000000000000000000000000000000000..a0dc37432353209540027a23815df96ef9d10d51 GIT binary patch literal 1662 zcma)6-*XdH6#j0z>88mdwFR-LK()}MEm?mA5n7R0sfwX8mgx)Q!*;XXY)tlMc5gt& zafZ=Ho$*2NK?ix1$0`q6?ZCVLM+$HJ2aezFrU{cU13R<3=bm%VcfNbhx#!>i{=NsG zh;jx7=CYW_@hl23BkA=~Wbj5BZ)Wipijn3-8gJ`3nZY|arQ@`~a9z3r<7FARW?0`S z*37bWT_;!&7+LguPo3eOTz*YJTapz=U~k#;ot0K&-3cyP>vd}AY+Lm;EAXOqN2#f* z7YfXkZP_sGs^hy=OPZl-RUBWLR@iiG6^HVCw-m1!ag<~(II1cu0;h8^r(|c%tXsZo zUJRt|I2F2_m!5x-uUg2LYt|Jjv46T=BWwgz+qDZEdo~<_Od}4xVm0DJ^tL1 ztia`=CN4iI=1Aa#t-6Zx(R1xG%AEVscACnQeyD>`lb^MG|sZk7Vs@+*W$U9svdQay3DXU#F)h23-)I_WO-?1iYhQJL}r=|#KVsc>dhwgTH( z_B!=+-ELV5(P5s-X}5y2Nh39*glz=OaHt-=nV$XH_9{ls;&aK=1eh=^8X#etS`}%h5Dv*EX2G#Mgf%Eu8 zV64Bu?1`T0QZC>zNJ?8APp1YW=af<(@@pdrQo$+;~I32b3l-~we$VC4^_ z#z*FlZ$Z~URhk1$i*%#&lUl5t)HdmwggeN9ASZ*c6C`k$!Dbk)$Y2qLViKl9fdTO% zCP{?@pXYjsC=-~*%Xo#vW{7i$2pW#iQ{%2Fyh}Ga1tqjAA zug>_WGCn$^<72JuROpQQ?%$yd{U_A#WN8SOnQCTs_nhDL`(5+L-;aL-(2GJGItJo+ z1A_?+VK{+{xTH>(8_|R-F^t6VCPou@3s*Ia#qhR$ruCS6t{_%4D5FLApZ%(P7KB{7aNcbQQCz?!^wDlB`Xy{rm6q~wWUnaunU=K*DGKIrtal3Ki zIj7>9a?Da~(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classes/com/chenghao/student/common/GlobalExceptionHandler.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/common/GlobalExceptionHandler.class" new file mode 100644 index 0000000000000000000000000000000000000000..f38e0d82ec814c3633f419ca2e52aa29a14aadc7 GIT binary patch literal 7292 zcmd5=YkU;d760FmFw16yu)GR17$U^*${^AflZcYANNN)7Zj7e3rL((}&A{x;GCLcf zXsuAt3J6$el?q6Uty;@NEF=W2eYe)W-|sJmkWc;6&;9k>naS>KG6`r?^~28GxqI$8 z|MR%#o^#*$&!yJ@ti(TqC`W7(mLMKLq7(``gGi#Q6e>3H(dHmDq=L|4lp>8Sr7)2R z(c0~$_zZRg@L&)R;j{eXVF8~D;E^D9VwZr=2QeM70Cw~D9{zYVh{s?A@Pz;#4`8o= zeL?KU6Z~PzI}pIZ01k1{PX_SC01gLn1YH4qDTpsSBu@qKw1A^Qd zlTt?OT)9bVHj+ujtYes1uj;C`nrNyQwKEhq8VQAAO0%jft=UveG27&rMl-ZHE^Ft~cPVW%9%>ypRP|)1DW{aJhPheVs>Gz2swX5lM=Ryr znsNwSH8qi2$FR40Y-!hEFwW7j`hNq%AS$M5 zm@O3Ya?;*eJa`@3M=fqpvi-65kIKHWG0ok(2CwX;CvN*@}00O#O^McD@5s_I~p2!NLvV%W<52vBB3D?;IV& z>G!e1zTTYUc(XODY4;eaZYie6eW_|s#`Pl^XMa>&OB}<)?U?ra_y;T$AWl<4T#z%dcWaYDeeB2M!6S4Dgcr$ju5uM7Bw zi0AQwfEPu46E6w)mWb0hBjBuvb9kAdtidp>jAhDc=TON^nTYdccx6fnzFme3A}*pw zK(B~P=wm2aS|Q-Fh*$BNi0|NaT0gwlVW{dqu=C21vsa!yIr!qf{!{0!zVe(u@b8NF z9=^{oYdDXFtg0mxlVQ3aD-l1y4@LZl>-yuIxPiVy{ilzPE{Llf(x0ky&(nO}KUgXIM) zGOJU~yEDA67D$BCTF)rJ+(dPO(}-7&1=?v%8A|Ndf#Gg1lp!7-EH1k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mV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/controller/StudentController.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/controller/StudentController.class" new file mode 100644 index 0000000000000000000000000000000000000000..155122bbea083fa9a395c52a7aea77ee0f951a87 GIT binary patch literal 3825 zcmcInTXWk)7(MG;oH!;I7eZSoO;g(DTD47^29l;UN!z42&Bei7!cDeSN5zqhET?1` z-a9<;z%aw~0Ur1PWu^>mnc)ZUKav^#1jAWblI6snC`@^ftlj5zA{(o1NX5{FwJ6?;A}!EavdcNm zuv40~rDrvP(PY-#RI(eIk>5~F#T`~km2o9iV?HSm&1?3|_Ciizd?0yW-BOi;YUGuq zY2+sd>-%DWP18_TwNklY(?#>FnPcRxq;6<;%bOX^T2nIx_9T*KRxPAeOP6i8v)SIz zO9Eq!d>gi977Ci>L7g?d9)^nO1lqk9r$D>A&h(PN>H40xOwVI_iJsb1dfrg&vPGQh z|7qn@A>vFk(y`UDVe6Y(S}*CO;f7(DwrcC9K^872O)IaIik5EV?^)`m_Q15hP#$O* zC8HZTMfGi!+nT+o7K^l_%a$#*P$uveQceMRsp!g(5|> z>{<|ZZ>{>ai=F~+9xylT#(w`I38@5ayr6KPq~2N_J_JtGieilf)ac=;bBw-Hs3kq; z2vSMQPr7K$TAFHe&sPp!;;dsjx3&~^-bl~JTGYKOLLA-biQ@e@68IpB599a<>v5dH$8lW5Cj#-E zhmUstc)t7ayPa=;lB1u-F@euGu>0uA?hlWv1E0q+1+I!Se*XK%U%Y|q$Ov4ldp*he zMcymY)iturv5(gV24%Fo=ZZ1-6%EpAKsu!K)Ugp;-B52}o_s|oF;b(|MusHG* zO^?|Z!7F^n_zN6E2acncUwsvOyo#f2aVE!((|-qA@ETsH^$GSy@CHuux054%d`_)H zl+cgU?28I^yvYyn)Scxt2_(lUK_JZmAWZ=vCmE=(0g!VTaDfbBi2jD@H}3b0_|Qh{ zKsyhG*6k2-jTiX%NM!>|4VPS`YcA4+OIZt%CR#~abT4UVi1lm$Yr-cjfieCulB7i) z`aIIEILKN#GR~NF5OwgsfdlU<$0-`T<)TWFJ;`5>gKFd%+M1APe~Q>%P$LXF8UWSf zgX(d2l1?0W9;ml{x+WRY+er_csM6IF;kew`Dnu|tdRm)jztobawT=i9@j3`EQFCJs z!rqF#kI>UvMPb)`T+;zu{=P{d0@v{l-%?@IZur>H?|5lw_&11O9jH>|l5u$~O^Rtv)oH literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentCreateDTO.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentCreateDTO.class" new file mode 100644 index 0000000000000000000000000000000000000000..0990dae69a400d355b44d6184dbb1c794208e297 GIT binary patch literal 2821 zcma)6?Qc_M6#qT#eQVdj80$uLAi4?Lx>8=ILdQ@B1E<@VY)pBTyY|{%Xm4kGi&Ntl z{Y1=yi7_U|4;m8|%^;HKAQRudVB+7wHu)b!Jm=oqZS5LDa&zu^&fD{Qe&;;T-~TQA z2A~IK5KR~lK*lK+6D;0T@m7%jr&*lgfU~TfV{x9B7gW3*Lz-qMqhW7H2AFKK_t4#u}Zovm%{JywwoeJ)a?cII<&JT+>zFeNWF0i!{ z|M>e;m1mHrGI@(|g_o{=y7cwJ;K1CV|^B5*C?W#N2-^n81I(!ETODOJ2835NZP%fX9PsPa(q1(F`TzEMnNFJr)+oU zJm}cU3&-INL7nUIRzb(*wa9aMtNJlpPhK9@ryLUL4m$TpOX}7DBc*d>^kT;C12tuk zfQ+6T93CK~q|>MrOIe$Y9tfq~+fr%wHqh+6dj$o8WBF1cX&f`Th2iRE?BY8cLKNL0 zgwY(rb1XX0EYSJH9Sz}C^oFn(`$9;t*2CHhEC%tKKuh(*&|fmMDdx4g8czpv+!sO` z8DgP(yK}HUM|F-ys^|>i4eS$WSS{-|jHuD4rVJ}35UVvH>t@Eo(Tiv4y=$Te!4DtP zK(d8a+vvXq^oSMl6rLt$>masb+aR7{({{=N@#Wi$l_*kc#QB(2uV!SmW*gdR@q7_G zxZF;s+}5?_+NfM*h>u(2RjMOooi4gAC$}Dg5>`y?r@oSm5zaXM1^wl&+Yq-%@nIK9 z#WB{A8}yz#0oaW_v=ZD;l9kCn!S`cTazo8z8i5+g{_5nWn#nXeHIk+3qt*phda)7=w^|mc8L9i zIY6jqqFvV^OLNgbA%6wgKNtN2@^E+8JQQb1iaOFwA|b{8LS00t^bl3v`9v85~3( z9V3is9HKe%(SVzHnQVS^A&FN=lW-izaF{e1!({0vO+l7s{0M0(3UtSglBQvR_KYH= zYX4$`ienGatl~I*ns|sUt{PaYQfYdrTo$P>!s)%t^fCJNH^Lnbc?G>pm>Ip`cg-y$ zc2S-}*{2$M4@!Lw<*g0986sS3h|WTd&7yEi#p&WX%X3R zwbmx}kh`G=%a4186l{Cw9z#_L7GI+TgcC(GHvfcc|-<@XcK~{ zf)I}=e0A+(Ll|;7pd2Grn!GS&P1tH=wUvSiCOzIRcep@M`OWG11)>9vhiL j`ZYGVdVuv!t{!B)k;FVUS3d@8->@E!8bQ=>U&sCjiqA2Y literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentQuery.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/dto/StudentQuery.class" new file mode 100644 index 0000000000000000000000000000000000000000..bed5ae1d6f5536cbc48c89389b96aed3f9a49a20 GIT binary patch literal 3318 zcma)8Yi|@)7=C7VW@mPHN^i8V2ntxF-L|YCqHHO05v0(TOKTNGWx5@@({5*%-C3aM z2aSpGixNMX7)>-WHX0I}B^8bYb=I7}kS|V2Xd9j}&Ks$mVNa*VoT6n<4@iiV9K$J>B(w*# zL$+g1n?SemxDq&rHu;cTE`hYc&)|hpPfvmpw!(}?S`^|!D9So;4 zs0zA|?6Pdj*)1X5-7_IU-k+bMr{-bH7PXo*i{l1MBr2ZI7`X|fXbIjI%1+i|%{C8b z@^h(7*0iUyMm|+?%2TH8q^6uao8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}#r}T*?qS|L literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/mapper/StudentMapper.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/mapper/StudentMapper.class" new file mode 100644 index 0000000000000000000000000000000000000000..00d4a6f7cee86e145821ca28d0ed66ce23351d00 GIT binary patch literal 1178 zcma)5U2oGc6umBMOFtN6V~p`lH&F9}UyzXKG>Hl!RSIIF(jJlA)TAD%9XZZW{~8bc z0DctWG-;P~6w!ysxnIZUT;Kca_m7`M^qP+A)Tz@Eqh=x_8MyvzFlO|o>tBdV!6TtV z?i(HUJU=i~9!#VTC&KW=rDLfb$EVzk4|B7}sPj36YbwuGqDGNC6IM*6llGm~#tEm4 zP8hxLjSabo1@O2U!JTkXB=D>XVAV?zrIJxafzyJZuM&5S;6OVWO4}=O9y+Ts)|rgd zsff=Df!P?UPz#q@;C?B~+#Ka(qh6fivRVSoDHPYg$=P>fA)}^rA}u6zyBooH1JtDP zSU3=F6^{ha&Vqg+&&yj-I0}tdzLQd$mYPrTzN?+uTw^O2)E6$8FxvZ@(>bHJ*S(v< zdnj&>F_}*0lexq%O(q(&otUrgeJQOS7|daRb~Z5@ecLZT^l~;(SB>*{b7)c<$PX$) z^6p}qKZ-b(_SL*Ej1E`ldS#qn{%4$XAdG{zc88|fJ5d o`1k4Fm3;vFJ{`hdckP3JMjq0mH8qbx?@31TDLunESMZ$Z54}`J6aWAK literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/StudentService.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/StudentService.class" new file mode 100644 index 0000000000000000000000000000000000000000..9cd7cacccea1d572747e39d44711b4d82eac3ac4 GIT binary patch literal 638 zcmb`F%}&BV5Xb+Er4{@_c?pP#d(jihL5&Fs37Q)2OFM2$>Xwu(39shC2k@bc(}If9 z#EYk$o%!!?zV_|?=~QkTO`Kh3j%?&747tasy6wul2dE6Nf$t=!~%rTJXv`iVg6yO+^qN`Z9+ p1ZwjO9$!uJ3G literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/impl/StudentServiceImpl.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/service/impl/StudentServiceImpl.class" new file mode 100644 index 0000000000000000000000000000000000000000..97506b787c846782f43c393532321e83f43daac1 GIT binary patch literal 6373 zcmb_g33wFc8GirGlG$t~1Ofyj$gSjbK{;$9APJ(;kRS=MsI^WulVo9cC+^M$Vo%$u zwPI-%tp^39)mp8JsGEeS*wfb1+SAtF2MP4F_hGH=`_If?$pm=%^vRQ%|M>pze82Di zW?y>q@bdtciFpNBjdv8{op_gmcl+=jKl1QiKNoNG<9&F)A0NO?a&)sFx8Q?vbgO)P zNFKSZ5Yw=;gpBSe#GTmf$6dHvjy|T~9tHRMF&+2$aXW}-dSHV6%%CO&$2XH|0 z{)C)P}LMPB7tC!9_{YYjDWKnh*;Z!)@-!r!1(ugL zZPog;Kv;`*2bzp%cU^@$r#>UarM-n5ybVUDE>PSQit5dYNQWM4(>lUjDQPl-TDV<{ zh2-2>^qM`PxWEc`)^R=77YgcuP^34U64Gj~HFAm4JRzz&Wvr&O!?9D~YR#OXZqt`6W7;~D^t94WH#&UNSoo3qdD-wFF-*HfP$m~gU1mxKsJ7C3$i#&JnDYTtHgK>NcT0`AY%}m4?vFQIRVy7!SKN!=_r^le?yi^?(YG71Z2>c;MdMmf(gd_Ld7v$`tjXjmj2Yo@2eV?m!9p@4OWTWg z1od8dTtYC>+iBUpdR)bD2al^6745{ZzJpk%rexZwhjr=DY2%n$l%^gx8#ZlTM~{`u z1#isQPIE;gQ>@EKL|GO5wqBd84Xh%@j`b~b5KgFE(}FO z=4yd+C(y&SDogwPtwtgi)Ype(C7tP1?W|IGu0)bRxof!NrXJG`lUW{cj?}4Gi+TlL zQSlPKDp2EkM{qGhgw!YEtmW}|I_RwBBac0FeD}U%gSU@7cF)M3hhKa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wUQ|0k~)NSK_Voz!qvN zEw-tyN>g2(rn-hyZzGil*OJ@Yah+r9UQ$ShuW>9Z9l}fx_BtLvLwbA|Wm^Vt=7y^3 zLCmW54q|o^XGwCJKF5PAtCN_UF>VeNvRi^FSc)@oJ{DjZ&0LNER-hIuvx2iGZR8qg z=%88)7|2X;@*vJckjy4?tCRow)eu2+any|-NB`HUy^K{P1DNKT9KcY$(m~9-7gaS$ z%$Kty7To7pz*&yL3$qNa^;VbB+F4~@MthOuU*;Xc*|hjc3bf&O9#oE35mu`SfHj2Q zS_Yw>wl;9Ijv-pluw8|hpzVMJ^2SNmD9?zFqUh!Ix zEr7>{?9vH*vlZJM--LPCLtzUuzRB^7vwTjDMRr295M&!Mli*uG_(_dRZB}WG7djft zG-9M?x@rR&9AUheRpKI&$w(b`@YGaQvN(zIs*;K%DyyeLdGU>5qAf0LPk)0u&@8RW&dn#JuJ{#}c$%(9yq%$*G6 zo%GH=Vt9z?&4mB3<4hk8SpjCNMan1)O4&;H_gdlKhgrCuYhJGMw*}jqRwa;mTRe<9 z`shL@J7pf)Do&=m!8Gv^MMY#M#mW-FBk33xJ7RszSrZAK6#S6i?ub~;xrC3uasaC; ztDb?#I3S-iAU-n4@Ta-@iTrx*d$EHw9`sw#kSA^+3}#7=5TZ<+#q=)2?VPLJ`!IFe Jg^%E){{=nKC}RKs literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/vo/StudentVO.class" "b/Redis\344\275\234\344\270\232/target/classes/com/chenghao/student/vo/StudentVO.class" new file mode 100644 index 0000000000000000000000000000000000000000..caf02cc6e5537f8c04a96e5c50c2ab783b882bb1 GIT binary patch literal 3748 zcmb7GS#KLv6#mAZ&Cb|KU6Nv2AT0s1682@%0^J)(n$nceLRqHH5W98k;7rQCZxS!S z6A1BwkmyS#K%%Jx2*FE{c;pF*C!Y8dh4P)b<9O^2B1p-Z@80vBJLjJB-Rt?~?{9wq za68`3;uE4Kd4N0x>IMPK) zpw-)j6uH=kdQkQo+>A7DK$K{QGa>8>C!5l8l%qM!gifW=ta3$z&=Co=OL?MEHgrXr zja<Al=O zvDxsKSE@V!>2Pn>KyxF;fXdq(h_W;XqMWh=vA5enUA0z2cDBCKDEa#;au)Jyvc5@< zu!A8CJGd784z^;OgX_c$h`Am&IJgmm8n*uD5pi%7dmY@2TO8~WbSLg|a4T+ecx}<# zA?9w}X^&p?w|FMrqA( z(!v0awNeDJNgPp`+ z>MtSK>tB<+fb>wi!I=iqtX&r05>&W4f zb$DH=by7Ne(apRrjtqYRLq9w66YNi5q|c802zz>Tcoms&NRT}^O5^HdKclOtU%-Yl zaK?)ID!Q5s$2CZCT(f8h$Gm{T8RUva(TtIDu0>MLwTqUJ?1*F)?HDQVW=P7r*vafm33RleaNqAq+-#T+Jb@H;QeS)v^Nz-AmF%Hv_?JB41$zKFbqxxdh7 z;Sv7X+F!U*!OZ`H%$q-DN)h2TASc)mDM)Ejmz72xU}LQ`1`8sk(d3s-Et5LHxD2De z=$Y8A?+E3yrDvi{@z^~hXJC!3V#8B1@3^`+ihAU+MN-O@bB)kNHHATT(P+Bzt{J+_ zH5WCeqPkrxbWvVWl+|?gxOV8W*IX1GqqZbV;JDgBw9hm?$749o{TcWSj}xWXv`_H_ z_nziA#G81MNay8K##2NFt1%6a$V9;Jf)hj*-p3}Ch-_)2whhiDPUvi-rm=OsjDusDN^c6NM+#`4k X@hYzF{JD#NTpW#bpz*-Usd)Mynxc!g literal 0 HcmV?d00001 diff --git "a/Redis\344\275\234\344\270\232/src/main/resources/mapper/StudentMapper.xml" "b/Redis\344\275\234\344\270\232/target/classes/mapper/StudentMapper.xml" similarity index 100% rename from "Redis\344\275\234\344\270\232/src/main/resources/mapper/StudentMapper.xml" rename to "Redis\344\275\234\344\270\232/target/classes/mapper/StudentMapper.xml" diff --git "a/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" "b/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" new file mode 100644 index 0000000..c0e0d40 --- /dev/null +++ "b/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" @@ -0,0 +1,10 @@ +com\chenghao\ioc\repository\impl\UserRepositoryImpl.class +com\chenghao\ioc\MonitorPerformance.class +com\chenghao\ioc\entity\User.class +com\chenghao\ioc\controller\UserController.class +com\chenghao\ioc\PerformanceAspect.class +com\chenghao\ioc\repository\mapper\UserMapper.class +com\chenghao\ioc\repository\UserRepository.class +com\chenghao\ioc\service\impl\UserServiceImpl.class +com\chenghao\ioc\IocApplication.class +com\chenghao\ioc\service\UserService.class diff --git "a/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" "b/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" new file mode 100644 index 0000000..75a563a --- /dev/null +++ "b/Redis\344\275\234\344\270\232/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" @@ -0,0 +1,10 @@ +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\PerformanceAspect.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\repository\UserRepository.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\MonitorPerformance.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\service\impl\UserServiceImpl.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\repository\impl\UserRepositoryImpl.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\controller\UserController.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\repository\mapper\UserMapper.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\entity\User.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\IocApplication.java +C:\Users\hc\Desktop\ÉϿÎ\code\IOC\src\main\java\com\chenghao\ioc\service\UserService.java diff --git "a/Redis\344\275\234\344\270\232/target/test-classes/com/chenghao/student/IocApplicationTests.class" "b/Redis\344\275\234\344\270\232/target/test-classes/com/chenghao/student/IocApplicationTests.class" new file mode 100644 index 0000000000000000000000000000000000000000..dcd00aefadc23ac13e0a4abc7ea2ca0d6a7a9118 GIT binary patch literal 536 zcma)2O-lnY5Pj*_YP;H6Jt%naSSy%|cu|BZ2*RRZOYhky=)pkddFXrCW@w#jqum8VeQ-EsXk6KuV(13isM{h5 zRW=b}Oh`YlQp8h{=`vq|4L8?0!!VFG;c~7_G#8fVu9zv~_>GmLG>x?sPFpikxy#QO zd})nSFD|fRM%=yo!Z@9%sm?VCkBqUd>ZjU%V6%uX3R;kCs-4QXNHs5|NU1%xMJCm? zF8AC0W7_dTJPC%=N+wS;ZK8)vB2I_+7YA(%}F#`t0)5=#n1j$0_3E8Tsb$4eYfldt_S`=wXdwf7yU_v?&8RM6Olj fBg#thFJk8hk*$b6HI}j) "cURL",粘贴以下命令: - -#### 接口1:查询学生 -```bash -curl --location 'http://localhost:8080/api/student/1' -``` - -#### 接口2:分页查询 -```bash -curl --location 'http://localhost:8080/api/student/page?pageNum=1&pageSize=10&keyword=张三&status=1' -``` - -#### 接口3:创建学生 -```bash -curl --location 'http://localhost:8080/api/student' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "name": "王五", - "phone": "13900139000", - "email": "wangwu@example.com" -}' -``` - -#### 接口4:更新学生 -```bash -curl --location --request PUT 'http://localhost:8080/api/student/1' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "name": "张三(已修改)", - "phone": "13800138000", - "email": "zhangsan_new@example.com" -}' -``` - -#### 接口5:删除学生 -```bash -curl --location --request DELETE 'http://localhost:8080/api/student/1' -``` - ---- - -## 测试场景 - -### 场景1:完整的CRUD流程 - -1. **创建学生** - ``` - POST /api/student - Body: {"name":"测试学生","phone":"13800138888","email":"test@example.com"} - ``` - -2. **查询刚创建的学生** (假设返回ID为10) - ``` - GET /api/student/10 - ``` - -3. **更新学生信息** - ``` - PUT /api/student/10 - Body: {"name":"测试学生(已更新)","phone":"13800138888","email":"test_new@example.com"} - ``` - -4. **分页查询验证** - ``` - GET /api/student/page?pageNum=1&pageSize=10&keyword=测试 - ``` - -5. **删除学生** - ``` - DELETE /api/student/10 - ``` - -### 场景2:参数校验测试 - -**测试1:姓名为空** -``` -POST /api/student -Body: {"name":"","phone":"13800138888","email":"test@example.com"} -预期: 400 "姓名不能为空" -``` - -**测试2:姓名长度不符** -``` -POST /api/student -Body: {"name":"张","phone":"13800138888","email":"test@example.com"} -预期: 400 "姓名长度为2-20个字符" -``` - -**测试3:手机号格式错误** -``` -POST /api/student -Body: {"name":"张三","phone":"12345","email":"test@example.com"} -预期: 400 "手机号格式不正确" -``` - -**测试4:邮箱格式错误** -``` -POST /api/student -Body: {"name":"张三","phone":"13800138888","email":"invalid"} -预期: 400 "邮箱格式不正确" -``` - -**测试5:页码小于1** -``` -GET /api/student/page?pageNum=0&pageSize=10 -预期: 400 "页码最小为1" -``` - -### 场景3:业务逻辑测试 - -**测试1:手机号重复注册** -``` -1. POST /api/student - Body: {"name":"用户A","phone":"13800138000"} -2. POST /api/student - Body: {"name":"用户B","phone":"13800138000"} -预期第二次: 400 "手机号已被注册!" -``` - -**测试2:更新时手机号冲突** -``` -前提:已有用户A(id=1, phone=13800138000)和用户B(id=2, phone=13800138001) -PUT /api/student/2 - Body: {"name":"用户B","phone":"13800138000"} -预期: 400 "手机号已经被其他学生使用!" -``` - -**测试3:查询/更新/删除不存在的学生** -``` -GET /api/student/999999 -预期: 400 "学生不存在!" - -PUT /api/student/999999 -预期: 400 "学生不存在!" - -DELETE /api/student/999999 -预期: 400 "学生不存在!" -``` - ---- - -## 数据字典 - -### Student (学生) - -| 字段名 | 类型 | 说明 | 备注 | -|--------|------|------|------| -| id | Long | 学生ID | 主键,自增 | -| name | String | 姓名 | 2-20个字符 | -| phone | String | 手机号 | 11位,唯一 | -| email | String | 邮箱 | 可选 | -| status | Integer | 状态 | 1-启用,0-禁用 | -| createdAt | LocalDateTime | 创建时间 | 自动生成 | -| updatedAt | LocalDateTime | 更新时间 | 自动更新 | - ---- - -## 环境变量配置(Apifox) - -在 Apifox 中可以配置以下环境变量: - -| 变量名 | 开发环境 | 生产环境 | 说明 | -|--------|----------|----------|------| -| BASE_URL | http://localhost:8080 | https://api.yourdomain.com | API基础地址 | -| TIMEOUT | 5000 | 10000 | 请求超时时间(ms) | - -使用方式:在请求URL中使用 `{{BASE_URL}}/api/student/1` - ---- - -## 常见问题 - -**Q1: 所有接口都返回404?** -- 检查应用是否启动成功 -- 确认端口是否为8080 -- 检查路径前缀是否为 `/api/student` - -**Q2: 参数校验不生效?** -- 确认使用了 `@Valid` 注解 -- 检查请求 `Content-Type` 是否为 `application/json` -- POST/PUT 请求必须使用 JSON Body - -**Q3: 分页查询返回空列表?** -- 检查数据库中是否有数据 -- 确认 pageNum 和 pageSize 参数是否正确 -- 检查 keyword 和 status 筛选条件 - ---- - -## 附录:完整测试数据 - -### 测试用学生数据 - -```json -[ - { - "name": "张三", - "phone": "13800138000", - "email": "zhangsan@example.com" - }, - { - "name": "李四", - "phone": "13800138001", - "email": "lisi@example.com" - }, - { - "name": "王五", - "phone": "13800138002", - "email": "wangwu@example.com" - }, - { - "name": "赵六", - "phone": "13800138003", - "email": "zhaoliu@example.com" - }, - { - "name": "孙七", - "phone": "13800138004", - "email": "sunqi@example.com" - } -] -``` - -### SQL批量插入测试数据 - -```sql -INSERT INTO student (name, phone, email, status, created_at) VALUES -('张三', '13800138000', 'zhangsan@example.com', 1, NOW()), -('李四', '13800138001', 'lisi@example.com', 1, NOW()), -('王五', '13800138002', 'wangwu@example.com', 1, NOW()), -('赵六', '13800138003', 'zhaoliu@example.com', 0, NOW()), -('孙七', '13800138004', 'sunqi@example.com', 1, NOW()); -``` -- Gitee