This commit is contained in:
付庆吉
2021-09-10 10:17:09 +08:00
parent de382f270e
commit 01711f7477
318 changed files with 3672 additions and 7913 deletions

View File

@ -1,31 +1,57 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<?xml version="1.0" encoding="UTF-8"?>
<parent>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../mall-ebtp-cloud-parent</relativePath>
</parent>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-jpa-starter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mall-ebtp-cloud-jpa-starter</name>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-parent</artifactId>
<version>2.0.0</version>
<relativePath>../mall-ebtp-cloud-parent</relativePath>
</parent>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-jpa-starter</artifactId>
<version>2.0.0</version>
<name>mall-ebtp-cloud-jpa-starter</name>
<dependencies>
<!--sharding-jdbc-->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--mybatis plus-->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>mybatis-plus-generator</artifactId>-->
<!-- </dependency>-->
<!--druid-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!--seata-->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,13 +0,0 @@
package com.chinaunicom.mall.ebtp.cloud.jpa.starter;
public interface CommonConstants {
/**
* 删除
*/
String STATUS_DEL = "deleted";
/**
* 正常
*/
String STATUS_NORMAL = "normal";
}

View File

@ -0,0 +1,14 @@
package com.chinaunicom.mall.ebtp.cloud.jpa.starter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* seata 自动装配
*
* @author ajaxfan
*/
@Configuration
@PropertySource("classpath:seata-configuration.properties")
public class SeataStarterConfiguration {
}

View File

@ -1,3 +1,4 @@
# AutoConfiguration
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.chinaunicom.mall.ebtp.cloud.jpa.starter.JpaStarterConfiguration
com.chinaunicom.mall.ebtp.cloud.jpa.starter.JpaStarterConfiguration,\
com.chinaunicom.mall.ebtp.cloud.jpa.starter.SeataStarterConfiguration

View File

@ -0,0 +1,72 @@
transport {
# tcp udt unix-domain-socket
type = "TCP"
#NIO NATIVE
server = "NIO"
#enable heartbeat
heartbeat = true
# the client batch send request enable
enableClientBatchSendRequest = true
#thread factory for netty
threadFactory {
bossThreadPrefix = "NettyBoss"
workerThreadPrefix = "NettyServerNIOWorker"
serverExecutorThread-prefix = "NettyServerBizHandler"
shareBossWorker = false
clientSelectorThreadPrefix = "NettyClientSelector"
clientSelectorThreadSize = 1
clientWorkerThreadPrefix = "NettyClientWorkerThread"
# netty boss thread size,will not be used for UDT
bossThreadSize = 1
#auto default pin or 8
workerThreadSize = "default"
}
shutdown {
# when destroy server, wait seconds
wait = 3
}
serialization = "seata"
compressor = "none"
}
service {
#transaction service group mapping
vgroupMapping.biz-service-ebtp-project-service-group = "default"
#only support when registry.type=file, please don't set multiple addresses
default.grouplist = "10.242.31.158:18035"
#degrade, current not support
enableDegrade = false
#disable seata
disableGlobalTransaction = false
}
client {
rm {
asyncCommitBufferLimit = 10000
lock {
retryInterval = 10
retryTimes = 30
retryPolicyBranchRollbackOnConflict = true
}
reportRetryCount = 5
tableMetaCheckEnable = false
reportSuccessEnable = false
}
tm {
commitRetryCount = 5
rollbackRetryCount = 5
}
undo {
dataValidation = true
logSerialization = "jackson"
logTable = "undo_log"
}
log {
exceptionRate = 100
}
support {
spring {
datasource-autoproxy = true
}
}
}

View File

@ -2,13 +2,10 @@
mybatis-plus.configuration.map-undersore-to-camel-case=true
# 对所有的 resultMap 都进行自动映射
mybatis-plus.configuration.auto-mapping-behavior=full
# 实体扫描多个package用逗号或者分号分隔
mybatis-plus.typeAliasesPackage=com.chinaunicom.mall.ebtp
# 项目统一mapper存放位置
mybatis-plus.mapper-locations=classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml
# 主键类型 0: 数据库ID自增, 1: 用户输入ID, 2: 全局唯一ID(数字类型), 3: UUID;
mybatis-plus.global-config.id-type=3
# 机器 ID 部分

View File

@ -0,0 +1,15 @@
registry {
type = "file"
file {
name = "file.conf"
}
}
config {
type = "file"
file {
name = "file.conf"
}
}

View File

@ -0,0 +1,4 @@
seata.enabled=true
seata.application-id=${spring.application.name}
seata.tx-service-group=${spring.application.name}-service-group
seata.service.grouplist.default=10.242.31.158:18035

View File

@ -1,38 +0,0 @@
package org.mall.ebtp.cloud.jpa.starter;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}