Commit a56d6aae7a2d027b7fbfbcd461092bfcd5128fc7
Merge branch 'master' of http://git3.nong12.com/xtrade/order-service
Showing
2 changed files
with
86 additions
and
85 deletions
src/main/java/com/diligrp/xtrade/order/controllor/OrderApiController.java
... | ... | @@ -32,9 +32,9 @@ public class OrderApiController { |
32 | 32 | * 订单创建接口 |
33 | 33 | */ |
34 | 34 | @RequestMapping(value = "/createOrder",method = {RequestMethod.POST}) |
35 | - public Message<Boolean> createOrder(@RequestBody @Validated OrderCreateRequestDto orderCreateRequestDto) { | |
35 | + public Message<?> createOrder(@RequestBody @Validated OrderCreateRequestDto orderCreateRequestDto) { | |
36 | 36 | orderservice.createOrder(orderCreateRequestDto); |
37 | - return Message.<Boolean>builder().success(Boolean.TRUE); | |
37 | + return Message.builder().success(Boolean.TRUE); | |
38 | 38 | } |
39 | 39 | |
40 | 40 | /** | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
1 | -package com.diligrp.xtrade.order.domain.builder; | |
2 | - | |
3 | -import org.springframework.beans.BeanUtils; | |
4 | - | |
5 | -import com.diligrp.xtrade.order.domain.dto.AccountDto; | |
6 | -import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
7 | -import com.diligrp.xtrade.order.domain.entity.OrderDo; | |
8 | - | |
9 | -/** | |
10 | - * 订单构造相关 | |
11 | - * @author zhangxing | |
12 | - * | |
13 | - */ | |
14 | -public class DefaultOrderCreator { | |
15 | - | |
16 | - //最终订单数据 | |
17 | - private OrderDo order; | |
18 | - | |
19 | - //订单创建请求实体 | |
20 | - private OrderCreateRequestDto orderCreateRequestDto; | |
21 | - | |
22 | - //卖家实体 | |
23 | - private AccountDto saccountDto; | |
24 | - | |
25 | - //买家实体 | |
26 | - private AccountDto baccountDto; | |
27 | - | |
28 | - //无参构造器 | |
29 | - public DefaultOrderCreator(){ | |
30 | - | |
31 | - } | |
32 | - | |
33 | - public DefaultOrderCreator(OrderCreateRequestDto orderCreateRequestDto, AccountDto saccountDto, AccountDto baccountDto){ | |
34 | - this.orderCreateRequestDto = orderCreateRequestDto; | |
35 | - this.baccountDto = baccountDto; | |
36 | - this.saccountDto = saccountDto; | |
37 | - } | |
38 | - | |
39 | - /** | |
40 | - * 初始化订单数据用于后面的校验 | |
41 | - */ | |
42 | - public void initialize() { | |
43 | - | |
44 | - } | |
45 | - | |
46 | - public OrderDo getOrder() { | |
47 | - return order; | |
48 | - } | |
49 | - | |
50 | - public void setOrder(OrderDo order) { | |
51 | - this.order = order; | |
52 | - } | |
53 | - | |
54 | - public OrderCreateRequestDto getOrderCreateRequestDto() { | |
55 | - return orderCreateRequestDto; | |
56 | - } | |
57 | - | |
58 | - public void setOrderCreateRequestDto(OrderCreateRequestDto orderCreateRequestDto) { | |
59 | - this.orderCreateRequestDto = orderCreateRequestDto; | |
60 | - } | |
61 | - | |
62 | - public AccountDto getSaccountDto() { | |
63 | - return saccountDto; | |
64 | - } | |
65 | - | |
66 | - public void setSaccountDto(AccountDto saccountDto) { | |
67 | - this.saccountDto = saccountDto; | |
68 | - } | |
69 | - | |
70 | - public AccountDto getBaccountDto() { | |
71 | - return baccountDto; | |
72 | - } | |
73 | - | |
74 | - public void setBaccountDto(AccountDto baccountDto) { | |
75 | - this.baccountDto = baccountDto; | |
76 | - } | |
77 | - | |
78 | - public static OrderDo build(OrderCreateRequestDto orderCreateRequestDto) { | |
79 | - OrderDo orderDo = new OrderDo(); | |
80 | - BeanUtils.copyProperties(orderCreateRequestDto, orderDo); | |
81 | - return orderDo; | |
82 | - } | |
83 | -} | |
1 | +package com.diligrp.xtrade.order.domain.builder; | |
2 | + | |
3 | +import org.springframework.beans.BeanUtils; | |
4 | + | |
5 | +import com.diligrp.xtrade.order.domain.dto.AccountDto; | |
6 | +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
7 | +import com.diligrp.xtrade.order.domain.entity.OrderDo; | |
8 | + | |
9 | +/** | |
10 | + * @ClassName: DefaultOrderCreator | |
11 | + * @Description 订单实体相关模型 | |
12 | + * @author zhangxing | |
13 | + * @date 2020年4月21日 | |
14 | + */ | |
15 | +public class DefaultOrderCreator { | |
16 | + | |
17 | + //最终订单数据 | |
18 | + private OrderDo order; | |
19 | + | |
20 | + //订单创建请求实体 | |
21 | + private OrderCreateRequestDto orderCreateRequestDto; | |
22 | + | |
23 | + //卖家实体 | |
24 | + private AccountDto saccountDto; | |
25 | + | |
26 | + //买家实体 | |
27 | + private AccountDto baccountDto; | |
28 | + | |
29 | + //无参构造器 | |
30 | + public DefaultOrderCreator(){ | |
31 | + | |
32 | + } | |
33 | + | |
34 | + public DefaultOrderCreator(OrderCreateRequestDto orderCreateRequestDto, AccountDto saccountDto, AccountDto baccountDto){ | |
35 | + this.orderCreateRequestDto = orderCreateRequestDto; | |
36 | + this.baccountDto = baccountDto; | |
37 | + this.saccountDto = saccountDto; | |
38 | + } | |
39 | + | |
40 | + /** | |
41 | + * 初始化订单数据用于后面的校验 | |
42 | + */ | |
43 | + public void initialize() { | |
44 | + | |
45 | + } | |
46 | + | |
47 | + public OrderDo getOrder() { | |
48 | + return order; | |
49 | + } | |
50 | + | |
51 | + public void setOrder(OrderDo order) { | |
52 | + this.order = order; | |
53 | + } | |
54 | + | |
55 | + public OrderCreateRequestDto getOrderCreateRequestDto() { | |
56 | + return orderCreateRequestDto; | |
57 | + } | |
58 | + | |
59 | + public void setOrderCreateRequestDto(OrderCreateRequestDto orderCreateRequestDto) { | |
60 | + this.orderCreateRequestDto = orderCreateRequestDto; | |
61 | + } | |
62 | + | |
63 | + public AccountDto getSaccountDto() { | |
64 | + return saccountDto; | |
65 | + } | |
66 | + | |
67 | + public void setSaccountDto(AccountDto saccountDto) { | |
68 | + this.saccountDto = saccountDto; | |
69 | + } | |
70 | + | |
71 | + public AccountDto getBaccountDto() { | |
72 | + return baccountDto; | |
73 | + } | |
74 | + | |
75 | + public void setBaccountDto(AccountDto baccountDto) { | |
76 | + this.baccountDto = baccountDto; | |
77 | + } | |
78 | + | |
79 | + public static OrderDo build(OrderCreateRequestDto orderCreateRequestDto) { | |
80 | + OrderDo orderDo = new OrderDo(); | |
81 | + BeanUtils.copyProperties(orderCreateRequestDto, orderDo); | |
82 | + return orderDo; | |
83 | + } | |
84 | +} | ... | ... |