|
|
|
|
@ -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<UserProductSpuCollectionsPageBO> getUserProductSpuCollectionsPage(
|
|
|
|
|
@Validated UserProductSpuCollectionsPageDTO userProductSpuCollectionsPageDTO) {
|
|
|
|
|
@ -36,7 +35,6 @@ public class UserFavoriteController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("remove")
|
|
|
|
|
@RequiresLogin
|
|
|
|
|
@ApiOperation(value = "用户商品收藏-删除")
|
|
|
|
|
public CommonResult<Boolean> 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<Boolean> hasUserSpuFavorite(@RequestParam("spuId") final Integer spuId) {
|
|
|
|
|
final Integer userId = UserSecurityContextHolder.getContext().getUserId();
|
|
|
|
|
|