Commit 5d4448148574f69d36e0080099a1a81595752b96

Authored by zhangxing
1 parent 40e23572

构造方法

src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
@@ -33,7 +33,7 @@ public class DefaultOrderCreator { @@ -33,7 +33,7 @@ public class DefaultOrderCreator {
33 33
34 private OrderCreateRequestDto orderCreateDto; 34 private OrderCreateRequestDto orderCreateDto;
35 35
36 - private DefaultOrderCreator(AccountDto saccountDto, OrderCreateRequestDto orderCreateDto) { 36 + private DefaultOrderCreator(AccountDto saccountDto, AccountDto baccountDto, OrderCreateRequestDto orderCreateDto) {
37 this.saccountDto = saccountDto; 37 this.saccountDto = saccountDto;
38 this.orderCreateDto = orderCreateDto; 38 this.orderCreateDto = orderCreateDto;
39 } 39 }
@@ -41,13 +41,23 @@ public class DefaultOrderCreator { @@ -41,13 +41,23 @@ public class DefaultOrderCreator {
41 public static DefaultOrderCreator builder(AccountDto saccountDto, OrderCreateRequestDto orderCreateDto, 41 public static DefaultOrderCreator builder(AccountDto saccountDto, OrderCreateRequestDto orderCreateDto,
42 Long orderId) { 42 Long orderId) {
43 orderCreateDto.setOrderId(orderId); 43 orderCreateDto.setOrderId(orderId);
44 - return new DefaultOrderCreator(saccountDto, orderCreateDto); 44 + return new DefaultOrderCreator(saccountDto, null, orderCreateDto);
  45 + }
  46 +
  47 + public static DefaultOrderCreator builder(AccountDto saccountDto, AccountDto baccountDto,
  48 + OrderCreateRequestDto orderCreateDto, Long orderId) {
  49 + orderCreateDto.setOrderId(orderId);
  50 + return new DefaultOrderCreator(saccountDto, baccountDto, orderCreateDto);
  51 + }
  52 +
  53 + public static DefaultOrderCreator builder(AccountDto baccountDto) {
  54 + return new DefaultOrderCreator(null, baccountDto, null);
45 } 55 }
46 56
47 public OrderDo createOrder() { 57 public OrderDo createOrder() {
48 return this.orderDo; 58 return this.orderDo;
49 } 59 }
50 - 60 +
51 public List<OrderItemDo> createOrderItems() { 61 public List<OrderItemDo> createOrderItems() {
52 return this.items; 62 return this.items;
53 } 63 }