diff --git a/common/common-framework/pom.xml b/common/common-framework/pom.xml index d7ec41bd7..82ed1d073 100644 --- a/common/common-framework/pom.xml +++ b/common/common-framework/pom.xml @@ -69,7 +69,7 @@ org.mybatis mybatis - 3.5.0 + 3.5.1 com.fasterxml.jackson.core diff --git a/common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/web/AdminMVCAutoConfiguration.java b/common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/web/AdminMVCAutoConfiguration.java index 66811dc6e..f2c947b57 100644 --- a/common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/web/AdminMVCAutoConfiguration.java +++ b/common/mall-spring-boot/src/main/java/cn/iocoder/mall/spring/boot/web/AdminMVCAutoConfiguration.java @@ -41,7 +41,7 @@ public class AdminMVCAutoConfiguration implements WebMvcConfigurer { } @Bean - @ConditionalOnMissingBean(GlobalResponseBodyHandler.class) + @ConditionalOnMissingBean(GlobalExceptionHandler.class) public GlobalExceptionHandler globalExceptionHandler() { return new GlobalExceptionHandler(); } diff --git a/pom.xml b/pom.xml index 815a20695..46eb2efa3 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,7 @@ 2.9.2 1.9.3 2.0.0 + 3.1.1 2.0.1 27.0.1-jre 2.0.1 @@ -141,6 +142,11 @@ mybatis-spring-boot-starter ${mybatis-spring-boot-starter.version} + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + com.google.guava diff --git a/system/system-service-impl/pom.xml b/system/system-service-impl/pom.xml index ab75ffb7e..4a85eda25 100644 --- a/system/system-service-impl/pom.xml +++ b/system/system-service-impl/pom.xml @@ -21,10 +21,6 @@ mysql mysql-connector-java - - org.springframework.boot - spring-boot-starter-jdbc - org.apache.dubbo @@ -44,8 +40,8 @@ - org.mybatis.spring.boot - mybatis-spring-boot-starter + com.baomidou + mybatis-plus-boot-starter diff --git a/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dao/AccessLogMapper.java b/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dao/AccessLogMapper.java index 947e79c9c..f7c19272f 100644 --- a/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dao/AccessLogMapper.java +++ b/system/system-service-impl/src/main/java/cn/iocoder/mall/admin/dao/AccessLogMapper.java @@ -1,11 +1,10 @@ package cn.iocoder.mall.admin.dao; import cn.iocoder.mall.admin.dataobject.AccessLogDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; @Repository -public interface AccessLogMapper { - - void insert(AccessLogDO entity); +public interface AccessLogMapper extends BaseMapper { } diff --git a/system/system-service-impl/src/main/resources/config/application.yaml b/system/system-service-impl/src/main/resources/config/application.yaml index aaf7532f0..2cf22d7ee 100644 --- a/system/system-service-impl/src/main/resources/config/application.yaml +++ b/system/system-service-impl/src/main/resources/config/application.yaml @@ -7,9 +7,19 @@ spring: password: ${MALL_MYSQL_PASSWORD} # mybatis -mybatis: - config-location: classpath:mybatis-config.xml - mapper-locations: classpath:mapper/*.xml +#mybatis: +# config-location: classpath:mybatis-config.xml +# mapper-locations: classpath:mapper/*.xml +# type-aliases-package: cn.iocoder.mall.admin.dataobject + +# mybatis-plus +mybatis-plus: + configuration: + map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 + global-config: + db-config: + id-type: auto + mapper-locations: classpath*:mapper/*.xml type-aliases-package: cn.iocoder.mall.admin.dataobject # dubbo diff --git a/user/user-service-impl/src/main/resources/config/application.yaml b/user/user-service-impl/src/main/resources/config/application.yaml index e469d9354..4d4edb0fb 100644 --- a/user/user-service-impl/src/main/resources/config/application.yaml +++ b/user/user-service-impl/src/main/resources/config/application.yaml @@ -7,9 +7,18 @@ spring: password: ${MALL_MYSQL_PASSWORD} # mybatis -mybatis: - config-location: classpath:mybatis-config.xml - mapper-locations: classpath:mapper/*.xml +#mybatis: +# config-location: classpath:mybatis-config.xml +# mapper-locations: classpath:mapper/*.xml +# type-aliases-package: cn.iocoder.mall.user.biz.dataobject + +# mybatis-plus +mybatis-plus: + configuration: + mapUnderscoreToCamelCase: true # 虽然默认为 true ,但是还是显示去指定下。 + mapperLocations: classpath*:mapper/*.xml + typeAliasesPackage: cn.iocoder.mall.user.biz.dataobject + mapper-locations: classpath*:mapper/*.xml type-aliases-package: cn.iocoder.mall.user.biz.dataobject # dubbo