Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
ba7669f3
提交
ba7669f3
authored
3月 17, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- order 临时提交 发现 db 链接的不对
上级
8a652c24
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
511 行增加
和
77 行删除
+511
-77
pom.xml
order/order-application/pom.xml
+46
-10
OrderApplication.java
...src/main/java/cn/iocoder/mall/order/OrderApplication.java
+15
-0
application.yaml
order/order-application/src/main/resources/application.yaml
+3
-27
pom.xml
order/order-service-api/pom.xml
+7
-1
OrderCreateDTO.java
...in/java/cn/iocoder/mall/order/api/dto/OrderCreateDTO.java
+86
-0
OrderCreateItemDTO.java
...ava/cn/iocoder/mall/order/api/dto/OrderCreateItemDTO.java
+49
-0
pom.xml
order/order-service-impl/pom.xml
+66
-1
DatabaseConfiguration.java
...a/cn/iocoder/mall/order/config/DatabaseConfiguration.java
+15
-0
ServiceExceptionConfiguration.java
...oder/mall/order/config/ServiceExceptionConfiguration.java
+21
-0
OrderConvert.java
...main/java/cn/iocoder/mall/order/convert/OrderConvert.java
+41
-0
OrderDO.java
...c/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java
+26
-13
OrderItemDO.java
...in/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java
+12
-6
OrderServiceImpl.java
.../java/cn/iocoder/mall/order/service/OrderServiceImpl.java
+75
-0
ServiceImpl.java
.../main/java/cn/iocoder/mall/order/service/ServiceImpl.java
+0
-16
OrderApplicationTest.java
...test/java/cn/iocoder/mall/order/OrderApplicationTest.java
+4
-3
OrderServiceImplTest.java
...a/cn/iocoder/mall/order/service/OrderServiceImplTest.java
+45
-0
没有找到文件。
order/order-application/pom.xml
浏览文件 @
ba7669f3
...
...
@@ -11,27 +11,31 @@
<artifactId>
order-application
</artifactId>
<properties>
<org.mapstruct.version>
1.3.0.Final
</org.mapstruct.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
order-service-impl
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
admin-sdk
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
common-framework
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.0.0
</version>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
...
...
@@ -64,7 +68,6 @@
<version>
${org.mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
...
...
@@ -75,6 +78,29 @@
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.9.2
</version>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<!-- use mapstruct-jdk8 for Java 8 or higher -->
<version>
${org.mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<version>
2.1.3
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
</dependencies>
<build>
...
...
@@ -96,6 +122,16 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<!-- 打包 -->
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<fork>
true
</fork>
</configuration>
</plugin>
</plugins>
</build>
...
...
order/order-application/src/main/java/cn/iocoder/mall/order/OrderApplication.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
(
scanBasePackages
=
{
"cn.iocoder.mall.order"
})
public
class
OrderApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
OrderApplication
.
class
,
args
);
}
}
\ No newline at end of file
order/order-application/src/main/resources/application.yaml
浏览文件 @
ba7669f3
spring
:
application
:
name
:
order-application
# datasource
datasource
:
url
:
jdbc:mysql://127.0.0.1:33061/mall_order?useSSL=false
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
password
:
123456
# server
server
:
port
:
8080
# mybatis
mybatis
:
config-location
:
classpath:mybatis-config.xml
mapper-locations
:
classpath:mapper/*.xml
type-aliases-package
:
cn.iocoder.mall.order.dataobject
# dubbo
dubbo
:
registry
:
address
:
zookeeper://127.0.0.1:2181
protocol
:
port
:
-1
name
:
dubbo
scan
:
base-packages
:
cn.iocoder.mall.order.service
demo
:
service
:
version
:
1.0.0
\ No newline at end of file
port
:
18084
servlet
:
context-path
:
/order-api/
order/order-service-api/pom.xml
浏览文件 @
ba7669f3
...
...
@@ -11,5 +11,10 @@
<artifactId>
order-service-api
</artifactId>
<dependencies>
<dependency>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCreateDTO.java
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
api
.
dto
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 订单创建
...
...
@@ -9,4 +12,87 @@ import java.io.Serializable;
* @time 2019-03-16 14:42
*/
public
class
OrderCreateDTO
implements
Serializable
{
/**
* 收件区域编号
*/
@NotNull
private
String
receiverAreaNo
;
/**
* 收件手机号
*/
@NotNull
private
String
receiverMobile
;
/**
* 收件详细地址
*/
@NotNull
private
String
receiverAddress
;
/**
* 备注
*/
private
String
remark
;
///
/// order item
@NotNull
@Size
(
max
=
1000
,
min
=
1
)
private
List
<
OrderCreateItemDTO
>
orderItems
;
@Override
public
String
toString
()
{
return
"OrderCreateDTO{"
+
"receiverAreaNo='"
+
receiverAreaNo
+
'\''
+
", receiverMobile='"
+
receiverMobile
+
'\''
+
", receiverAddress='"
+
receiverAddress
+
'\''
+
", remark='"
+
remark
+
'\''
+
", orderItems="
+
orderItems
+
'}'
;
}
public
String
getReceiverAreaNo
()
{
return
receiverAreaNo
;
}
public
OrderCreateDTO
setReceiverAreaNo
(
String
receiverAreaNo
)
{
this
.
receiverAreaNo
=
receiverAreaNo
;
return
this
;
}
public
String
getReceiverMobile
()
{
return
receiverMobile
;
}
public
OrderCreateDTO
setReceiverMobile
(
String
receiverMobile
)
{
this
.
receiverMobile
=
receiverMobile
;
return
this
;
}
public
String
getReceiverAddress
()
{
return
receiverAddress
;
}
public
OrderCreateDTO
setReceiverAddress
(
String
receiverAddress
)
{
this
.
receiverAddress
=
receiverAddress
;
return
this
;
}
public
String
getRemark
()
{
return
remark
;
}
public
OrderCreateDTO
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
return
this
;
}
public
List
<
OrderCreateItemDTO
>
getOrderItems
()
{
return
orderItems
;
}
public
OrderCreateDTO
setOrderItems
(
List
<
OrderCreateItemDTO
>
orderItems
)
{
this
.
orderItems
=
orderItems
;
return
this
;
}
}
order/order-service-api/src/main/java/cn/iocoder/mall/order/api/dto/OrderCreateItemDTO.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
api
.
dto
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.NotNull
;
/**
* @author Sin
* @time 2019-03-17 09:37
*/
public
class
OrderCreateItemDTO
{
/**
* 商品编号
*/
@NotNull
private
String
commodityId
;
/**
* 数量
*/
@NotNull
@Max
(
value
=
1000
)
private
Integer
quantity
;
@Override
public
String
toString
()
{
return
"OrderCreateItemDTO{"
+
"commodityId='"
+
commodityId
+
'\''
+
", quantity="
+
quantity
+
'}'
;
}
public
String
getCommodityId
()
{
return
commodityId
;
}
public
OrderCreateItemDTO
setCommodityId
(
String
commodityId
)
{
this
.
commodityId
=
commodityId
;
return
this
;
}
public
Integer
getQuantity
()
{
return
quantity
;
}
public
OrderCreateItemDTO
setQuantity
(
Integer
quantity
)
{
this
.
quantity
=
quantity
;
return
this
;
}
}
order/order-service-impl/pom.xml
浏览文件 @
ba7669f3
...
...
@@ -11,18 +11,28 @@
<artifactId>
order-service-impl
</artifactId>
<properties>
<org.mapstruct.version>
1.3.0.Final
</org.mapstruct.version>
</properties>
<dependencies>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
order-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
admin-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
dubbo
</artifactId>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
@@ -37,11 +47,65 @@
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.0.0
</version>
</dependency>
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<version>
${org.mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
27.0.1-jre
</version>
</dependency>
<dependency>
<groupId>
Pingplusplus
</groupId>
<artifactId>
pingpp-java
</artifactId>
<version>
2.2.4
</version>
<type>
jar
</type>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
2.0.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-spring-boot-starter
</artifactId>
<version>
2.0.1
</version>
</dependency>
<!-- test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 提供给 mapstruct 使用 -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.5.1
</version>
<configuration>
<source>
1.8
</source>
<!-- or higher, depending on your project -->
<target>
1.8
</target>
<!-- or higher, depending on your project -->
<annotationProcessorPaths>
<path>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${org.mapstruct.version}
</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
order/order-service-impl/src/main/java/cn/iocoder/mall/order/config/DatabaseConfiguration.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
config
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@Configuration
@MapperScan
(
"cn.iocoder.mall.order.dao"
)
// 扫描对应的 Mapper 接口
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
public
class
DatabaseConfiguration
{
// 数据源,使用 HikariCP
}
\ No newline at end of file
order/order-service-impl/src/main/java/cn/iocoder/mall/order/config/ServiceExceptionConfiguration.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
config
;
import
org.springframework.boot.context.event.ApplicationReadyEvent
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.event.EventListener
;
@Configuration
public
class
ServiceExceptionConfiguration
{
@EventListener
(
ApplicationReadyEvent
.
class
)
// 可参考 https://www.cnblogs.com/ssslinppp/p/7607509.html
public
void
initMessages
()
{
// 从 service_exception_message.properties 加载错误码的方案
// Properties properties;
// try {
// properties = PropertiesLoaderUtils.loadAllProperties("classpath:service_exception_message.properties");
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
}
}
\ No newline at end of file
order/order-service-impl/src/main/java/cn/iocoder/mall/order/convert/OrderConvert.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
convert
;
import
cn.iocoder.mall.order.api.dto.OrderCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCreateItemDTO
;
import
cn.iocoder.mall.order.dataobject.OrderDO
;
import
cn.iocoder.mall.order.dataobject.OrderItemDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
/**
* 订单 convert
*
* @author Sin
* @time 2019-03-17 10:14
*/
@Mapper
public
interface
OrderConvert
{
OrderConvert
INSTANCE
=
Mappers
.
getMapper
(
OrderConvert
.
class
);
/**
* 转换 OrderDO
*
* @param orderCreateDTO
* @return
*/
@Mappings
({})
OrderDO
convert
(
OrderCreateDTO
orderCreateDTO
);
/**
* 转换 OrderItemDO
*
* @param orderCreateItemDTOList
* @return
*/
@Mappings
({})
List
<
OrderItemDO
>
convert
(
List
<
OrderCreateItemDTO
>
orderCreateItemDTOList
);
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderDO.java
浏览文件 @
ba7669f3
...
...
@@ -99,103 +99,116 @@ public class OrderDO implements Serializable {
return
id
;
}
public
void
setId
(
String
id
)
{
public
OrderDO
setId
(
String
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
String
orderNo
)
{
public
OrderDO
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
return
this
;
}
public
Integer
getPrice
()
{
return
price
;
}
public
void
setPrice
(
Integer
price
)
{
public
OrderDO
setPrice
(
Integer
price
)
{
this
.
price
=
price
;
return
this
;
}
public
String
getReceiverAreaNo
()
{
return
receiverAreaNo
;
}
public
void
setReceiverAreaNo
(
String
receiverAreaNo
)
{
public
OrderDO
setReceiverAreaNo
(
String
receiverAreaNo
)
{
this
.
receiverAreaNo
=
receiverAreaNo
;
return
this
;
}
public
String
getReceiverMobile
()
{
return
receiverMobile
;
}
public
void
setReceiverMobile
(
String
receiverMobile
)
{
public
OrderDO
setReceiverMobile
(
String
receiverMobile
)
{
this
.
receiverMobile
=
receiverMobile
;
return
this
;
}
public
String
getReceiverAddress
()
{
return
receiverAddress
;
}
public
void
setReceiverAddress
(
String
receiverAddress
)
{
public
OrderDO
setReceiverAddress
(
String
receiverAddress
)
{
this
.
receiverAddress
=
receiverAddress
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
public
OrderDO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
Integer
getPayStatus
()
{
return
payStatus
;
}
public
void
setPayStatus
(
Integer
payStatus
)
{
public
OrderDO
setPayStatus
(
Integer
payStatus
)
{
this
.
payStatus
=
payStatus
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
public
OrderDO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getPaymentTime
()
{
return
paymentTime
;
}
public
void
setPaymentTime
(
Date
paymentTime
)
{
public
OrderDO
setPaymentTime
(
Date
paymentTime
)
{
this
.
paymentTime
=
paymentTime
;
return
this
;
}
public
Date
getDeliveryTime
()
{
return
deliveryTime
;
}
public
void
setDeliveryTime
(
Date
deliveryTime
)
{
public
OrderDO
setDeliveryTime
(
Date
deliveryTime
)
{
this
.
deliveryTime
=
deliveryTime
;
return
this
;
}
public
Date
getClosingTime
()
{
return
closingTime
;
}
public
void
setClosingTime
(
Date
closingTime
)
{
public
OrderDO
setClosingTime
(
Date
closingTime
)
{
this
.
closingTime
=
closingTime
;
return
this
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
public
OrderDO
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
return
this
;
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/dataobject/OrderItemDO.java
浏览文件 @
ba7669f3
...
...
@@ -59,47 +59,53 @@ public class OrderItemDO implements Serializable {
return
id
;
}
public
void
setId
(
String
id
)
{
public
OrderItemDO
setId
(
String
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
String
orderId
)
{
public
OrderItemDO
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
return
this
;
}
public
String
getCommodityId
()
{
return
commodityId
;
}
public
void
setCommodityId
(
String
commodityId
)
{
public
OrderItemDO
setCommodityId
(
String
commodityId
)
{
this
.
commodityId
=
commodityId
;
return
this
;
}
public
Integer
getQuantity
()
{
return
quantity
;
}
public
void
setQuantity
(
Integer
quantity
)
{
public
OrderItemDO
setQuantity
(
Integer
quantity
)
{
this
.
quantity
=
quantity
;
return
this
;
}
public
Integer
getPrice
()
{
return
price
;
}
public
void
setPrice
(
Integer
price
)
{
public
OrderItemDO
setPrice
(
Integer
price
)
{
this
.
price
=
price
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
public
OrderItemDO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/service/OrderServiceImpl.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
service
;
import
cn.iocoder.mall.order.api.OrderService
;
import
cn.iocoder.mall.order.api.bo.OrderBO
;
import
cn.iocoder.mall.order.api.dto.OrderCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCreateItemDTO
;
import
cn.iocoder.mall.order.api.dto.OrderUpdateDTO
;
import
cn.iocoder.mall.order.dataobject.OrderDO
;
import
cn.iocoder.mall.order.dataobject.OrderItemDO
;
import
cn.iocoder.mall.order.convert.OrderConvert
;
import
cn.iocoder.mall.order.dao.OrderMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 订单 service impl
*
* @author Sin
* @time 2019-03-16 15:08
*/
@Service
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
public
class
OrderServiceImpl
implements
OrderService
{
@Autowired
private
OrderMapper
orderMapper
;
@Override
public
OrderBO
createOrder
(
OrderCreateDTO
orderCreateDTO
)
{
List
<
OrderCreateItemDTO
>
orderItemDTOList
=
orderCreateDTO
.
getOrderItems
();
OrderDO
orderDO
=
OrderConvert
.
INSTANCE
.
convert
(
orderCreateDTO
);
List
<
OrderItemDO
>
orderItemDOList
=
OrderConvert
.
INSTANCE
.
convert
(
orderItemDTOList
);
orderMapper
.
insert
(
orderDO
);
String
a
=
""
;
// orderConvert.con
// for (OrderCreateItemDTO orderCreateItemDTO : orderItemDTOList) {
// OrderItemDO orderItemDO = new OrderItemDO();
// orderItemDO.setId();
// orderItemDO.setCommodityId();
// orderItemDO.setOrderId();
// orderItemDO.setPrice();
// orderItemDO.setQuantity();
// orderItemDO.setStatus();
// }
// orderMapper.insert();
return
null
;
}
@Override
public
void
updateOrder
(
OrderUpdateDTO
orderUpdateDTO
)
{
}
@Override
public
void
deleteOrder
(
String
orderId
)
{
}
@Override
public
void
listenerPayment
()
{
}
@Override
public
void
listenerConfirmGoods
()
{
}
@Override
public
void
listenerExchangeGoods
()
{
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/service/ServiceImpl.java
deleted
100644 → 0
浏览文件 @
8a652c24
package
cn
.
iocoder
.
mall
.
order
.
service
;
import
org.springframework.stereotype.Service
;
/**
* 订单 service impl
*
* @author Sin
* @time 2019-03-16 15:08
*/
@Service
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
public
class
ServiceImpl
{
}
order/order-
application/src/main/java/cn/iocoder/mall/order/ProductApplication
.java
→
order/order-
service-impl/src/test/java/cn/iocoder/mall/order/OrderApplicationTest
.java
浏览文件 @
ba7669f3
...
...
@@ -3,11 +3,11 @@ package cn.iocoder.mall.order;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
ProductApplication
{
@SpringBootApplication
(
scanBasePackages
=
"cn.iocoder.mall.order"
)
public
class
OrderApplicationTest
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ProductApplication
.
class
,
args
);
SpringApplication
.
run
(
OrderApplicationTest
.
class
,
args
);
}
}
\ No newline at end of file
order/order-service-impl/src/test/java/cn/iocoder/mall/order/service/OrderServiceImplTest.java
0 → 100644
浏览文件 @
ba7669f3
package
cn
.
iocoder
.
mall
.
order
.
service
;
import
cn.iocoder.mall.order.OrderApplicationTest
;
import
cn.iocoder.mall.order.api.OrderService
;
import
cn.iocoder.mall.order.api.dto.OrderCreateDTO
;
import
cn.iocoder.mall.order.api.dto.OrderCreateItemDTO
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
/**
* 订单 service test
*
* @author Sin
* @time 2019-03-17 10:34
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
OrderApplicationTest
.
class
)
//@Transactional
public
class
OrderServiceImplTest
{
@Autowired
private
OrderService
orderService
;
@Test
public
void
createOrderTest
()
{
OrderCreateItemDTO
orderCreateItemDTO
=
new
OrderCreateItemDTO
()
.
setCommodityId
(
"CID_001"
)
.
setQuantity
(
1
);
orderService
.
createOrder
(
new
OrderCreateDTO
()
.
setRemark
(
""
)
.
setReceiverMobile
(
"13301926050"
)
.
setReceiverAddress
(
"深圳市福田区"
)
.
setReceiverAreaNo
(
"1000100"
)
.
setOrderItems
(
Arrays
.
asList
(
orderCreateItemDTO
)));
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论