|
|
|
@ -0,0 +1,36 @@ |
|
|
|
package com.qniao.dam.api.command.order.user.request; |
|
|
|
|
|
|
|
import com.qniao.dam.domain.aggregate.order.entity.Order; |
|
|
|
import com.qniao.dam.domain.aggregate.order.entity.OrderItem; |
|
|
|
import com.qniao.dam.domian.aggregate.order.constant.MatchmakerOrderTypeEnum; |
|
|
|
import com.qniao.domain.Trans2DomainAssembler; |
|
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
|
import lombok.Data; |
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Data |
|
|
|
public class UserCalculateMatchmakerOrderDto implements Trans2DomainAssembler<Order> { |
|
|
|
|
|
|
|
@ApiModelProperty("产品规格标识") |
|
|
|
@NotNull(message = "产品规格标识不能为空") |
|
|
|
private Long productSpecId; |
|
|
|
|
|
|
|
@ApiModelProperty("红娘订单类型") |
|
|
|
@NotNull(message = "红娘订单类型不能为空") |
|
|
|
private MatchmakerOrderTypeEnum matchmakerOrderType; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Order trans2Domain() { |
|
|
|
Order order = new Order(); |
|
|
|
List<OrderItem> orderItemList = new ArrayList<>(); |
|
|
|
OrderItem orderItem = new OrderItem(); |
|
|
|
orderItem.setProductSpecId(productSpecId); |
|
|
|
orderItem.setQuantity(1); |
|
|
|
orderItemList.add(orderItem); |
|
|
|
order.setOrderItemList(orderItemList); |
|
|
|
return order; |
|
|
|
} |
|
|
|
} |