Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
4888dfaf
提交
4888dfaf
authored
5月 12, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 后端:引入分布式事务框架 seata 框架。
- 后端:目前订单提交时,如果发生异常,会回滚优惠劵的使用。
上级
36018c84
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
272 行增加
和
146 行删除
+272
-146
order.vue
mobile-web/src/page/shipping/order.vue
+1
-0
pom.xml
order/order-application/pom.xml
+7
-5
OrderController.java
...l/order/application/controller/users/OrderController.java
+12
-2
pom.xml
order/order-service-impl/pom.xml
+22
-14
DatabaseConfiguration.java
.../iocoder/mall/order/biz/config/DatabaseConfiguration.java
+62
-2
SeataConfiguration.java
.../cn/iocoder/mall/order/biz/config/SeataConfiguration.java
+9
-0
OrderMapper.java
.../main/java/cn/iocoder/mall/order/biz/dao/OrderMapper.java
+2
-8
OrderDO.java
...in/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java
+2
-0
OrderServiceImpl.java
...a/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
+8
-2
application.yaml
...r-service-impl/src/main/resources/config/application.yaml
+1
-0
OrderMapper.xml
...er-service-impl/src/main/resources/mapper/OrderMapper.xml
+6
-39
OrderRecipientMapper.xml
...e-impl/src/main/resources/mapper/OrderRecipientMapper.xml
+1
-1
pom.xml
pom.xml
+1
-1
pom.xml
promotion/promotion-application/pom.xml
+0
-1
SwaggerConfiguration.java
...ll/promotion/application/config/SwaggerConfiguration.java
+0
-37
CouponService.java
...ain/java/cn/iocoder/mall/promotion/api/CouponService.java
+1
-1
pom.xml
promotion/promotion-service-impl/pom.xml
+55
-23
DatabaseConfiguration.java
...oder/mall/promotion/biz/config/DatabaseConfiguration.java
+65
-2
CouponServiceImpl.java
...iocoder/mall/promotion/biz/service/CouponServiceImpl.java
+5
-5
application.yaml
...n-service-impl/src/main/resources/config/application.yaml
+12
-3
没有找到文件。
mobile-web/src/page/shipping/order.vue
浏览文件 @
4888dfaf
...
@@ -173,6 +173,7 @@
...
@@ -173,6 +173,7 @@
createOrder
({
createOrder
({
orderItems
,
orderItems
,
userAddressId
,
userAddressId
,
couponCardId
,
remark
,
remark
,
}).
then
(
result
=>
{
}).
then
(
result
=>
{
if
(
result
)
{
if
(
result
)
{
...
...
order/order-application/pom.xml
浏览文件 @
4888dfaf
...
@@ -74,11 +74,13 @@
...
@@ -74,11 +74,13 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<!-- <dependency>-->
<artifactId>
spring-boot-devtools
</artifactId>
<!-- <groupId>org.springframework.boot</groupId>-->
<optional>
true
</optional>
<!-- <artifactId>spring-boot-devtools</artifactId>-->
</dependency>
<!-- <optional>true</optional>-->
<!-- </dependency>-->
<dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
...
...
order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/users/OrderController.java
浏览文件 @
4888dfaf
...
@@ -17,6 +17,8 @@ import cn.iocoder.mall.order.application.convert.CartConvert;
...
@@ -17,6 +17,8 @@ import cn.iocoder.mall.order.application.convert.CartConvert;
import
cn.iocoder.mall.order.application.convert.OrderConvertAPP
;
import
cn.iocoder.mall.order.application.convert.OrderConvertAPP
;
import
cn.iocoder.mall.order.application.po.user.OrderCreatePO
;
import
cn.iocoder.mall.order.application.po.user.OrderCreatePO
;
import
cn.iocoder.mall.order.application.vo.UsersOrderConfirmCreateVO
;
import
cn.iocoder.mall.order.application.vo.UsersOrderConfirmCreateVO
;
import
cn.iocoder.mall.promotion.api.CouponService
;
import
cn.iocoder.mall.promotion.api.bo.CouponCardAvailableBO
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -29,6 +31,8 @@ import java.util.Collections;
...
@@ -29,6 +31,8 @@ import java.util.Collections;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
/**
/**
* 订单API(users)
* 订单API(users)
*
*
...
@@ -46,6 +50,8 @@ public class OrderController {
...
@@ -46,6 +50,8 @@ public class OrderController {
private
CartService
cartService
;
private
CartService
cartService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.DataDictService.version}"
)
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.DataDictService.version}"
)
private
DataDictService
dataDictService
;
private
DataDictService
dataDictService
;
@Reference
(
validation
=
"true"
,
version
=
"${dubbo.consumer.CouponService.version}"
)
private
CouponService
couponService
;
@GetMapping
(
"order_page"
)
@GetMapping
(
"order_page"
)
@ApiOperation
(
"订单分页"
)
@ApiOperation
(
"订单分页"
)
...
@@ -97,14 +103,18 @@ public class OrderController {
...
@@ -97,14 +103,18 @@ public class OrderController {
public
CommonResult
<
UsersOrderConfirmCreateVO
>
getConfirmCreateOrder
(
@RequestParam
(
"skuId"
)
Integer
skuId
,
public
CommonResult
<
UsersOrderConfirmCreateVO
>
getConfirmCreateOrder
(
@RequestParam
(
"skuId"
)
Integer
skuId
,
@RequestParam
(
"quantity"
)
Integer
quantity
,
@RequestParam
(
"quantity"
)
Integer
quantity
,
@RequestParam
(
value
=
"couponCardId"
,
required
=
false
)
Integer
couponCardId
)
{
@RequestParam
(
value
=
"couponCardId"
,
required
=
false
)
Integer
couponCardId
)
{
Integer
userId
=
UserSecurityContextHolder
.
getContext
().
getUserId
();
// 创建 CalcOrderPriceDTO 对象,并执行价格计算
// 创建 CalcOrderPriceDTO 对象,并执行价格计算
CalcOrderPriceDTO
calcOrderPriceDTO
=
new
CalcOrderPriceDTO
()
CalcOrderPriceDTO
calcOrderPriceDTO
=
new
CalcOrderPriceDTO
()
.
setUserId
(
UserSecurityContextHolder
.
getContext
().
getUserId
()
)
.
setUserId
(
userId
)
.
setItems
(
Collections
.
singletonList
(
new
CalcOrderPriceDTO
.
Item
(
skuId
,
quantity
,
true
)))
.
setItems
(
Collections
.
singletonList
(
new
CalcOrderPriceDTO
.
Item
(
skuId
,
quantity
,
true
)))
.
setCouponCardId
(
couponCardId
);
.
setCouponCardId
(
couponCardId
);
CalcOrderPriceBO
calcOrderPrice
=
cartService
.
calcOrderPrice
(
calcOrderPriceDTO
);
CalcOrderPriceBO
calcOrderPrice
=
cartService
.
calcOrderPrice
(
calcOrderPriceDTO
);
// 获得优惠劵
List
<
CouponCardAvailableBO
>
couponCards
=
couponService
.
getCouponCardList
(
userId
,
CartConvert
.
INSTANCE
.
convertList
(
calcOrderPrice
.
getItemGroups
()));
// 执行数据拼装
// 执行数据拼装
return
CommonResult
.
success
(
CartConvert
.
INSTANCE
.
convert
(
calcOrderPrice
));
return
success
(
CartConvert
.
INSTANCE
.
convert
(
calcOrderPrice
).
setCouponCards
(
couponCards
));
}
}
@PostMapping
(
"confirm_receiving"
)
@PostMapping
(
"confirm_receiving"
)
...
...
order/order-service-impl/pom.xml
浏览文件 @
4888dfaf
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
pay-service-api
</artifactId>
<artifactId>
pay-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
...
@@ -41,13 +40,11 @@
...
@@ -41,13 +40,11 @@
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
system-service-api
</artifactId>
<artifactId>
system-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
user-service-api
</artifactId>
<artifactId>
user-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
...
@@ -72,10 +69,17 @@
...
@@ -72,10 +69,17 @@
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<!-- <dependency>-->
<artifactId>
spring-boot-starter-jdbc
</artifactId>
<!-- <groupId>org.springframework.boot</groupId>-->
</dependency>
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>-->
<!--<!– <exclusions>–>-->
<!--<!– <exclusion>–>-->
<!--<!– <artifactId>HikariCP</artifactId>–>-->
<!--<!– <groupId>com.zaxxer</groupId>–>-->
<!--<!– </exclusion>–>-->
<!--<!– </exclusions>–>-->
<!-- </dependency>-->
<!-- spring cloud and dubbo -->
<!-- spring cloud and dubbo -->
<dependency>
<dependency>
...
@@ -94,21 +98,25 @@
...
@@ -94,21 +98,25 @@
<groupId>
org.apache.dubbo
</groupId>
<groupId>
org.apache.dubbo
</groupId>
<artifactId>
dubbo-spring-boot-starter
</artifactId>
<artifactId>
dubbo-spring-boot-starter
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
${mybatis-plus.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.0.0
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-spring-boot-starter
</artifactId>
<artifactId>
rocketmq-spring-boot-starter
</artifactId>
<version>
2.0.1
</version>
</dependency>
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring
</artifactId>
</dependency>
<!--dependency for Apache Dubbo-->
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-dubbo
</artifactId>
</dependency>
</dependency>
<!-- test -->
<!-- test -->
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/config/DatabaseConfiguration.java
浏览文件 @
4888dfaf
package
cn
.
iocoder
.
mall
.
order
.
biz
.
config
;
package
cn
.
iocoder
.
mall
.
order
.
biz
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
io.seata.spring.annotation.GlobalTransactionScanner
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
javax.sql.DataSource
;
@Configuration
@Configuration
@MapperScan
(
"cn.iocoder.mall.order.biz.dao"
)
// 扫描对应的 Mapper 接口
@MapperScan
(
"cn.iocoder.mall.order.biz.dao"
)
// 扫描对应的 Mapper 接口
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
...
@@ -11,4 +22,54 @@ public class DatabaseConfiguration {
...
@@ -11,4 +22,54 @@ public class DatabaseConfiguration {
// 数据源,使用 HikariCP
// 数据源,使用 HikariCP
}
@Value
(
"${spring.application.name}"
)
\ No newline at end of file
private
String
applicationId
;
@Autowired
private
DataSourceProperties
dataSourceProperties
;
@Bean
// @Primary
public
DruidDataSource
druidDataSource
(){
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
druidDataSource
.
setUrl
(
dataSourceProperties
.
getUrl
());
druidDataSource
.
setUsername
(
dataSourceProperties
.
getUsername
());
druidDataSource
.
setPassword
(
dataSourceProperties
.
getPassword
());
druidDataSource
.
setDriverClassName
(
dataSourceProperties
.
getDriverClassName
());
druidDataSource
.
setInitialSize
(
0
);
druidDataSource
.
setMaxActive
(
180
);
druidDataSource
.
setMaxWait
(
60000
);
druidDataSource
.
setMinIdle
(
0
);
druidDataSource
.
setValidationQuery
(
"Select 1 from DUAL"
);
druidDataSource
.
setTestOnBorrow
(
false
);
druidDataSource
.
setTestOnReturn
(
false
);
druidDataSource
.
setTestWhileIdle
(
true
);
druidDataSource
.
setTimeBetweenEvictionRunsMillis
(
60000
);
druidDataSource
.
setMinEvictableIdleTimeMillis
(
25200000
);
druidDataSource
.
setRemoveAbandoned
(
true
);
druidDataSource
.
setRemoveAbandonedTimeout
(
1800
);
druidDataSource
.
setLogAbandoned
(
true
);
return
druidDataSource
;
}
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@Primary
@Bean
(
"dataSource"
)
// @Bean
public
DataSource
dataSource
(
DruidDataSource
dataSource
)
{
return
new
DataSourceProxy
(
dataSource
);
}
/**
* 注册一个StatViewServlet
*
* @return global transaction scanner
*/
@Bean
public
GlobalTransactionScanner
globalTransactionScanner
()
{
return
new
GlobalTransactionScanner
(
applicationId
,
"my_test_tx_group"
);
// TODO 芋艿,txServiceGroup 后续要编辑下
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/config/SeataConfiguration.java
0 → 100644
浏览文件 @
4888dfaf
package
cn
.
iocoder
.
mall
.
order
.
biz
.
config
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
SeataConfiguration
{
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/OrderMapper.java
浏览文件 @
4888dfaf
...
@@ -2,6 +2,7 @@ package cn.iocoder.mall.order.biz.dao;
...
@@ -2,6 +2,7 @@ package cn.iocoder.mall.order.biz.dao;
import
cn.iocoder.mall.order.api.dto.OrderQueryDTO
;
import
cn.iocoder.mall.order.api.dto.OrderQueryDTO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderDO
;
import
cn.iocoder.mall.order.biz.dataobject.OrderDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -14,14 +15,7 @@ import java.util.List;
...
@@ -14,14 +15,7 @@ import java.util.List;
* @time 2019-03-16 15:09
* @time 2019-03-16 15:09
*/
*/
@Repository
@Repository
public
interface
OrderMapper
{
public
interface
OrderMapper
extends
BaseMapper
<
OrderDO
>
{
/**
* 插入数据
*
* @param orderDO
*/
void
insert
(
OrderDO
orderDO
);
/**
/**
* 更新 - 根据 id 更新
* 更新 - 根据 id 更新
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java
浏览文件 @
4888dfaf
package
cn
.
iocoder
.
mall
.
order
.
biz
.
dataobject
;
package
cn
.
iocoder
.
mall
.
order
.
biz
.
dataobject
;
import
cn.iocoder.common.framework.dataobject.DeletableDO
;
import
cn.iocoder.common.framework.dataobject.DeletableDO
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -14,6 +15,7 @@ import java.util.Date;
...
@@ -14,6 +15,7 @@ import java.util.Date;
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"orders"
)
public
class
OrderDO
extends
DeletableDO
{
public
class
OrderDO
extends
DeletableDO
{
/**
/**
...
...
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
浏览文件 @
4888dfaf
...
@@ -21,6 +21,7 @@ import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO;
...
@@ -21,6 +21,7 @@ import cn.iocoder.mall.product.api.bo.ProductSkuDetailBO;
import
cn.iocoder.mall.promotion.api.CouponService
;
import
cn.iocoder.mall.promotion.api.CouponService
;
import
cn.iocoder.mall.user.api.UserAddressService
;
import
cn.iocoder.mall.user.api.UserAddressService
;
import
cn.iocoder.mall.user.api.bo.UserAddressBO
;
import
cn.iocoder.mall.user.api.bo.UserAddressBO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.apache.dubbo.config.annotation.Reference
;
import
org.apache.dubbo.config.annotation.Reference
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -210,6 +211,7 @@ public class OrderServiceImpl implements OrderService {
...
@@ -210,6 +211,7 @@ public class OrderServiceImpl implements OrderService {
}
}
@Override
@Override
@GlobalTransactional
@Transactional
// TODO 芋艿,先不考虑分布式事务的问题
@Transactional
// TODO 芋艿,先不考虑分布式事务的问题
public
CommonResult
<
OrderCreateBO
>
createOrder
(
OrderCreateDTO
orderCreateDTO
)
{
public
CommonResult
<
OrderCreateBO
>
createOrder
(
OrderCreateDTO
orderCreateDTO
)
{
Integer
userId
=
orderCreateDTO
.
getUserId
();
Integer
userId
=
orderCreateDTO
.
getUserId
();
...
@@ -284,8 +286,8 @@ public class OrderServiceImpl implements OrderService {
...
@@ -284,8 +286,8 @@ public class OrderServiceImpl implements OrderService {
.
setHasReturnExchange
(
OrderHasReturnExchangeEnum
.
NO
.
getValue
())
.
setHasReturnExchange
(
OrderHasReturnExchangeEnum
.
NO
.
getValue
())
.
setRemark
(
Optional
.
ofNullable
(
orderCreateDTO
.
getRemark
()).
orElse
(
""
));
.
setRemark
(
Optional
.
ofNullable
(
orderCreateDTO
.
getRemark
()).
orElse
(
""
));
orderDO
.
setDeleted
(
DeletedStatusEnum
.
DELETED_NO
.
getValue
());
orderDO
.
setDeleted
(
DeletedStatusEnum
.
DELETED_NO
.
getValue
());
orderDO
.
setCreateTime
(
new
Date
());
//
orderDO.setCreateTime(new Date());
orderDO
.
setUpdateTime
(
null
);
//
orderDO.setUpdateTime(null);
orderMapper
.
insert
(
orderDO
);
orderMapper
.
insert
(
orderDO
);
// 收件人信息
// 收件人信息
...
@@ -321,6 +323,10 @@ public class OrderServiceImpl implements OrderService {
...
@@ -321,6 +323,10 @@ public class OrderServiceImpl implements OrderService {
// 一次性插入
// 一次性插入
orderItemMapper
.
insert
(
orderItemDOList
);
orderItemMapper
.
insert
(
orderItemDOList
);
if
(
true
)
{
throw
new
RuntimeException
(
"测试 seata 事务回滚"
);
}
// 创建预订单
// 创建预订单
createPayTransaction
(
orderDO
,
orderItemDOList
,
orderCreateDTO
.
getIp
());
createPayTransaction
(
orderDO
,
orderItemDOList
,
orderCreateDTO
.
getIp
());
...
...
order/order-service-impl/src/main/resources/config/application.yaml
浏览文件 @
4888dfaf
...
@@ -38,6 +38,7 @@ dubbo:
...
@@ -38,6 +38,7 @@ dubbo:
CartService
:
CartService
:
version
:
1.0.0
version
:
1.0.0
consumer
:
consumer
:
timeout
:
120000
# 设置长一点,方便调试代码
ProductSpuService
:
ProductSpuService
:
version
:
1.0.0
version
:
1.0.0
PromotionActivityService
:
PromotionActivityService
:
...
...
order/order-service-impl/src/main/resources/mapper/OrderMapper.xml
浏览文件 @
4888dfaf
...
@@ -9,26 +9,6 @@
...
@@ -9,26 +9,6 @@
status, remark, create_time, update_time, `deleted`
status, remark, create_time, update_time, `deleted`
</sql>
</sql>
<!--
插入数据
-->
<insert
id=
"insert"
parameterType=
"OrderDO"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
INSERT INTO `order` (
user_id, order_no, buy_price, discount_price, logistics_price, present_price, pay_amount,
payment_time, delivery_time, receiver_time, closing_time,
has_return_exchange,
status, remark, create_time, update_time, `deleted`
) VALUES (
#{userId}, #{orderNo}, #{buyPrice}, #{discountPrice}, #{logisticsPrice}, #{presentPrice}, #{payAmount},
#{paymentTime}, #{deliveryTime}, #{receiverTime}, #{closingTime},
#{hasReturnExchange},
#{status}, #{remark}, #{createTime}, #{updateTime}, #{deleted}
)
</insert>
<!--
更新 - 可更新的字段
-->
<sql
id=
"updateFieldSql"
>
<sql
id=
"updateFieldSql"
>
<set>
<set>
<if
test=
"orderNo != null"
>
<if
test=
"orderNo != null"
>
...
@@ -86,9 +66,6 @@
...
@@ -86,9 +66,6 @@
</set>
</set>
</sql>
</sql>
<!--
更新 - 根据 id 更新
-->
<update
id=
"updateById"
parameterType=
"OrderDO"
>
<update
id=
"updateById"
parameterType=
"OrderDO"
>
UPDATE `order`
UPDATE `order`
<include
refid=
"updateFieldSql"
/>
<include
refid=
"updateFieldSql"
/>
...
@@ -112,9 +89,6 @@
...
@@ -112,9 +89,6 @@
AND status = #{status}
AND status = #{status}
</update>
</update>
<!--
查询 - 根据id 查询
-->
<select
id=
"selectById"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderDO"
>
<select
id=
"selectById"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderDO"
>
SELECT
SELECT
<include
refid=
"FIELDS"
/>
<include
refid=
"FIELDS"
/>
...
@@ -122,9 +96,6 @@
...
@@ -122,9 +96,6 @@
WHERE id = #{id}
WHERE id = #{id}
</select>
</select>
<!--
查询条件 注意:条件顺序,避免不能使用索引
-->
<sql
id=
"selectWhere"
>
<sql
id=
"selectWhere"
>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
AND `status` = #{status}
AND `status` = #{status}
...
@@ -147,26 +118,22 @@
...
@@ -147,26 +118,22 @@
</if>
</if>
</sql>
</sql>
<!--
查询 - 后台分页page Count
-->
<select
id=
"selectPageCount"
resultType=
"java.lang.Integer"
>
<select
id=
"selectPageCount"
resultType=
"java.lang.Integer"
>
SELECT
SELECT
COUNT(*)
COUNT(*)
FROM `order`
FROM `order`
WHERE 1 = 1
<!-- TODO 芋艿 不要 1=1 ,会有问题,使用 where 标签 -->
<where>
<include
refid=
"selectWhere"
/>
<include
refid=
"selectWhere"
/>
</where>
</select>
</select>
<!--
查询 - 后台分页page
-->
<select
id=
"selectPage"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderDO"
>
<select
id=
"selectPage"
resultType=
"cn.iocoder.mall.order.biz.dataobject.OrderDO"
>
SELECT
SELECT
<include
refid=
"FIELDS"
/>
<include
refid=
"FIELDS"
/>
FROM `order`
FROM `order`
WHERE 1 = 1
<!-- TODO 芋艿 不要 1=1 ,会有问题,使用 where 标签 -->
<where>
<include
refid=
"selectWhere"
/>
<include
refid=
"selectWhere"
/>
</where>
LIMIT ${pageNo * pageSize}, ${pageSize}
LIMIT ${pageNo * pageSize}, ${pageSize}
</select>
</select>
...
...
order/order-service-impl/src/main/resources/mapper/OrderRecipientMapper.xml
浏览文件 @
4888dfaf
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
`type`, create_time, update_time
`type`, create_time, update_time
) VALUES (
) VALUES (
#{orderId}, #{areaNo}, #{name}, #{mobile}, #{address},
#{orderId}, #{areaNo}, #{name}, #{mobile}, #{address},
#{type}, #{createTime
}
, #{updateTime}
#{type}, #{createTime
,jdbcType=TIMESTAMP}
, #{updateTime}
)
)
</insert>
</insert>
...
...
pom.xml
浏览文件 @
4888dfaf
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<springboot.version>
2.1.3.RELEASE
</springboot.version>
<springboot.version>
2.1.3.RELEASE
</springboot.version>
<!-- <com.alibab.dubbo.version>2.6.5</com.alibab.dubbo.version>-->
<!-- <com.alibab.dubbo.version>2.6.5</com.alibab.dubbo.version>-->
<dubbo.version>
2.7.1
</dubbo.version>
<dubbo.version>
2.7.1
</dubbo.version>
<mysql-connector-java.version>
5.1.4
7
</mysql-connector-java.version>
<mysql-connector-java.version>
5.1.4
6
</mysql-connector-java.version>
<!-- <dubbo-spring-boot-starter.version>0.2.1.RELEASE</dubbo-spring-boot-starter.version>-->
<!-- <dubbo-spring-boot-starter.version>0.2.1.RELEASE</dubbo-spring-boot-starter.version>-->
<org.mapstruct.version>
1.3.0.Final
</org.mapstruct.version>
<org.mapstruct.version>
1.3.0.Final
</org.mapstruct.version>
<curator.version>
2.13.0
</curator.version>
<curator.version>
2.13.0
</curator.version>
...
...
promotion/promotion-application/pom.xml
浏览文件 @
4888dfaf
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
<artifactId>
mall-spring-boot
</artifactId>
<artifactId>
mall-spring-boot
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
product-service-api
</artifactId>
<artifactId>
product-service-api
</artifactId>
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/config/SwaggerConfiguration.java
deleted
100644 → 0
浏览文件 @
36018c84
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
// TODO 生产环境时,禁用掉。
public
class
SwaggerConfiguration
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"cn.iocoder.mall.promotion.application.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"营销子系统"
)
.
description
(
"营销子系统"
)
.
termsOfServiceUrl
(
"http://www.iocoder.cn"
)
.
version
(
"1.0.0"
)
.
build
();
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/CouponService.java
浏览文件 @
4888dfaf
...
@@ -80,7 +80,7 @@ public interface CouponService {
...
@@ -80,7 +80,7 @@ public interface CouponService {
* @return 是否成功
* @return 是否成功
*/
*/
Boolean
useCouponCard
(
Integer
userId
,
Boolean
useCouponCard
(
Integer
userId
,
@NotNull
(
message
=
"优惠劵编号不能为空"
)
Integer
couponCardId
);
@NotNull
(
message
=
"优惠劵编号不能为空"
)
Integer
couponCardId
);
/**
/**
* 取消优惠劵的使用
* 取消优惠劵的使用
...
...
promotion/promotion-service-impl/pom.xml
浏览文件 @
4888dfaf
...
@@ -28,6 +28,35 @@
...
@@ -28,6 +28,35 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>logback-classic</artifactId>-->
<!-- <groupId>ch.qos.logback</groupId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <artifactId>spring-boot-starter-logging</artifactId>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<dependency>
<dependency>
<groupId>
org.apache.dubbo
</groupId>
<groupId>
org.apache.dubbo
</groupId>
<artifactId>
dubbo
</artifactId>
<artifactId>
dubbo
</artifactId>
...
@@ -46,42 +75,29 @@
...
@@ -46,42 +75,29 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<artifactId>
logback-classic
</artifactId>
<groupId>
ch.qos.logback
</groupId>
</exclusion>
<exclusion>
<artifactId>
spring-boot-starter-logging
</artifactId>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</exclusion>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.
mybatis.spring.boot
</groupId>
<groupId>
org.
apache.rocketmq
</groupId>
<artifactId>
mybatis
-spring-boot-starter
</artifactId>
<artifactId>
rocketmq
-spring-boot-starter
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.google.guav
a
</groupId>
<groupId>
io.seat
a
</groupId>
<artifactId>
guava
</artifactId>
<artifactId>
seata-spring
</artifactId>
</dependency>
</dependency>
<!--dependency for Apache Dubbo-->
<dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<groupId>
io.seata
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<artifactId>
seata-dubbo
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-spring-boot-starter
</artifactId>
</dependency>
</dependency>
<!-- test -->
<!-- test -->
...
@@ -90,6 +106,22 @@
...
@@ -90,6 +106,22 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
<version>
5.1.3.RELEASE
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
<version>
5.1.3.RELEASE
</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework</groupId>-->
<!-- <artifactId>spring-tx</artifactId>-->
<!-- <version>5.0.12.RELEASE</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
</dependencies>
</dependencies>
...
...
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/config/DatabaseConfiguration.java
浏览文件 @
4888dfaf
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
config
;
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
io.seata.spring.annotation.GlobalTransactionScanner
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
javax.sql.DataSource
;
@Configuration
@Configuration
@MapperScan
(
"cn.iocoder.mall.promotion.biz.dao"
)
// 扫描对应的 Mapper 接口
@MapperScan
(
"cn.iocoder.mall.promotion.biz.dao"
)
// 扫描对应的 Mapper 接口
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
@EnableConfigurationProperties
(
DataSourceProperties
.
class
)
public
class
DatabaseConfiguration
{
public
class
DatabaseConfiguration
{
// 数据源,使用 HikariCP
// 数据源,使用 HikariCP
}
@Value
(
"${spring.application.name}"
)
\ No newline at end of file
private
String
applicationId
;
@Autowired
private
DataSourceProperties
dataSourceProperties
;
// @Bean // TODO 芋艿,加了就一直报错,后面在找原因。
// @Primary
public
DruidDataSource
druidDataSource
(){
DruidDataSource
druidDataSource
=
new
DruidDataSource
();
druidDataSource
.
setUrl
(
dataSourceProperties
.
getUrl
());
druidDataSource
.
setUsername
(
dataSourceProperties
.
getUsername
());
druidDataSource
.
setPassword
(
dataSourceProperties
.
getPassword
());
druidDataSource
.
setDriverClassName
(
dataSourceProperties
.
getDriverClassName
());
druidDataSource
.
setInitialSize
(
0
);
druidDataSource
.
setMaxActive
(
180
);
druidDataSource
.
setMaxWait
(
60000
);
druidDataSource
.
setMinIdle
(
0
);
druidDataSource
.
setValidationQuery
(
"Select 1 from DUAL"
);
druidDataSource
.
setTestOnBorrow
(
false
);
druidDataSource
.
setTestOnReturn
(
false
);
druidDataSource
.
setTestWhileIdle
(
true
);
druidDataSource
.
setTimeBetweenEvictionRunsMillis
(
60000
);
druidDataSource
.
setMinEvictableIdleTimeMillis
(
25200000
);
druidDataSource
.
setRemoveAbandoned
(
true
);
druidDataSource
.
setRemoveAbandonedTimeout
(
1800
);
druidDataSource
.
setLogAbandoned
(
true
);
return
druidDataSource
;
}
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@Primary
@Bean
(
"dataSource"
)
// @Bean
public
DataSource
dataSource
()
{
DruidDataSource
dataSource
=
druidDataSource
();
return
new
DataSourceProxy
(
dataSource
);
}
/**
* 注册一个StatViewServlet
*
* @return global transaction scanner
*/
@Bean
public
GlobalTransactionScanner
globalTransactionScanner
()
{
return
new
GlobalTransactionScanner
(
applicationId
,
"my_test_tx_group"
);
// TODO 芋艿,txServiceGroup 后续要编辑下
}
}
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/CouponServiceImpl.java
浏览文件 @
4888dfaf
...
@@ -242,14 +242,14 @@ public class CouponServiceImpl implements CouponService {
...
@@ -242,14 +242,14 @@ public class CouponServiceImpl implements CouponService {
if
(!
userId
.
equals
(
card
.
getUserId
()))
{
if
(!
userId
.
equals
(
card
.
getUserId
()))
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_ERROR_USER
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_ERROR_USER
.
getCode
());
}
}
if
(
CouponCardStatusEnum
.
UNUSED
.
getValue
().
equals
(
card
.
getStatus
()))
{
if
(
!
CouponCardStatusEnum
.
UNUSED
.
getValue
().
equals
(
card
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
}
}
if
(
DateUtil
.
isBetween
(
card
.
getValidStartTime
(),
card
.
getValidEndTime
()))
{
// 为避免定时器没跑,实际优惠劵已经过期
if
(
DateUtil
.
isBetween
(
card
.
getValidStartTime
(),
card
.
getValidEndTime
()))
{
// 为避免定时器没跑,实际优惠劵已经过期
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
}
}
// 更新优惠劵已使用
// 更新优惠劵已使用
int
updateCount
=
couponCardMapper
.
updateByIdAndStatus
(
card
.
getId
(),
CouponCardStatusEnum
.
USED
.
getValue
(),
int
updateCount
=
couponCardMapper
.
updateByIdAndStatus
(
card
.
getId
(),
CouponCardStatusEnum
.
U
NU
SED
.
getValue
(),
new
CouponCardDO
().
setStatus
(
CouponCardStatusEnum
.
USED
.
getValue
()).
setUsedTime
(
new
Date
()));
new
CouponCardDO
().
setStatus
(
CouponCardStatusEnum
.
USED
.
getValue
()).
setUsedTime
(
new
Date
()));
if
(
updateCount
==
0
)
{
if
(
updateCount
==
0
)
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_UNUSED
.
getCode
());
...
@@ -267,12 +267,12 @@ public class CouponServiceImpl implements CouponService {
...
@@ -267,12 +267,12 @@ public class CouponServiceImpl implements CouponService {
if
(!
userId
.
equals
(
card
.
getUserId
()))
{
if
(!
userId
.
equals
(
card
.
getUserId
()))
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_ERROR_USER
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_ERROR_USER
.
getCode
());
}
}
if
(
CouponCardStatusEnum
.
USED
.
getValue
().
equals
(
card
.
getStatus
()))
{
if
(
!
CouponCardStatusEnum
.
USED
.
getValue
().
equals
(
card
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_USED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_USED
.
getCode
());
}
}
// 更新优惠劵已使用
// 更新优惠劵已使用
int
updateCount
=
couponCardMapper
.
updateByIdAndStatus
(
card
.
getId
(),
CouponCardStatusEnum
.
U
NU
SED
.
getValue
(),
int
updateCount
=
couponCardMapper
.
updateByIdAndStatus
(
card
.
getId
(),
CouponCardStatusEnum
.
USED
.
getValue
(),
new
CouponCardDO
().
setStatus
(
CouponCardStatusEnum
.
USED
.
getValue
()));
// TODO 芋艿,usedTime 未设置空,后面处理。
new
CouponCardDO
().
setStatus
(
CouponCardStatusEnum
.
U
NU
SED
.
getValue
()));
// TODO 芋艿,usedTime 未设置空,后面处理。
if
(
updateCount
==
0
)
{
if
(
updateCount
==
0
)
{
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_USED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
PromotionErrorCodeEnum
.
COUPON_CARD_STATUS_NOT_USED
.
getCode
());
}
}
...
...
promotion/promotion-service-impl/src/main/resources/config/application.yaml
浏览文件 @
4888dfaf
...
@@ -7,9 +7,18 @@ spring:
...
@@ -7,9 +7,18 @@ spring:
password
:
${MALL_MYSQL_PASSWORD}
password
:
${MALL_MYSQL_PASSWORD}
# mybatis
# mybatis
mybatis
:
#mybatis:
config-location
:
classpath:mybatis-config.xml
# config-location: classpath:mybatis-config.xml
mapper-locations
:
classpath:mapper/*.xml
# mapper-locations: classpath:mapper/*.xml
# type-aliases-package: cn.iocoder.mall.promotion.biz.dataobject
# mybatis-plus
mybatis-plus
:
configuration
:
map-underscore-to-camel-case
:
true
# 虽然默认为 true ,但是还是显示去指定下。
global-config
:
db-config
:
id-type
:
auto
mapper-locations
:
classpath*:mapper/*.xml
type-aliases-package
:
cn.iocoder.mall.promotion.biz.dataobject
type-aliases-package
:
cn.iocoder.mall.promotion.biz.dataobject
# dubbo
# dubbo
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论