🚧 商品包调整

This commit is contained in:
linhj 2020-05-11 18:12:13 +08:00
parent b996ddfa1e
commit 055d204ded
21 changed files with 46 additions and 32 deletions

View File

@ -49,6 +49,12 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>mall-spring-boot-starter-mybatis</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- RPC 相关 --> <!-- RPC 相关 -->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
@ -78,6 +84,12 @@
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>user-biz</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.product.dataobject; 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.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.product.message; package cn.iocoder.mall.product.message;
import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; 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.UserProductSpuCollectionsService;
import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO;
import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsAddDTO; 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.product.convert.UserProductSpuCollectionsConvert;
import cn.iocoder.mall.user.api.UserService; import cn.iocoder.mall.user.api.UserService;
import cn.iocoder.mall.user.api.bo.UserBO; 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.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.product.service; package cn.iocoder.mall.product.service;
import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; 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.ProductAttrService;
import cn.iocoder.mall.product.api.bo.*; import cn.iocoder.mall.product.api.bo.*;
import cn.iocoder.mall.product.api.constant.ProductAttrConstants; import cn.iocoder.mall.product.api.constant.ProductAttrConstants;

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.product.service; package cn.iocoder.mall.product.service;
import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; 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.ProductCategoryService;
import cn.iocoder.mall.product.api.bo.ProductCategoryBO; import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
import cn.iocoder.mall.product.api.constant.ProductCategoryConstants; import cn.iocoder.mall.product.api.constant.ProductCategoryConstants;

View File

@ -1,9 +1,9 @@
package cn.iocoder.mall.product.service; 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.CollectionUtil;
import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import cn.iocoder.common.framework.util.StringUtil; 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.ProductSpuService;
import cn.iocoder.mall.product.api.bo.*; import cn.iocoder.mall.product.api.bo.*;
import cn.iocoder.mall.product.api.constant.ProductCategoryConstants; import cn.iocoder.mall.product.api.constant.ProductCategoryConstants;

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.product.service; package cn.iocoder.mall.product.service;
import cn.iocoder.common.framework.constant.DeletedStatusEnum;
import cn.iocoder.common.framework.vo.CommonResult; 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.UserProductSpuCollectionsService;
import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsBO;
import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO;

View File

@ -33,14 +33,10 @@
<artifactId>product-service-impl</artifactId> <artifactId>product-service-impl</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.iocoder.mall</groupId> <groupId>cn.iocoder.mall</groupId>
<artifactId>user-sdk</artifactId> <artifactId>mall-spring-boot-starter-mybatis</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>system-sdk</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
@ -82,6 +78,12 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>mall-spring-boot-starter-security</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

View File

@ -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.AdminsProductAttrSimpleVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO; 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.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;

View File

@ -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.convert.ProductBrandConvert;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrandVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrandVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductBrangPageVO; 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.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;
import static cn.iocoder.common.framework.vo.CommonResult.success; import static cn.iocoder.common.framework.vo.CommonResult.success;

View File

@ -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.convert.ProductCategoryConvert;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryTreeNodeVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductCategoryVO; 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.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;

View File

@ -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.AdminsProductSpuDetailVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO; import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO;
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuVO; 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 com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;

View File

