-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/mall_product' of https://gitee.com/zhijiantiany…
…a/ruoyi-vue-pro # Conflicts: # pom.xml # sql/mysql/pay_wallet.sql # yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java
- Loading branch information
Showing
50 changed files
with
718 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
.../cn/iocoder/yudao/module/product/controller/admin/favorite/ProductFavoriteController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package cn.iocoder.yudao.module.product.controller.admin.favorite; | ||
|
||
import cn.hutool.core.collection.CollUtil; | ||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
import cn.iocoder.yudao.module.product.controller.admin.favorite.vo.ProductFavoritePageReqVO; | ||
import cn.iocoder.yudao.module.product.controller.admin.favorite.vo.ProductFavoriteRespVO; | ||
import cn.iocoder.yudao.module.product.convert.favorite.ProductFavoriteConvert; | ||
import cn.iocoder.yudao.module.product.dal.dataobject.favorite.ProductFavoriteDO; | ||
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; | ||
import cn.iocoder.yudao.module.product.service.favorite.ProductFavoriteService; | ||
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.annotation.Resource; | ||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | ||
|
||
@Tag(name = "管理后台 - 商品收藏") | ||
@RestController | ||
@RequestMapping("/product/favorite") | ||
@Validated | ||
public class ProductFavoriteController { | ||
|
||
@Resource | ||
private ProductFavoriteService productFavoriteService; | ||
|
||
@Resource | ||
private ProductSpuService productSpuService; | ||
|
||
@GetMapping("/page") | ||
@Operation(summary = "获得商品收藏分页") | ||
@PreAuthorize("@ss.hasPermission('product:favorite:query')") | ||
public CommonResult<PageResult<ProductFavoriteRespVO>> getFavoritePage(@Valid ProductFavoritePageReqVO pageVO) { | ||
PageResult<ProductFavoriteDO> pageResult = productFavoriteService.getFavoritePage(pageVO); | ||
if (CollUtil.isEmpty(pageResult.getList())) { | ||
return success(PageResult.empty()); | ||
} | ||
// 拼接数据 | ||
List<ProductSpuDO> spuList = productSpuService.getSpuList(convertSet(pageResult.getList(), ProductFavoriteDO::getSpuId)); | ||
return success(ProductFavoriteConvert.INSTANCE.convertPage(pageResult, spuList)); | ||
} | ||
|
||
} |
Oops, something went wrong.