commit 2aaf30026f9ffd99918e2af12a857ea06f139872 Author: 晨哀 <2076029107@qq.com> Date: Mon Jul 29 09:30:27 2024 +0800 日考7.29 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65f20b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/ +*.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 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..67f1d0d --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..132404b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bwie-common/pom.xml b/bwie-common/pom.xml new file mode 100644 index 0000000..c0cc583 --- /dev/null +++ b/bwie-common/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + com.bwie + yp_rikao729 + 1.0-SNAPSHOT + + + bwie-common + + + + + + org.springframework.cloud + spring-cloud-starter-bootstrap + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + io.jsonwebtoken + jjwt + + + + com.alibaba + fastjson + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.springframework.boot + spring-boot-starter-validation + + + + org.apache.commons + commons-lang3 + + + + org.projectlombok + lombok + + + + cn.hutool + hutool-all + + + + com.aliyun + dysmsapi20170525 + + + + com.github.tobato + fastdfs-client + 1.26.5 + + + + diff --git a/bwie-common/src/main/java/com/bwie/common/UserApplication.java b/bwie-common/src/main/java/com/bwie/common/UserApplication.java new file mode 100644 index 0000000..814d91a --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/UserApplication.java @@ -0,0 +1,20 @@ +package com.bwie.common; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @Author:杨鹏 + * @Package:com.bwie.common + * @Project:yp_rikao729 + * @name:UserApplication + * @Date:2024/7/29 8:56 + */ +@SpringBootApplication +public class UserApplication { + + public static void main(String[] args) { + SpringApplication.run(UserApplication.class); + } + +} diff --git a/bwie-common/src/main/java/com/bwie/common/constants/Constants.java b/bwie-common/src/main/java/com/bwie/common/constants/Constants.java new file mode 100644 index 0000000..2fdc9fe --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/constants/Constants.java @@ -0,0 +1,18 @@ +package com.bwie.common.constants; + +/** + * @description: 系统常量 + * @author DongZl + */ +public class Constants { + /** + * 成功标记 + */ + public static final Integer SUCCESS = 200; + public static final String SUCCESS_MSG = "操作成功"; + /** + * 失败标记 + */ + public static final Integer ERROR = 500; + public static final String ERROR_MSG = "操作异常"; +} diff --git a/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java new file mode 100644 index 0000000..03692c1 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java @@ -0,0 +1,29 @@ +package com.bwie.common.constants; + +/** + * @author DongZl + * @description: Jwt常量 + */ +public class JwtConstants { + + /** + * 用户ID字段 + */ + public static final String DETAILS_USER_ID = "user_id"; + + /** + * 用户名字段 + */ + public static final String DETAILS_USERNAME = "username"; + + /** + * 用户标识 + */ + public static final String USER_KEY = "user_key"; + + /** + * 令牌秘钥 + */ + public final static String SECRET = "abcdefghijklmnopqrstuvwxyz"; + +} diff --git a/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java new file mode 100644 index 0000000..1871fb7 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java @@ -0,0 +1,24 @@ +package com.bwie.common.constants; + +/** + * @author DongZl + * @description: 令牌常量 + */ +public class TokenConstants { + /** + * 缓存有效期,默认720(分钟) + */ + public final static long EXPIRATION = 720; + /** + * 缓存刷新时间,默认120(分钟) + */ + public final static long REFRESH_TIME = 120; + /** + * 权限缓存前缀 + */ + public final static String LOGIN_TOKEN_KEY = "login_tokens:"; + /** + * token标识 + */ + public static final String TOKEN = "token"; +} diff --git a/bwie-common/src/main/java/com/bwie/common/domain/User.java b/bwie-common/src/main/java/com/bwie/common/domain/User.java new file mode 100644 index 0000000..f8629c4 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/domain/User.java @@ -0,0 +1,24 @@ +package com.bwie.common.domain; + +import lombok.Data; + +/** + * @Author:杨鹏 + * @Package:com.bwie.common.domain + * @Project:yp_rikao729 + * @name:User + * @FD@Date:2024/7/29 8:45 + */ + +@Data +public class User { + + + private String uid; + private Integer userName; + private String pwd; + private String sex; + private String brithday; + + +} diff --git a/bwie-common/src/main/java/com/bwie/common/result/PageResult.java b/bwie-common/src/main/java/com/bwie/common/result/PageResult.java new file mode 100644 index 0000000..e284263 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/result/PageResult.java @@ -0,0 +1,38 @@ +package com.bwie.common.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author DongZl + * @description: 列表返回结果集 + */ +@Data +public class PageResult implements Serializable { + /** + * 总条数 + */ + private long total; + /** + * 结果集合 + */ + private List list; + + public PageResult() { + } + + public PageResult(long total, List list) { + this.total = total; + this.list = list; + } + + public static PageResult toPageResult(long total, List list) { + return new PageResult(total, list); + } + + public static Result> toResult(long total, List list) { + return Result.success(PageResult.toPageResult(total, list)); + } +} diff --git a/bwie-common/src/main/java/com/bwie/common/result/Result.java b/bwie-common/src/main/java/com/bwie/common/result/Result.java new file mode 100644 index 0000000..30b1e73 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/result/Result.java @@ -0,0 +1,76 @@ +package com.bwie.common.result; + +import com.bwie.common.constants.Constants; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author DongZl + * @description: 响应信息主体 + */ +@Data +public class Result implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 成功 + */ + public static final int SUCCESS = Constants.SUCCESS; + /** + * 失败 + */ + public static final int FAIL = Constants.ERROR; + /** + * 返回状态码 + */ + private int code; + /** + * 响应信息 + */ + private String msg; + /** + * 响应数据 + */ + private T data; + + public static Result success() { + return restResult(null, SUCCESS, Constants.SUCCESS_MSG); + } + + public static Result success(T data) { + return restResult(data, SUCCESS, Constants.SUCCESS_MSG); + } + + public static Result success(T data, String msg) { + return restResult(data, SUCCESS, msg); + } + + public static Result error() { + return restResult(null, FAIL, Constants.ERROR_MSG); + } + + public static Result error(String msg) { + return restResult(null, FAIL, msg); + } + + public static Result error(T data) { + return restResult(data, FAIL, Constants.ERROR_MSG); + } + + public static Result error(T data, String msg) { + return restResult(data, FAIL, msg); + } + + public static Result error(int code, String msg) { + return restResult(null, code, msg); + } + + private static Result restResult(T data, int code, String msg) { + Result apiResult = new Result<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMsg(msg); + return apiResult; + } +} diff --git a/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java new file mode 100644 index 0000000..f560aa9 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java @@ -0,0 +1,109 @@ +package com.bwie.common.utils; + +import com.bwie.common.constants.JwtConstants; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +import java.util.Map; + +/** + * @description: Jwt工具类 + * @author DongZl + */ +public class JwtUtils { + + /** + * 秘钥 + */ + public static String secret = JwtConstants.SECRET; + + /** + * 从数据声明生成令牌 + * + * @param claims 数据声明 + * @return 令牌 + */ + public static String createToken(Map claims){ + String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact(); + return token; + } + + /** + * 从令牌中获取数据声明 + * + * @param token 令牌 + * @return 数据声明 + */ + public static Claims parseToken(String token){ + return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody(); + } + /** + * 根据令牌获取用户标识 + * + * @param token 令牌 + * @return 用户ID + */ + public static String getUserKey(String token){ + Claims claims = parseToken(token); + return getValue(claims, JwtConstants.USER_KEY); + } + /** + * 根据令牌获取用户标识 + * + * @param claims 身份信息 + * @return 用户ID + */ + public static String getUserKey(Claims claims){ + return getValue(claims, JwtConstants.USER_KEY); + } + /** + * 根据令牌获取用户ID + * + * @param token 令牌 + * @return 用户ID + */ + public static String getUserId(String token){ + Claims claims = parseToken(token); + return getValue(claims, JwtConstants.DETAILS_USER_ID); + } + /** + * 根据身份信息获取用户ID + * + * @param claims 身份信息 + * @return 用户ID + */ + public static String getUserId(Claims claims){ + return getValue(claims, JwtConstants.DETAILS_USER_ID); + } + /** + * 根据令牌获取用户名 + * + * @param token 令牌 + * @return 用户名 + */ + public static String getUserName(String token){ + Claims claims = parseToken(token); + return getValue(claims, JwtConstants.DETAILS_USERNAME); + } + /** + * 根据身份信息获取用户名 + * + * @param claims 身份信息 + * @return 用户名 + */ + public static String getUserName(Claims claims){ + return getValue(claims, JwtConstants.DETAILS_USERNAME); + } + /** + * 根据身份信息获取键值 + * + * @param claims 身份信息 + * @param key 键 + * @return 值 + */ + public static String getValue(Claims claims, String key){ + Object obj = claims.get(key); + return obj == null ? "" : obj.toString(); + } +} diff --git a/bwie-common/src/main/java/com/bwie/common/utils/StringUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/StringUtils.java new file mode 100644 index 0000000..93c47fd --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/utils/StringUtils.java @@ -0,0 +1,68 @@ +package com.bwie.common.utils; + +import org.springframework.util.AntPathMatcher; + +import java.util.Collection; +import java.util.List; + +/** + * @author DongZl + * @description: 字符串处理工具类 + */ +public class StringUtils extends org.apache.commons.lang3.StringUtils { + + /** + * * 判断一个对象是否为空 + * + * @param object Object + * @return true:为空 false:非空 + */ + public static boolean isNull(Object object) { + return object == null; + } + + /** + * * 判断一个Collection是否为空, 包含List,Set,Queue + * + * @param coll 要判断的Collection + * @return true:为空 false:非空 + */ + public static boolean isEmpty(Collection coll) { + return isNull(coll) || coll.isEmpty(); + } + + /** + * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 + * + * @param str 指定字符串 + * @param strs 需要检查的字符串数组 + * @return 是否匹配 + */ + public static boolean matches(String str, List strs) { + if (isEmpty(str) || isEmpty(strs)) { + return false; + } + for (String pattern : strs) { + if (isMatch(pattern, str)) + { + return true; + } + } + return false; + } + + /** + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; + * ** 表示任意层路径; + * + * @param pattern 匹配规则 + * @param url 需要匹配的url + * @return + */ + public static boolean isMatch(String pattern, String url) { + AntPathMatcher matcher = new AntPathMatcher(); + return matcher.match(pattern, url); + } +} diff --git a/bwie-common/src/main/java/com/bwie/common/utils/TelSmsUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/TelSmsUtils.java new file mode 100644 index 0000000..49e8c81 --- /dev/null +++ b/bwie-common/src/main/java/com/bwie/common/utils/TelSmsUtils.java @@ -0,0 +1,87 @@ +package com.bwie.common.utils; + +import com.alibaba.fastjson.JSONObject; +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.SendSmsRequest; +import com.aliyun.dysmsapi20170525.models.SendSmsResponse; +import com.aliyun.teaopenapi.models.Config; +import lombok.extern.log4j.Log4j2; + +import java.util.Map; + +/** + * 短信工具类 + */ +@Log4j2 +public class TelSmsUtils { + + /** + * 阿里云主账号AccessKey,accessKeySecret拥有所有API的访问权限 + */ + private static String accessKeyId = "LTAIEVXszCmcd1T5"; + private static String accessKeySecret = "2zHwciQXln8wExSEnkIYtRTSwLeRNd"; + + /** + * 短信访问域名 + */ + private static String endpoint = "dysmsapi.aliyuncs.com"; + /** + * 短信签名 + */ + private static String signName = "登录验证"; + + /** + * 实例化短信对象 + */ + private static Client client; + + static { + log.info("初始化短信服务开始"); + long startTime = System.currentTimeMillis(); + try { + client = initClient(); + log.info("初始化短信成功:{}",signName); + } catch (Exception e) { + e.printStackTrace(); + } + log.info("初始化短信服务结束:耗时:{}MS",(System.currentTimeMillis()-startTime)); + } + /** + * 初始化短信对象 + * @return + * @throws Exception + */ + private static Client initClient() throws Exception{ + Config config = new Config() + // 您的AccessKey ID + .setAccessKeyId(accessKeyId) + // 您的AccessKey Secret + .setAccessKeySecret(accessKeySecret); + // 访问的域名 + config.endpoint = endpoint; + return new Client(config); + } + + /** + * 发送单条短信 + * @param tel + * @param templateCode SMS_153991546 + * @param sendDataMap + */ + public static String sendSms(String tel , String templateCode , Map sendDataMap){ + SendSmsRequest sendSmsRequest = new SendSmsRequest() + .setPhoneNumbers(tel) + .setSignName(signName) + .setTemplateCode(templateCode) + .setTemplateParam(JSONObject.toJSONString(sendDataMap)); + SendSmsResponse sendSmsResponse = null; + try { + log.info("发送短信验证码:消息内容是:【{}】", JSONObject.toJSONString(sendDataMap)); + sendSmsResponse = client.sendSms(sendSmsRequest); + } catch (Exception e) { + log.error("短信发送异常,手机号:【{}】,短信内容:【{}】,异常信息:【{}】", tel, sendDataMap, e); + } + return JSONObject.toJSONString(sendSmsResponse.getBody()); + } + +} diff --git a/bwie-modules/pom.xml b/bwie-modules/pom.xml new file mode 100644 index 0000000..3899dbb --- /dev/null +++ b/bwie-modules/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + com.bwie + yp_rikao729 + 1.0-SNAPSHOT + + + bwie-modules + + + + + com.bwie + bwie-common + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba + druid-spring-boot-starter + + + + mysql + mysql-connector-java + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + + + + com.github.pagehelper + pagehelper-spring-boot-starter + + + + com.sun.mail + javax.mail + 1.5.6 + + + + com.aliyun.oss + aliyun-sdk-oss + 3.12.0 + + + + diff --git a/bwie-modules/src/main/java/com/bwie/user/controller/UserController.java b/bwie-modules/src/main/java/com/bwie/user/controller/UserController.java new file mode 100644 index 0000000..9e98775 --- /dev/null +++ b/bwie-modules/src/main/java/com/bwie/user/controller/UserController.java @@ -0,0 +1,43 @@ +package com.bwie.user.controller; + +import com.bwie.common.domain.User; +import com.bwie.common.result.Result; +import com.bwie.user.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Author:杨鹏 + * @Package:com.bwie.book.controller + * @Project:yp_rikao729 + * @name:UserController + * @Date:2024/7/29 8:46 + */ +@RestController +@RequestMapping("user") +public class UserController { + + @Autowired + private UserService userService; + + + /** + * 2. 实现查询功能(20分) + */ + @GetMapping("list") + public Result list(){ + List userList = userService.list(); + return Result.success(userList); + } + + /** + * 3. 实现删除功能(20分) + */ + @PostMapping("del") + public Result del(@RequestParam String id){ + Integer i = userService.del(id); + return Result.success(i); + } +} diff --git a/bwie-modules/src/main/java/com/bwie/user/mapper/UserMapper.java b/bwie-modules/src/main/java/com/bwie/user/mapper/UserMapper.java new file mode 100644 index 0000000..323d97b --- /dev/null +++ b/bwie-modules/src/main/java/com/bwie/user/mapper/UserMapper.java @@ -0,0 +1,21 @@ +package com.bwie.user.mapper; + +import com.bwie.common.domain.User; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author:杨鹏 + * @Package:com.bwie.book.mapper + * @Project:yp_rikao729 + * @name:UserMapper + * @Date:2024/7/29 8:48 + */ +@Mapper +public interface UserMapper { + + List list(); + + Integer del(String id); +} diff --git a/bwie-modules/src/main/java/com/bwie/user/service/UserService.java b/bwie-modules/src/main/java/com/bwie/user/service/UserService.java new file mode 100644 index 0000000..486b5b6 --- /dev/null +++ b/bwie-modules/src/main/java/com/bwie/user/service/UserService.java @@ -0,0 +1,18 @@ +package com.bwie.user.service; + +import com.bwie.common.domain.User; + +import java.util.List; + +/** + * @Author:杨鹏 + * @Package:com.bwie.book.service + * @Project:yp_rikao729 + * @name:UserService + * @Date:2024/7/29 8:47 + */ +public interface UserService { + List list(); + + Integer del(String id); +} diff --git a/bwie-modules/src/main/java/com/bwie/user/service/impl/UserServiceImpl.java b/bwie-modules/src/main/java/com/bwie/user/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..ddaded6 --- /dev/null +++ b/bwie-modules/src/main/java/com/bwie/user/service/impl/UserServiceImpl.java @@ -0,0 +1,36 @@ +package com.bwie.user.service.impl; + +import com.bwie.common.domain.User; +import com.bwie.user.mapper.UserMapper; +import com.bwie.user.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author:杨鹏 + * @Package:com.bwie.book.service.impl + * @Project:yp_rikao729 + * @name:UserServiceImpl + * @Date:2024/7/29 8:47 + */ +@Service +public class UserServiceImpl implements UserService { + + @Autowired + private UserMapper userMapper; + + + @Override + public List list() { + return userMapper.list(); + } + + @Override + public Integer del(String id) { + return userMapper.del(id); + } + + +} diff --git a/bwie-modules/src/main/resources/bootstrap.yml b/bwie-modules/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..2d25ced --- /dev/null +++ b/bwie-modules/src/main/resources/bootstrap.yml @@ -0,0 +1,33 @@ +# Tomcat +server: + port: 10005 +# Spring +spring: + application: + # 应用名称 + name: bwie-user + profiles: + # 环境配置 + active: dev + main: + # 允许使用循环引用 + allow-circular-references: true + # 允许定义相同的bean对象 去覆盖原有的 + allow-bean-definition-overriding: true + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 123.249.110.115:8848 + # 命名空间 + namespace: yp + config: + # 配置中心地址 + server-addr: 123.249.110.115:8848 + # 命名空间 + namespace: yp + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/bwie-modules/src/main/resources/mappers/UserMapper.xml b/bwie-modules/src/main/resources/mappers/UserMapper.xml new file mode 100644 index 0000000..1ca2960 --- /dev/null +++ b/bwie-modules/src/main/resources/mappers/UserMapper.xml @@ -0,0 +1,23 @@ + + + + + + delete + from user + where uid = #{id}; + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..582f87a --- /dev/null +++ b/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + + com.bwie + yp_rikao729 + 1.0-SNAPSHOT + pom + + bwie-common + bwie-modules + + + + 8 + 8 + UTF-8 + 2021.0.0 + 2021.1 + 0.9.1 + 1.2.80 + 5.8.3 + 2.0.1 + 1.0-SNAPSHOT + 1.2.8 + 2.2.2 + 1.4.1 + + + + + spring-boot-starter-parent + org.springframework.boot + 2.6.2 + + + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring.cloud-version} + pom + import + + + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring.cloud.alibaba-version} + pom + import + + + + io.jsonwebtoken + jjwt + ${jwt.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + cn.hutool + hutool-all + ${hutool.version} + + + + com.aliyun + dysmsapi20170525 + ${dysms.version} + + + + com.bwie + bwie-common + ${common.version} + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.version} + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.version} + + + + + diff --git a/sql/yp_rikao729.sql b/sql/yp_rikao729.sql new file mode 100644 index 0000000..e14546d --- /dev/null +++ b/sql/yp_rikao729.sql @@ -0,0 +1,45 @@ +/* + Navicat Premium Data Transfer + + Source Server : 123.249.110.115 + Source Server Type : MySQL + Source Server Version : 80400 (8.4.0) + Source Host : 123.249.110.115:3306 + Source Schema : yp_rikao729 + + Target Server Type : MySQL + Target Server Version : 80400 (8.4.0) + File Encoding : 65001 + + Date: 29/07/2024 09:26:58 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for user +-- ---------------------------- +DROP TABLE IF EXISTS `user`; +CREATE TABLE `user` ( + `uid` int NOT NULL AUTO_INCREMENT, + `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `pwd` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `brithday` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + PRIMARY KEY (`uid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of user +-- ---------------------------- +INSERT INTO `user` VALUES (1, '韩立', '123', '18', '7/15'); +INSERT INTO `user` VALUES (2, '紫灵', '123', '18', '7/15'); +INSERT INTO `user` VALUES (3, '韩立李', '123', '18', '7/15'); +INSERT INTO `user` VALUES (4, '韩立特', '123', '18', '7/15'); +INSERT INTO `user` VALUES (5, '韩立萨尔', '123', '18', '7/15'); +INSERT INTO `user` VALUES (6, '韩立二', '123', '18', '7/15'); +INSERT INTO `user` VALUES (7, '韩立立', '123', '18', '7/15'); +INSERT INTO `user` VALUES (8, '韩立嘚瑟', '123', '18', '7/15'); + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/理论/img.png b/理论/img.png new file mode 100644 index 0000000..9e300da Binary files /dev/null and b/理论/img.png differ