@ -4,12 +4,12 @@ import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.product.api.UserProductSpuCollectionsService; import cn.iocoder.mall.product.api.UserProductSpuCollectionsService;
import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO; import cn.iocoder.mall.product.api.bo.UserProductSpuCollectionsPageBO;
import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO; import cn.iocoder.mall.product.api.dto.UserProductSpuCollectionsPageDTO;
import cn.iocoder.mall.user.sdk.annotation.RequiresLogin; import cn.iocoder.mall.security.core.context.UserSecurityContextHolder;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/** /**
* 用户收藏 * 用户收藏
@ -26,7 +26,6 @@ public class UserFavoriteController {
private UserProductSpuCollectionsService userProductSpuCollectionsService; private UserProductSpuCollectionsService userProductSpuCollectionsService;
@GetMapping("page") @GetMapping("page")
@RequiresLogin
@ApiOperation("用户商品收藏列表") @ApiOperation("用户商品收藏列表")
public CommonResult<UserProductSpuCollectionsPageBO> getUserProductSpuCollectionsPage( public CommonResult<UserProductSpuCollectionsPageBO> getUserProductSpuCollectionsPage(
@Validated UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) { @Validated UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) {
@ -36,7 +35,6 @@ public class UserFavoriteController {
} }
@DeleteMapping("remove") @DeleteMapping("remove")
@RequiresLogin
@ApiOperation(value = "用户商品收藏-删除") @ApiOperation(value = "用户商品收藏-删除")
public CommonResult<Boolean> removeUserFavorite(@RequestParam("spuId") final Integer spuId) { public CommonResult<Boolean> removeUserFavorite(@RequestParam("spuId") final Integer spuId) {
final Integer userId = UserSecurityContextHolder.getContext().getUserId(); final Integer userId = UserSecurityContextHolder.getContext().getUserId();
@ -44,7 +42,6 @@ public class UserFavoriteController {
} }
@GetMapping("hasUserFavorite") @GetMapping("hasUserFavorite")
@RequiresLogin
@ApiOperation(value = "用户商品收藏-是否收藏") @ApiOperation(value = "用户商品收藏-是否收藏")
public CommonResult<Boolean> hasUserSpuFavorite(@RequestParam("spuId") final Integer spuId) { public CommonResult<Boolean> hasUserSpuFavorite(@RequestParam("spuId") final Integer spuId) {
final Integer userId = UserSecurityContextHolder.getContext().getUserId(); final Integer userId = UserSecurityContextHolder.getContext().getUserId();

View File

@ -2,8 +2,7 @@ package cn.iocoder.mall.product.application.controller.users;
import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.product.api.ProductSpuCollectionService; import cn.iocoder.mall.product.api.ProductSpuCollectionService;
import cn.iocoder.mall.user.sdk.annotation.RequiresLogin; import cn.iocoder.mall.security.core.context.UserSecurityContextHolder;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.annotation.Reference;
@ -30,7 +29,6 @@ public class UsersProductSpuCollectionController {
@PostMapping("/collection/{spuId}/{hasCollectionType}") @PostMapping("/collection/{spuId}/{hasCollectionType}")
@ApiOperation("商品收藏") @ApiOperation("商品收藏")
@RequiresLogin
public CommonResult<Boolean> productSpuCollection(@PathVariable("spuId") Integer spuId, public CommonResult<Boolean> productSpuCollection(@PathVariable("spuId") Integer spuId,
@PathVariable("hasCollectionType") Integer hasCollectionType) { @PathVariable("hasCollectionType") Integer hasCollectionType) {
final Integer userId = UserSecurityContextHolder.getContext().getUserId(); final Integer userId = UserSecurityContextHolder.getContext().getUserId();

View File

@ -1,9 +1,7 @@
package cn.iocoder.mall.system.api; package cn.iocoder.mall.system.api;
import cn.iocoder.mall.system.api.bo.systemlog.AccessLogPageBO; 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.AccessLogPageDTO;
import cn.iocoder.mall.system.api.dto.systemlog.ExceptionLogAddDTO;
/** /**
* 系统日志 Service 接口 * 系统日志 Service 接口

View File

@ -13,6 +13,9 @@ public enum UserErrorCodeEnum implements ServiceExceptionUtil.Enumerable {
USER_ADDRESS_NOT_EXISTENT(1001004000, "用户地址不存在!"), USER_ADDRESS_NOT_EXISTENT(1001004000, "用户地址不存在!"),
USER_ADDRESS_IS_DELETED(1001004001, "用户地址已被删除!"), USER_ADDRESS_IS_DELETED(1001004001, "用户地址已被删除!"),
USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"), USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"),
// ========== 用户 ==========
USER_NOT_EXISTS(1001004003, "获取的地址不存在!"),
; ;
private final int code; private final int code;