diff --git a/product/product-service-impl/pom.xml b/product/product-service-impl/pom.xml index 6f9735b6..4d969643 100644 --- a/product/product-service-impl/pom.xml +++ b/product/product-service-impl/pom.xml @@ -49,6 +49,12 @@ mybatis-plus-boot-starter + + cn.iocoder.mall + mall-spring-boot-starter-mybatis + 1.0-SNAPSHOT + + com.alibaba.cloud @@ -78,6 +84,12 @@ com.google.guava guava + + cn.iocoder.mall + user-biz + 1.0-SNAPSHOT + compile + diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrDO.java index 4499806b..02b465ce 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrValueDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrValueDO.java index ccfe7aa3..23ff2ef2 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrValueDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductAttrValueDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductBrandDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductBrandDO.java index a90effe1..d3b04bd2 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductBrandDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductBrandDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductCategoryDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductCategoryDO.java index aa648961..0d1af5ac 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductCategoryDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductCategoryDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSkuDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSkuDO.java index 2edbb11e..4d41f73c 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSkuDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSkuDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java index 4a906dea..08b6b918 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/dataobject/ProductSpuDO.java @@ -1,6 +1,6 @@ package cn.iocoder.mall.product.dataobject; -import cn.iocoder.common.framework.dataobject.DeletableDO; +import cn.iocoder.mall.mybatis.dataobject.DeletableDO; import lombok.Data; import lombok.experimental.Accessors; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java index 664ca2e3..8677bd0a 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/message/UserProductSpuCollectionsConsumer.java @@ -1,7 +1,7 @@ package cn.iocoder.mall.product.message; -import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.util.ServiceExceptionUtil; +import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; @@ -10,7 +10,7 @@ import cn.iocoder.mall.product.api.message.ProductSpuCollectionMessage; import cn.iocoder.mall.product.convert.UserProductSpuCollectionsConvert; import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.bo.UserBO; -import cn.iocoder.mall.user.api.constant.UserErrorCodeEnum; +import cn.iocoder.mall.user.biz.enums.UserErrorCodeEnum; import org.apache.commons.lang3.StringUtils; import org.apache.dubbo.config.annotation.Reference; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java index 7ccdfb8c..c7691d79 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductAttrServiceImpl.java @@ -1,7 +1,7 @@ package cn.iocoder.mall.product.service; -import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.util.ServiceExceptionUtil; +import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; import cn.iocoder.mall.product.api.ProductAttrService; import cn.iocoder.mall.product.api.bo.*; import cn.iocoder.mall.product.api.constant.ProductAttrConstants; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductCategoryServiceImpl.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductCategoryServiceImpl.java index c067eefd..35d65862 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductCategoryServiceImpl.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductCategoryServiceImpl.java @@ -1,7 +1,7 @@ package cn.iocoder.mall.product.service; -import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.util.ServiceExceptionUtil; +import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; import cn.iocoder.mall.product.api.ProductCategoryService; import cn.iocoder.mall.product.api.bo.ProductCategoryBO; import cn.iocoder.mall.product.api.constant.ProductCategoryConstants; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java index 8fb9734e..6a572ee4 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/ProductSpuServiceImpl.java @@ -1,9 +1,9 @@ package cn.iocoder.mall.product.service; -import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.util.CollectionUtil; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.StringUtil; +import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; import cn.iocoder.mall.product.api.ProductSpuService; import cn.iocoder.mall.product.api.bo.*; import cn.iocoder.mall.product.api.constant.ProductCategoryConstants; diff --git a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java index 2794e333..06703139 100644 --- a/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java +++ b/product/product-service-impl/src/main/java/cn/iocoder/mall/product/service/UserProductSpuCollectionsServiceImpl.java @@ -1,7 +1,7 @@ package cn.iocoder.mall.product.service; -import cn.iocoder.common.framework.constant.DeletedStatusEnum; import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; diff --git a/product/product-start/pom.xml b/product/product-start/pom.xml index 594e99ee..5a0c29a9 100644 --- a/product/product-start/pom.xml +++ b/product/product-start/pom.xml @@ -33,14 +33,10 @@ product-service-impl 1.0-SNAPSHOT + cn.iocoder.mall - user-sdk - 1.0-SNAPSHOT - - - cn.iocoder.mall - system-sdk + mall-spring-boot-starter-mybatis 1.0-SNAPSHOT @@ -82,6 +78,12 @@ spring-boot-starter-test test + + cn.iocoder.mall + mall-spring-boot-starter-security + 1.0-SNAPSHOT + compile + diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java index f19574d6..8e0b2c6d 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductAttrController.java @@ -12,12 +12,13 @@ import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO; -import cn.iocoder.mall.system.sdk.context.AdminSecurityContextHolder; +import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; +import org.springframework.web.bind.annotation.*; import java.util.List; diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductBrandController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductBrandController.java index 44021978..965191b5 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductBrandController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductBrandController.java @@ -10,12 +10,13 @@ import cn.iocoder.mall.product.api.dto.ProductBrandUpdateDTO; import cn.iocoder.mall.product.application.convert.ProductBrandConvert; import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrandVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrangPageVO; -import cn.iocoder.mall.system.sdk.context.AdminSecurityContextHolder; +import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; +import org.springframework.web.bind.annotation.*; import static cn.iocoder.common.framework.vo.CommonResult.success; diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductCategoryController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductCategoryController.java index b65644ca..14151bde 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductCategoryController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductCategoryController.java @@ -9,12 +9,13 @@ import cn.iocoder.mall.product.api.dto.ProductCategoryUpdateDTO; import cn.iocoder.mall.product.application.convert.ProductCategoryConvert; import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryVO; -import cn.iocoder.mall.system.sdk.context.AdminSecurityContextHolder; +import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; +import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.Comparator; diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java index 08790e19..305f9307 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/admins/AdminsProductSpuController.java @@ -10,13 +10,14 @@ import cn.iocoder.mall.product.application.convert.ProductSpuConvert; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuVO; -import cn.iocoder.mall.system.sdk.context.AdminSecurityContextHolder; +import cn.iocoder.mall.security.core.context.AdminSecurityContextHolder; import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; +import org.springframework.web.bind.annotation.*; import java.util.Collection; import java.util.List; diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java index b0ad4125..5a8efd15 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UserFavoriteController.java @@ -4,12 +4,12 @@ import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO; -import cn.iocoder.mall.user.sdk.annotation.RequiresLogin; -import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; +import cn.iocoder.mall.security.core.context.UserSecurityContextHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; /** * 用户收藏 @@ -26,7 +26,6 @@ public class UserFavoriteController { private UserProductSpuCollectionsService userProductSpuCollectionsService; @GetMapping("page") - @RequiresLogin @ApiOperation("用户商品收藏列表") public CommonResult getUserProductSpuCollectionsPage( @Validated UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) { @@ -36,7 +35,6 @@ public class UserFavoriteController { } @DeleteMapping("remove") - @RequiresLogin @ApiOperation(value = "用户商品收藏-删除") public CommonResult removeUserFavorite(@RequestParam("spuId") final Integer spuId) { final Integer userId = UserSecurityContextHolder.getContext().getUserId(); @@ -44,7 +42,6 @@ public class UserFavoriteController { } @GetMapping("hasUserFavorite") - @RequiresLogin @ApiOperation(value = "用户商品收藏-是否收藏") public CommonResult hasUserSpuFavorite(@RequestParam("spuId") final Integer spuId) { final Integer userId = UserSecurityContextHolder.getContext().getUserId(); diff --git a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java index 39de1d96..46fe604f 100644 --- a/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java +++ b/product/product-start/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductSpuCollectionController.java @@ -2,8 +2,7 @@ package cn.iocoder.mall.product.application.controller.users; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.product.api.ProductSpuCollectionService; -import cn.iocoder.mall.user.sdk.annotation.RequiresLogin; -import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; +import cn.iocoder.mall.security.core.context.UserSecurityContextHolder; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.dubbo.config.annotation.Reference; @@ -30,7 +29,6 @@ public class UsersProductSpuCollectionController { @PostMapping("/collection/{spuId}/{hasCollectionType}") @ApiOperation("商品收藏") - @RequiresLogin public CommonResult productSpuCollection(@PathVariable("spuId") Integer spuId, @PathVariable("hasCollectionType") Integer hasCollectionType) { final Integer userId = UserSecurityContextHolder.getContext().getUserId(); diff --git a/system/system-service-api/src/main/java/cn/iocoder/mall/system/api/SystemLogService.java b/system/system-service-api/src/main/java/cn/iocoder/mall/system/api/SystemLogService.java index 31ca6963..872f6de1 100644 --- a/system/system-service-api/src/main/java/cn/iocoder/mall/system/api/SystemLogService.java +++ b/system/system-service-api/src/main/java/cn/iocoder/mall/system/api/SystemLogService.java @@ -1,9 +1,7 @@ package cn.iocoder.mall.system.api; import cn.iocoder.mall.system.api.bo.systemlog.AccessLogPageBO; -import cn.iocoder.mall.system.api.dto.systemlog.AccessLogAddDTO; import cn.iocoder.mall.system.api.dto.systemlog.AccessLogPageDTO; -import cn.iocoder.mall.system.api.dto.systemlog.ExceptionLogAddDTO; /** * 系统日志 Service 接口 diff --git a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/enums/UserErrorCodeEnum.java b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/enums/UserErrorCodeEnum.java index 8d17f5a2..a4f88e56 100644 --- a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/enums/UserErrorCodeEnum.java +++ b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/enums/UserErrorCodeEnum.java @@ -13,6 +13,9 @@ public enum UserErrorCodeEnum implements ServiceExceptionUtil.Enumerable { USER_ADDRESS_NOT_EXISTENT(1001004000, "用户地址不存在!"), USER_ADDRESS_IS_DELETED(1001004001, "用户地址已被删除!"), USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"), + + // ========== 用户 ========== + USER_NOT_EXISTS(1001004003, "获取的地址不存在!"), ; private final int code;