Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
2187ae26
提交
2187ae26
authored
5月 14, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
ce78a4eb
7abdcbae
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
182 行增加
和
152 行删除
+182
-152
README.md
README.md
+6
-3
application-test.yaml
...rder-application/src/main/resources/application-test.yaml
+6
-0
application.yaml
order/order-application/src/main/resources/application.yaml
+1
-4
mybatis-config.xml
...r/order-application/src/main/resources/mybatis-config.xml
+0
-20
DatabaseConfiguration.java
.../iocoder/mall/order/biz/config/DatabaseConfiguration.java
+12
-39
SeataConfiguration.java
.../cn/iocoder/mall/order/biz/config/SeataConfiguration.java
+0
-9
application.yaml
...r-service-impl/src/main/resources/config/application.yaml
+4
-0
file.conf
order/order-service-impl/src/main/resources/file.conf
+69
-0
registry.conf
order/order-service-impl/src/main/resources/registry.conf
+14
-0
pom.xml
promotion/promotion-application/pom.xml
+10
-5
application-test.yaml
...tion-application/src/main/resources/application-test.yaml
+6
-0
application.yaml
...promotion-application/src/main/resources/application.yaml
+1
-4
pom.xml
promotion/promotion-service-api/pom.xml
+3
-5
pom.xml
promotion/promotion-service-impl/pom.xml
+38
-59
application-test.yaml
...arch-application/src/main/resources/application-test.yaml
+6
-0
application.yaml
...ch/search-application/src/main/resources/application.yaml
+1
-4
pom.xml
search/search-service-impl/pom.xml
+5
-0
没有找到文件。
README.md
浏览文件 @
2187ae26
...
...
@@ -113,22 +113,25 @@ TODO 此处应有一个架构图的装逼 JPG 图。
| --- | --- | --- |
|
[
Spring Boot
](
https://spring.io/projects/spring-boot
)
| 应用开发框架 | 2.1.4 |
|
[
MySQL
](
https://www.mysql.com/cn/
)
| 数据库服务器 | 5.6 |
|
[
MyBatis
](
http://www.mybatis.org/mybatis-3/zh/index.html
)
| 数据持久层框架 | 3.5.0 |
|
[
Druid
](
https://github.com/alibaba/druid
)
| JDBC 连接池、监控组件 | 1.1.16 |
|
[
MyBatis
](
http://www.mybatis.org/mybatis-3/zh/index.html
)
| 数据持久层框架 | 3.5.1 |
|
[
MyBatis-Plus
](
https://mp.baomidou.com/
)
| Mybatis 增强工具包 | 3.1.1 |
|
[
Redis
](
https://redis.io/
)
| key-value 数据库 | 暂未引入,等压测后,部分模块 |
|
[
Redisson
](
https://github.com/redisson/redisson
)
| Redis 客户端 | 暂未引入,等压测后,部分模块 |
|
[
Elasticsearch
](
https://www.elastic.co/cn/
)
| 分布式搜索引擎 | 6.7.1 |
|
[
Dubbo
](
http://dubbo.apache.org/
)
| 分布式 RPC 服务框架 | 2.7.1 |
|
[
RocketMQ
](
http://dubbo.apache.org/
)
| 消息中间件 | 4.3.2 |
|
[
SkyWalking
](
http://skywalking.apache.org/
)
| 分布式应用追踪系统 | 6.0.0 |
|
[
Seata
](
https://github.com/seata/seata
)
| 分布式事务中间件 | 0.5.1 |
|
[
Zookeeper
](
http://zookeeper.apache.org/
)
| 分布式系统协调 | 3.4.9 作为注册中心 |
|
[
XXL-Job
](
http://www.xuxueli.com/xxl-job/
)
| 分布式任务调度平台 | 2.0.1 |
|
[
springfox-swagger2
](
https://github.com/springfox/springfox/tree/master/springfox-swagger2
)
| API 文档 | 2.9.2 |
|
[
swagger-bootstrap-ui
](
https://gitee.com/xiaoym/swagger-bootstrap-ui
)
| API 文档 | 1.9.3 |
未来考虑引入
*
[
]
配置中心 Nacos
*
[
]
服务保障 Sentinel
*
[
]
分布式事务 Seata
*
[
]
数据库连接池 Druid
*
[
]
网关 Soul
### 前端
...
...
order/order-application/src/main/resources/application-test.yaml
0 → 100644
浏览文件 @
2187ae26
swagger
:
enable
:
true
title
:
订单子系统
description
:
订单子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.pay.application.controller
order/order-application/src/main/resources/application.yaml
浏览文件 @
2187ae26
...
...
@@ -9,7 +9,4 @@ server:
context-path
:
/order-api/
swagger
:
title
:
订单子系统
description
:
订单子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.pay.application.controller
enable
:
false
order/order-application/src/main/resources/mybatis-config.xml
deleted
100644 → 0
浏览文件 @
ce78a4eb
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 使用驼峰命名法转换字段。 -->
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
</settings>
<typeAliases>
<typeAlias
alias=
"Integer"
type=
"java.lang.Integer"
/>
<typeAlias
alias=
"Long"
type=
"java.lang.Long"
/>
<typeAlias
alias=
"HashMap"
type=
"java.util.HashMap"
/>
<typeAlias
alias=
"LinkedHashMap"
type=
"java.util.LinkedHashMap"
/>
<typeAlias
alias=
"ArrayList"
type=
"java.util.ArrayList"
/>
<typeAlias
alias=
"LinkedList"
type=
"java.util.LinkedList"
/>
</typeAliases>
</configuration>
\ No newline at end of file
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/config/DatabaseConfiguration.java
浏览文件 @
2187ae26
package
cn
.
iocoder
.
mall
.
order
.
biz
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
io.seata.spring.annotation.GlobalTransactionScanner
;
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.DependsOn
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -20,56 +20,29 @@ import javax.sql.DataSource;
@EnableTransactionManagement
(
proxyTargetClass
=
true
)
// 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600
public
class
DatabaseConfiguration
{
// 数据源,使用 HikariCP
@Value
(
"${spring.application.name}"
)
private
String
applicationId
;
@Value
(
"${seata.tx-service-group}"
)
private
String
txServiceGroup
;
@Autowired
private
DataSourceProperties
dataSourceProperties
;
@Bean
// @Primary
@Bean
(
"druidDataSource"
)
@ConfigurationProperties
(
"spring.datasource.druid"
)
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
;
return
DruidDataSourceBuilder
.
create
().
build
();
}
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@Primary
@Bean
(
"dataSource"
)
// @Bean
public
DataSource
dataSource
(
DruidDataSource
dataSource
)
{
return
new
DataSourceProxy
(
dataSource
);
@DependsOn
(
"druidDataSource"
)
// 解决多数据源,循环依赖的问题。主要发生点在 DataSourceInitializerInvoker
public
DataSource
dataSource
()
{
DruidDataSource
druidDataSource
=
druidDataSource
();
return
new
DataSourceProxy
(
druidDataSource
);
}
/**
* 注册一个StatViewServlet
*
* @return global transaction scanner
*/
@Bean
public
GlobalTransactionScanner
globalTransactionScanner
()
{
return
new
GlobalTransactionScanner
(
applicationId
,
"my_test_tx_group"
);
// TODO 芋艿,txServiceGroup 后续要编辑下
return
new
GlobalTransactionScanner
(
applicationId
,
txServiceGroup
);
}
}
order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/config/SeataConfiguration.java
deleted
100644 → 0
浏览文件 @
ce78a4eb
package
cn
.
iocoder
.
mall
.
order
.
biz
.
config
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
SeataConfiguration
{
}
order/order-service-impl/src/main/resources/config/application.yaml
浏览文件 @
2187ae26
...
...
@@ -59,3 +59,7 @@ logging:
level
:
# dao 开启 debug 模式 mybatis 输入 sql
cn.iocoder.mall.order.biz.dao
:
debug
# seata
seata
:
tx-service-group
:
my_test_tx_group
order/order-service-impl/src/main/resources/file.conf
0 → 100644
浏览文件 @
2187ae26
transport
{
# tcp udt unix-domain-socket
type
=
"TCP"
#NIO NATIVE
server
=
"NIO"
#enable heartbeat
heartbeat
=
true
#thread factory for netty
thread
-
factory
{
boss
-
thread
-
prefix
=
"NettyBoss"
worker
-
thread
-
prefix
=
"NettyServerNIOWorker"
server
-
executor
-
thread
-
prefix
=
"NettyServerBizHandler"
share
-
boss
-
worker
=
false
client
-
selector
-
thread
-
prefix
=
"NettyClientSelector"
client
-
selector
-
thread
-
size
=
1
client
-
worker
-
thread
-
prefix
=
"NettyClientWorkerThread"
# netty boss thread size,will not be used for UDT
boss
-
thread
-
size
=
1
#auto default pin or 8
worker
-
thread
-
size
=
8
}
}
service
{
#vgroup->rgroup
vgroup_mapping
.
my_test_tx_group
=
"default"
#only support single node
default
.
grouplist
=
"180.167.213.26:8091"
#degrade current not support
enableDegrade
=
false
#disable
disable
=
false
}
client
{
async
.
commit
.
buffer
.
limit
=
10000
lock
{
retry
.
internal
=
10
retry
.
times
=
30
}
}
## transaction log store
store
{
## store mode: file、db
mode
=
"file"
## file store
file
{
dir
=
"file_store/data"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
max
-
branch
-
session
-
size
=
16384
# globe session size , if exceeded throws exceptions
max
-
global
-
session
-
size
=
512
# file buffer size , if exceeded allocate new buffer
file
-
write
-
buffer
-
cache
-
size
=
16384
# when recover batch read size
session
.
reload
.
read_size
=
100
}
## database store
db
{
driver_class
=
""
url
=
""
user
=
""
password
=
""
}
}
order/order-service-impl/src/main/resources/registry.conf
0 → 100644
浏览文件 @
2187ae26
registry
{
type
=
"file"
file
{
name
=
"file.conf"
}
zk
{
cluster
=
"default"
serverAddr
=
"192.168.88.10:2181"
session
.
timeout
=
6000
connect
.
timeout
=
2000
}
}
promotion/promotion-application/pom.xml
浏览文件 @
2187ae26
...
...
@@ -12,6 +12,7 @@
<artifactId>
promotion-application
</artifactId>
<dependencies>
<!-- Mall 相关 -->
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
common-framework
</artifactId>
...
...
@@ -53,15 +54,12 @@
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
...
...
@@ -72,6 +70,13 @@
<artifactId>
swagger-bootstrap-ui
</artifactId>
</dependency>
<!-- 测试相关 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
...
...
promotion/promotion-application/src/main/resources/application-test.yaml
0 → 100644
浏览文件 @
2187ae26
swagger
:
enable
:
false
title
:
营销子系统
description
:
营销子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.promotion.application.controller
promotion/promotion-application/src/main/resources/application.yaml
浏览文件 @
2187ae26
...
...
@@ -9,7 +9,4 @@ server:
context-path
:
/promotion-api/
swagger
:
title
:
营销子系统
description
:
营销子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.promotion.application.controller
enable
:
false
promotion/promotion-service-api/pom.xml
浏览文件 @
2187ae26
...
...
@@ -12,17 +12,14 @@
<artifactId>
promotion-service-api
</artifactId>
<dependencies>
<!-- Mall 相关 -->
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
common-framework
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<!-- use mapstruct-jdk8 for Java 8 or higher -->
...
...
@@ -31,6 +28,7 @@
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-jdk8
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
...
...
promotion/promotion-service-impl/pom.xml
浏览文件 @
2187ae26
...
...
@@ -12,6 +12,7 @@
<artifactId>
promotion-service-impl
</artifactId>
<dependencies>
<!-- Mall 相关 -->
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
promotion-service-api
</artifactId>
...
...
@@ -28,106 +29,84 @@
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!-- DB 相关 -->
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
gu
ava
</artifactId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-j
ava
</artifactId>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</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>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.dubbo
</groupId>
<artifactId>
dubbo
</artifactId>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-framework
</artifactId>
<groupId>
io.seata
</groupId>
<artifactId>
seata-dubbo
</artifactId>
</dependency>
<!-- RPC 相关 -->
<dependency>
<groupId>
org.apache.
curator
</groupId>
<artifactId>
curator-recipes
</artifactId>
<groupId>
org.apache.
dubbo
</groupId>
<artifactId>
dubbo
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.dubbo
</groupId>
<artifactId>
dubbo-spring-boot-starter
</artifactId>
</dependency>
<!-- Registry 和 Config 相关 -->
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</exclusion>
</exclusions>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-framework
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.curator
</groupId>
<artifactId>
curator-recipes
</artifactId>
</dependency>
<!-- MQ 相关 -->
<dependency>
<groupId>
org.apache.rocketmq
</groupId>
<artifactId>
rocketmq-spring-boot-starter
</artifactId>
</dependency>
<!-- Job 相关 -->
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring
</artifactId>
</dependency>
<!--dependency for Apache Dubbo-->
<dependency>
<groupId>
io.seata
</groupId>
<artifactId>
seata-dubbo
</artifactId>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>
io.seat
a
</groupId>
<artifactId>
seata-discovery-zk
</artifactId>
<groupId>
com.google.guav
a
</groupId>
<artifactId>
guava
</artifactId>
</dependency>
<!--
test
-->
<!--
测试相关
-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework</groupId>-->
<!-- <artifactId>spring-tx</artifactId>-->
<!-- <version>5.0.12.RELEASE</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
</dependencies>
...
...
search/search-application/src/main/resources/application-test.yaml
0 → 100644
浏览文件 @
2187ae26
swagger
:
enable
:
true
title
:
搜索子系统
description
:
搜索子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.search.application.controller
search/search-application/src/main/resources/application.yaml
浏览文件 @
2187ae26
...
...
@@ -9,7 +9,4 @@ server:
context-path
:
/search-api/
swagger
:
title
:
搜索子系统
description
:
搜索子系统
version
:
1.0.0
base-package
:
cn.iocoder.mall.search.application.controller
enable
:
false
search/search-service-impl/pom.xml
浏览文件 @
2187ae26
...
...
@@ -18,6 +18,11 @@
<artifactId>
search-service-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
mall-spring-boot
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
product-service-api
</artifactId>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论