mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	优惠券:新增/修改时,校验对应的商品、分类是否存在
This commit is contained in:
		| @@ -0,0 +1,20 @@ | ||||
| package cn.iocoder.yudao.module.product.api.category; | ||||
|  | ||||
| import java.util.Collection; | ||||
|  | ||||
| /** | ||||
|  * 商品分类 API 接口 | ||||
|  * | ||||
|  * @author owen | ||||
|  */ | ||||
| public interface ProductCategoryApi { | ||||
|  | ||||
|     /** | ||||
|      * 校验商品分类是否有效。如下情况,视为无效: | ||||
|      * 1. 商品分类编号不存在 | ||||
|      * 2. 商品分类被禁用 | ||||
|      * | ||||
|      * @param ids 商品分类编号数组 | ||||
|      */ | ||||
|     void validateCategoryList(Collection<Long> ids); | ||||
| } | ||||
| @@ -21,6 +21,14 @@ public interface ProductSpuApi { | ||||
|      */ | ||||
|     List<ProductSpuRespDTO> getSpuList(Collection<Long> ids); | ||||
|  | ||||
|     /** | ||||
|      * 批量查询 SPU 数组,并且校验是否 SPU 是否有效 | ||||
|      * | ||||
|      * @param ids SPU 编号列表 | ||||
|      * @return SPU 数组 | ||||
|      */ | ||||
|     List<ProductSpuRespDTO> getSpuListAndValidate(Collection<Long> ids); | ||||
|  | ||||
|     /** | ||||
|      * 获得 SPU | ||||
|      * | ||||
| @@ -28,4 +36,12 @@ public interface ProductSpuApi { | ||||
|      */ | ||||
|     ProductSpuRespDTO getSpu(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 校验商品是否有效。如下情况,视为无效: | ||||
|      * 1. 商品编号不存在 | ||||
|      * 2. 商品被禁用 | ||||
|      * | ||||
|      * @param ids 商品编号数组 | ||||
|      */ | ||||
|     void validateSpuList(Collection<Long> ids); | ||||
| } | ||||
|   | ||||
| @@ -34,7 +34,7 @@ public interface ErrorCodeConstants { | ||||
|     // ========== 商品 SPU 1-008-005-000 ========== | ||||
|     ErrorCode SPU_NOT_EXISTS = new ErrorCode(1_008_005_000, "商品 SPU 不存在"); | ||||
|     ErrorCode SPU_SAVE_FAIL_CATEGORY_LEVEL_ERROR = new ErrorCode(1_008_005_001, "商品分类不正确,原因:必须使用第二级的商品分类及以下"); | ||||
|     ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_002, "商品 SPU 不处于上架状态"); | ||||
|     ErrorCode SPU_NOT_ENABLE = new ErrorCode(1_008_005_002, "商品 SPU【[]】不处于上架状态"); | ||||
|     ErrorCode SPU_NOT_RECYCLE = new ErrorCode(1_008_005_003, "商品 SPU 不处于回收站状态"); | ||||
|  | ||||
|     // ========== 商品 SKU 1-008-006-000 ========== | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 owen
					owen