Compare commits
4 Commits
add-produc
...
mentat-631
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b23ed4fc01 | ||
![]() |
c21ee3ebf6 | ||
![]() |
458235e444 | ||
![]() |
664abe7062 |
@@ -17,8 +17,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.convertList;
|
||||
|
||||
@Tag(name = "管理后台 - 商品属性项")
|
||||
@RestController
|
||||
@@ -70,4 +72,12 @@ public class ProductPropertyController {
|
||||
return success(BeanUtils.toBean(pageResult, ProductPropertyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得属性项精简列表")
|
||||
public CommonResult<List<ProductPropertyRespVO>> getPropertySimpleList() {
|
||||
List<ProductPropertyDO> list = productPropertyService.getPropertyList();
|
||||
return success(convertList(list, property -> new ProductPropertyRespVO() // 只返回 id、name 属性
|
||||
.setId(property.getId()).setName(property.getName())));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,8 +17,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton;
|
||||
|
||||
@Tag(name = "管理后台 - 商品属性值")
|
||||
@RestController
|
||||
@@ -70,4 +73,13 @@ public class ProductPropertyValueController {
|
||||
return success(BeanUtils.toBean(pageResult, ProductPropertyValueRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得属性值精简列表")
|
||||
@Parameter(name = "propertyId", description = "属性项编号", required = true, example = "1024")
|
||||
public CommonResult<List<ProductPropertyValueRespVO>> getPropertyValueSimpleList(@RequestParam("propertyId") Long propertyId) {
|
||||
List<ProductPropertyValueDO> list = productPropertyValueService.getPropertyValueListByPropertyId(singleton(propertyId));
|
||||
return success(convertList(list, value -> new ProductPropertyValueRespVO() // 只返回 id、name 属性
|
||||
.setId(value.getId()).setName(value.getName())));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -39,10 +39,6 @@ public class ProductPropertyDO extends BaseDO {
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@@ -62,4 +62,11 @@ public interface ProductPropertyService {
|
||||
*/
|
||||
List<ProductPropertyDO> getPropertyList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得指定状态的属性项列表
|
||||
*
|
||||
* @return 属性项列表
|
||||
*/
|
||||
List<ProductPropertyDO> getPropertyList();
|
||||
|
||||
}
|
||||
|
@@ -109,4 +109,9 @@ public class ProductPropertyServiceImpl implements ProductPropertyService {
|
||||
return productPropertyMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductPropertyDO> getPropertyList() {
|
||||
return productPropertyMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -59,4 +59,9 @@ public class PayAppDO extends BaseDO {
|
||||
*/
|
||||
private String transferNotifyUrl;
|
||||
|
||||
}
|
||||
/**
|
||||
* 应用密钥
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
}
|
@@ -146,4 +146,22 @@ public interface PayOrderService {
|
||||
*/
|
||||
int expireOrder();
|
||||
|
||||
}
|
||||
/**
|
||||
* 获得支付订单
|
||||
*
|
||||
* @param appKey 应用密钥
|
||||
* @param merchantOrderId 商户订单编号
|
||||
* @return 支付订单
|
||||
*/
|
||||
PayOrderDO getOrder(String appKey, String merchantOrderId);
|
||||
|
||||
/**
|
||||
* 创建支付单
|
||||
*
|
||||
* @param reqDTO 创建请求
|
||||
* @param appKey 应用密钥
|
||||
* @return 支付单编号
|
||||
*/
|
||||
Long createOrder(@Valid PayOrderCreateReqDTO reqDTO, String appKey);
|
||||
|
||||
}
|
@@ -85,6 +85,15 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
return orderMapper.selectByAppIdAndMerchantOrderId(appId, merchantOrderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayOrderDO getOrder(String appKey, String merchantOrderId) {
|
||||
PayAppDO app = appService.getAppByAppKey(appKey);
|
||||
if (app == null) {
|
||||
throw exception(PAY_APP_NOT_FOUND);
|
||||
}
|
||||
return orderMapper.selectByAppIdAndMerchantOrderId(app.getId(), merchantOrderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PayOrderDO> getOrderList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
|
Reference in New Issue
Block a user