diff --git a/123.txt b/123.txt index e69de29..f3c488d 100644 --- a/123.txt +++ b/123.txt @@ -0,0 +1,67 @@ +3245 +23452 +523 +62 +62 +23 +42234 +2 +3424 +253262 +5 +6 +24 +524 +6252 +3 +2 +5252 +5 +32 +525 +2 +52 +52 +5 +25 +2 +523414 +14 +1 +4131 +3 +3247534 +31 + +5125 +41 +4 +14 +14 +14 +1515 + +616 +615 +14 +14 +1 +4 +673464 +36 +3635 +3 +63 +63 +453 +45 +3242 +352 +52 +523 +5234 +2 +14321 +12 +412 +41 \ No newline at end of file diff --git a/superMarket-backend/src/main/java/com/shanzhu/market/BackendApplication.java b/superMarket-backend/src/main/java/com/shanzhu/market/BackendApplication.java index f87776b..ae9a38b 100644 --- a/superMarket-backend/src/main/java/com/shanzhu/market/BackendApplication.java +++ b/superMarket-backend/src/main/java/com/shanzhu/market/BackendApplication.java @@ -19,9 +19,9 @@ public class BackendApplication { public static void main(String[] args) { - //SpringBoot 执行启动 + // 执行启动 SpringApplication.run(BackendApplication.class, args); - +//执行启动输出 log.info("=====================项目后端启动成功============================"); } diff --git a/superMarket-backend/src/main/java/com/shanzhu/market/common/config/MpConfig.java b/superMarket-backend/src/main/java/com/shanzhu/market/common/config/MpConfig.java index 7666872..ad1a426 100644 --- a/superMarket-backend/src/main/java/com/shanzhu/market/common/config/MpConfig.java +++ b/superMarket-backend/src/main/java/com/shanzhu/market/common/config/MpConfig.java @@ -1,20 +1,31 @@ +// 定义当前类所在的包路径 package com.shanzhu.market.common.config; +// 导入需要的类库 import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +// 声明这是一个Spring配置类 @Configuration +// 定义MyBatis-Plus配置类 public class MpConfig { + // 配置MyBatis-Plus分页插件的Bean /*mybatis plus分页插件生效*/ @Bean + // 创建MyBatis-Plus拦截器实例 public MybatisPlusInterceptor mybatisPlusInterceptor() { + // 实例化MyBatis-Plus拦截器 MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 创建MySQL分页拦截器实例,指定数据库类型为MySQL PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL); + // 设置溢出时自动调整到合理页码(合理化配置) paginationInnerInterceptor.setOverflow(true); //合理化 + // 将分页拦截器添加到拦截器链中 interceptor.addInnerInterceptor(paginationInnerInterceptor); + // 返回配置好的拦截器实例 return interceptor; } } diff --git a/superMarket-backend/src/main/java/com/shanzhu/market/common/exception/BusinessException.java b/superMarket-backend/src/main/java/com/shanzhu/market/common/exception/BusinessException.java index 31555a4..618b012 100644 --- a/superMarket-backend/src/main/java/com/shanzhu/market/common/exception/BusinessException.java +++ b/superMarket-backend/src/main/java/com/shanzhu/market/common/exception/BusinessException.java @@ -1,13 +1,23 @@ package com.shanzhu.market.common.exception; +// 声明当前类所在的包路径(异常处理模块的基础包) import com.shanzhu.market.common.constants.HttpStatus; +// 导入包含HTTP状态码常量的工具类 public class BusinessException extends SysException { +// 定义业务异常类,继承自系统基础异常类SysException + public BusinessException(String message, Integer code) { + // 全参数构造方法(接收自定义错误消息和数字状态码) + super(message, code); + // 调用父类构造器初始化异常基类属性 } public BusinessException(String msg) { + // 简化构造方法(仅接收错误消息参数) + super(msg, HttpStatus.CODE_BUSINESS_ERROR); + // 调用父类构造器,使用预定义的业务异常状态码常量 } } diff --git a/superMarket-frontend/public/index.html b/superMarket-frontend/public/index.html index 4f3ea82..c58de8a 100644 --- a/superMarket-frontend/public/index.html +++ b/superMarket-frontend/public/index.html @@ -5,7 +5,7 @@ - 超市管理系统 + 电商管理系统