init
This commit is contained in:
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
20
.m2/settings.xml
Normal file
20
.m2/settings.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>nexus</id>
|
||||
<username>developer</username>
|
||||
<password>123456</password>
|
||||
</server>
|
||||
</servers>
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>nexus</id>
|
||||
<name>collcollege</name>
|
||||
<url>http://nexus.coolcollege.cn/repository/maven-public/</url>
|
||||
<mirrorOf>central</mirrorOf>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
</settings>
|
||||
21
coolstore-partner-common/coolstore-partner-common.iml
Normal file
21
coolstore-partner-common/coolstore-partner-common.iml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
46
coolstore-partner-common/pom.xml
Normal file
46
coolstore-partner-common/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cool.store.model.constants;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonConstatns
|
||||
* @Description:
|
||||
* @date 2023-05-18 14:47
|
||||
*/
|
||||
public class CommonConstants {
|
||||
|
||||
public static final String DEFAULT_DB = "coolcollege_intelligent_config";
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
82
coolstore-partner-dao/coolstore-partner-dao.iml
Normal file
82
coolstore-partner-dao/coolstore-partner-dao.iml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-model" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
59
coolstore-partner-dao/pom.xml
Normal file
59
coolstore-partner-dao/pom.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-dao</artifactId>
|
||||
|
||||
<properties>
|
||||
<druid.version>1.1.20</druid.version>
|
||||
<mybatis.version>2.1.0</mybatis.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-model</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.generator</groupId>
|
||||
<artifactId>mybatis-generator-core</artifactId>
|
||||
<version>1.3.7</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.mapper.EnterpriseConfigMapper;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseConfigDAO
|
||||
* @Description:
|
||||
* @date 2023-05-18 11:15
|
||||
*/
|
||||
@Service
|
||||
public class EnterpriseConfigDAO {
|
||||
|
||||
@Resource
|
||||
private EnterpriseConfigMapper enterpriseConfigMapper;
|
||||
|
||||
|
||||
public EnterpriseConfigDO selectByEnterpriseId(String enterpriseId) {
|
||||
if(StringUtils.isBlank(enterpriseId)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseConfigMapper.selectByEnterpriseId(enterpriseId);
|
||||
}
|
||||
|
||||
public EnterpriseConfigDO getDbInfoByDbName(String dbName) {
|
||||
if(StringUtils.isBlank(dbName)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseConfigMapper.getDbInfoByDbName(dbName);
|
||||
}
|
||||
|
||||
public List<EnterpriseConfigDO> getDistinctDbServer() {
|
||||
return enterpriseConfigMapper.getDistinctDbServer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-18 11:09
|
||||
*/
|
||||
public interface EnterpriseConfigMapper {
|
||||
|
||||
/**
|
||||
* 根据企业id获取config
|
||||
* @param enterpriseId
|
||||
* @return
|
||||
*/
|
||||
EnterpriseConfigDO selectByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
* 获取dbServer
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseConfigDO> getDistinctDbServer();
|
||||
|
||||
/**
|
||||
* 根据dbName 获取数据库信息
|
||||
* @param dbName
|
||||
* @return
|
||||
*/
|
||||
EnterpriseConfigDO getDbInfoByDbName(@Param("dbName")String dbName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseUserDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:58
|
||||
*/
|
||||
public interface EnterpriseUserMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 02:58
|
||||
*/
|
||||
int insertSelective(@Param("record") EnterpriseUserDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 02:58
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseUserRoleDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
public interface EnterpriseUserRoleMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 02:59
|
||||
*/
|
||||
int insertSelective(@Param("record") EnterpriseUserRoleDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 02:59
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserRoleDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.RegionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
public interface RegionMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 02:59
|
||||
*/
|
||||
int insertSelective(@Param("record") RegionDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 02:59
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") RegionDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysDepartmentDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
public interface SysDepartmentMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int insertSelective(@Param("record") SysDepartmentDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") SysDepartmentDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysRoleDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
public interface SysRoleMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int insertSelective(@Param("record") SysRoleDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") SysRoleDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysRoleMenuDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:01
|
||||
*/
|
||||
public interface SysRoleMenuMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 03:01
|
||||
*/
|
||||
int insertSelective(@Param("record") SysRoleMenuDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 03:01
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") SysRoleMenuDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.UserAuthMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
*/
|
||||
public interface UserAuthMappingMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 02:54
|
||||
*/
|
||||
int insertSelective(@Param("record") UserAuthMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 02:54
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") UserAuthMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.UserRegionMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
public interface UserRegionMappingMapper {
|
||||
/**
|
||||
*
|
||||
* 默认插入方法,只会给有值的字段赋值
|
||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int insertSelective(@Param("record") UserRegionMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") UserRegionMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.EnterpriseConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseConfigDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="current_package" jdbcType="BIGINT" property="currentPackage"/>
|
||||
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId"/>
|
||||
<result column="staff_count" jdbcType="INTEGER" property="staffCount"/>
|
||||
<result column="db_source_name" jdbcType="VARCHAR" property="dbSourceName"/>
|
||||
<result column="db_server" jdbcType="VARCHAR" property="dbServer"/>
|
||||
<result column="db_port" jdbcType="INTEGER" property="dbPort"/>
|
||||
<result column="db_name" jdbcType="VARCHAR" property="dbName"/>
|
||||
<result column="db_user" jdbcType="VARCHAR" property="dbUser"/>
|
||||
<result column="db_pwd" jdbcType="VARCHAR" property="dbPwd"/>
|
||||
<result column="license" jdbcType="VARCHAR" property="license"/>
|
||||
<result column="license_expires" jdbcType="TIMESTAMP" property="licenseExpires"/>
|
||||
<result column="license_type" jdbcType="INTEGER" property="licenseType"/>
|
||||
<result column="ding_corp_id" jdbcType="VARCHAR" property="dingCorpId"/>
|
||||
<result column="ding_corp_secret" jdbcType="VARCHAR" property="dingCorpSecret"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="create_user" jdbcType="VARCHAR" property="createUser"/>
|
||||
<result column="main_corp_id" jdbcType="VARCHAR" property="mainCorpId"/>
|
||||
<result column="app_type" jdbcType="VARCHAR" property="appType"/>
|
||||
<result column="permanent_code" jdbcType="VARCHAR" property="permanentCode"/>
|
||||
<result column="agentid" jdbcType="VARCHAR" property="agentid"/>
|
||||
<result column="cool_college_enterprise_id" jdbcType="VARCHAR" property="coolCollegeEnterpriseId"/>
|
||||
<result column="cool_college_secret" jdbcType="VARCHAR" property="coolCollegeSecret"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, current_package, enterprise_id, staff_count, db_source_name, db_server, db_port,
|
||||
db_name, db_user, db_pwd, license, license_expires, license_type, ding_corp_id, ding_corp_secret,
|
||||
create_time, create_user, main_corp_id, app_type, permanent_code, agentid, cool_college_enterprise_id,
|
||||
cool_college_secret
|
||||
</sql>
|
||||
|
||||
<select id="selectByEnterpriseId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
enterprise_config
|
||||
where
|
||||
enterprise_id = #{enterpriseId}
|
||||
</select>
|
||||
|
||||
<select id="getDistinctDbServer" resultMap="BaseResultMap">
|
||||
select
|
||||
distinct db_server, db_port, db_user, db_pwd
|
||||
from
|
||||
enterprise_config
|
||||
</select>
|
||||
|
||||
<select id="getDbInfoByDbName" resultMap="BaseResultMap">
|
||||
select
|
||||
db_server, db_port, db_user, db_pwd
|
||||
from
|
||||
enterprise_config
|
||||
where
|
||||
db_name = #{dbName} limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,391 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.EnterpriseUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseUserDO">
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="tel" jdbcType="VARCHAR" property="tel"/>
|
||||
<result column="work_place" jdbcType="VARCHAR" property="workPlace"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="mobile" jdbcType="VARCHAR" property="mobile"/>
|
||||
<result column="email" jdbcType="VARCHAR" property="email"/>
|
||||
<result column="org_email" jdbcType="VARCHAR" property="orgEmail"/>
|
||||
<result column="active" jdbcType="BIT" property="active"/>
|
||||
<result column="order_in_depts" jdbcType="VARCHAR" property="orderInDepts"/>
|
||||
<result column="main_admin" jdbcType="TINYINT" property="mainAdmin"/>
|
||||
<result column="is_admin" jdbcType="BIT" property="isAdmin"/>
|
||||
<result column="is_boss" jdbcType="BIT" property="isBoss"/>
|
||||
<result column="dingId" jdbcType="VARCHAR" property="dingid"/>
|
||||
<result column="unionid" jdbcType="VARCHAR" property="unionid"/>
|
||||
<result column="is_hide" jdbcType="BIT" property="isHide"/>
|
||||
<result column="position" jdbcType="VARCHAR" property="position"/>
|
||||
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
|
||||
<result column="extattr" jdbcType="VARCHAR" property="extattr"/>
|
||||
<result column="is_enterprise" jdbcType="BIT" property="isEnterprise"/>
|
||||
<result column="roles" jdbcType="VARCHAR" property="roles"/>
|
||||
<result column="is_leader" jdbcType="BIT" property="isLeader"/>
|
||||
<result column="face_url" jdbcType="VARCHAR" property="faceUrl"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="language" jdbcType="CHAR" property="language"/>
|
||||
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
|
||||
<result column="third_oa_unique_flag" jdbcType="VARCHAR" property="thirdOaUniqueFlag"/>
|
||||
<result column="subordinate_change" jdbcType="TINYINT" property="subordinateChange"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="subordinate_range" jdbcType="VARCHAR" property="subordinateRange"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.EnterpriseUserDO">
|
||||
<result column="is_leader_in_depts" jdbcType="LONGVARCHAR" property="isLeaderInDepts"/>
|
||||
<result column="department" jdbcType="LONGVARCHAR" property="department"/>
|
||||
<result column="jobnumber" jdbcType="LONGVARCHAR" property="jobnumber"/>
|
||||
<result column="monitored_departments" jdbcType="LONGVARCHAR" property="monitoredDepartments"/>
|
||||
<result column="departments" jdbcType="LONGVARCHAR" property="departments"/>
|
||||
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, name, tel, work_place, remark, mobile, email, org_email, active, order_in_depts,
|
||||
main_admin, is_admin, is_boss, dingId, unionid, is_hide, position, avatar, extattr,
|
||||
is_enterprise, roles, is_leader, face_url, create_time, language, user_status, third_oa_unique_flag,
|
||||
subordinate_change, update_time, subordinate_range
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
is_leader_in_depts, department, jobnumber, monitored_departments, departments, user_region_ids
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into enterprise_user_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="record.tel != null">
|
||||
tel,
|
||||
</if>
|
||||
<if test="record.workPlace != null">
|
||||
work_place,
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="record.mobile != null">
|
||||
mobile,
|
||||
</if>
|
||||
<if test="record.email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="record.orgEmail != null">
|
||||
org_email,
|
||||
</if>
|
||||
<if test="record.active != null">
|
||||
active,
|
||||
</if>
|
||||
<if test="record.orderInDepts != null">
|
||||
order_in_depts,
|
||||
</if>
|
||||
<if test="record.mainAdmin != null">
|
||||
main_admin,
|
||||
</if>
|
||||
<if test="record.isAdmin != null">
|
||||
is_admin,
|
||||
</if>
|
||||
<if test="record.isBoss != null">
|
||||
is_boss,
|
||||
</if>
|
||||
<if test="record.dingid != null">
|
||||
dingId,
|
||||
</if>
|
||||
<if test="record.unionid != null">
|
||||
unionid,
|
||||
</if>
|
||||
<if test="record.isHide != null">
|
||||
is_hide,
|
||||
</if>
|
||||
<if test="record.position != null">
|
||||
position,
|
||||
</if>
|
||||
<if test="record.avatar != null">
|
||||
avatar,
|
||||
</if>
|
||||
<if test="record.extattr != null">
|
||||
extattr,
|
||||
</if>
|
||||
<if test="record.isEnterprise != null">
|
||||
is_enterprise,
|
||||
</if>
|
||||
<if test="record.roles != null">
|
||||
roles,
|
||||
</if>
|
||||
<if test="record.isLeader != null">
|
||||
is_leader,
|
||||
</if>
|
||||
<if test="record.faceUrl != null">
|
||||
face_url,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.language != null">
|
||||
language,
|
||||
</if>
|
||||
<if test="record.userStatus != null">
|
||||
user_status,
|
||||
</if>
|
||||
<if test="record.thirdOaUniqueFlag != null">
|
||||
third_oa_unique_flag,
|
||||
</if>
|
||||
<if test="record.subordinateChange != null">
|
||||
subordinate_change,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="record.subordinateRange != null">
|
||||
subordinate_range,
|
||||
</if>
|
||||
<if test="record.isLeaderInDepts != null">
|
||||
is_leader_in_depts,
|
||||
</if>
|
||||
<if test="record.department != null">
|
||||
department,
|
||||
</if>
|
||||
<if test="record.jobnumber != null">
|
||||
jobnumber,
|
||||
</if>
|
||||
<if test="record.monitoredDepartments != null">
|
||||
monitored_departments,
|
||||
</if>
|
||||
<if test="record.departments != null">
|
||||
departments,
|
||||
</if>
|
||||
<if test="record.userRegionIds != null">
|
||||
user_region_ids,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
#{record.name},
|
||||
</if>
|
||||
<if test="record.tel != null">
|
||||
#{record.tel},
|
||||
</if>
|
||||
<if test="record.workPlace != null">
|
||||
#{record.workPlace},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
#{record.remark},
|
||||
</if>
|
||||
<if test="record.mobile != null">
|
||||
#{record.mobile},
|
||||
</if>
|
||||
<if test="record.email != null">
|
||||
#{record.email},
|
||||
</if>
|
||||
<if test="record.orgEmail != null">
|
||||
#{record.orgEmail},
|
||||
</if>
|
||||
<if test="record.active != null">
|
||||
#{record.active},
|
||||
</if>
|
||||
<if test="record.orderInDepts != null">
|
||||
#{record.orderInDepts},
|
||||
</if>
|
||||
<if test="record.mainAdmin != null">
|
||||
#{record.mainAdmin},
|
||||
</if>
|
||||
<if test="record.isAdmin != null">
|
||||
#{record.isAdmin},
|
||||
</if>
|
||||
<if test="record.isBoss != null">
|
||||
#{record.isBoss},
|
||||
</if>
|
||||
<if test="record.dingid != null">
|
||||
#{record.dingid},
|
||||
</if>
|
||||
<if test="record.unionid != null">
|
||||
#{record.unionid},
|
||||
</if>
|
||||
<if test="record.isHide != null">
|
||||
#{record.isHide},
|
||||
</if>
|
||||
<if test="record.position != null">
|
||||
#{record.position},
|
||||
</if>
|
||||
<if test="record.avatar != null">
|
||||
#{record.avatar},
|
||||
</if>
|
||||
<if test="record.extattr != null">
|
||||
#{record.extattr},
|
||||
</if>
|
||||
<if test="record.isEnterprise != null">
|
||||
#{record.isEnterprise},
|
||||
</if>
|
||||
<if test="record.roles != null">
|
||||
#{record.roles},
|
||||
</if>
|
||||
<if test="record.isLeader != null">
|
||||
#{record.isLeader},
|
||||
</if>
|
||||
<if test="record.faceUrl != null">
|
||||
#{record.faceUrl},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.language != null">
|
||||
#{record.language},
|
||||
</if>
|
||||
<if test="record.userStatus != null">
|
||||
#{record.userStatus},
|
||||
</if>
|
||||
<if test="record.thirdOaUniqueFlag != null">
|
||||
#{record.thirdOaUniqueFlag},
|
||||
</if>
|
||||
<if test="record.subordinateChange != null">
|
||||
#{record.subordinateChange},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
<if test="record.subordinateRange != null">
|
||||
#{record.subordinateRange},
|
||||
</if>
|
||||
<if test="record.isLeaderInDepts != null">
|
||||
#{record.isLeaderInDepts},
|
||||
</if>
|
||||
<if test="record.department != null">
|
||||
#{record.department},
|
||||
</if>
|
||||
<if test="record.jobnumber != null">
|
||||
#{record.jobnumber},
|
||||
</if>
|
||||
<if test="record.monitoredDepartments != null">
|
||||
#{record.monitoredDepartments},
|
||||
</if>
|
||||
<if test="record.departments != null">
|
||||
#{record.departments},
|
||||
</if>
|
||||
<if test="record.userRegionIds != null">
|
||||
#{record.userRegionIds},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update enterprise_user_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name},
|
||||
</if>
|
||||
<if test="record.tel != null">
|
||||
tel = #{record.tel},
|
||||
</if>
|
||||
<if test="record.workPlace != null">
|
||||
work_place = #{record.workPlace},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark},
|
||||
</if>
|
||||
<if test="record.mobile != null">
|
||||
mobile = #{record.mobile},
|
||||
</if>
|
||||
<if test="record.email != null">
|
||||
email = #{record.email},
|
||||
</if>
|
||||
<if test="record.orgEmail != null">
|
||||
org_email = #{record.orgEmail},
|
||||
</if>
|
||||
<if test="record.active != null">
|
||||
active = #{record.active},
|
||||
</if>
|
||||
<if test="record.orderInDepts != null">
|
||||
order_in_depts = #{record.orderInDepts},
|
||||
</if>
|
||||
<if test="record.mainAdmin != null">
|
||||
main_admin = #{record.mainAdmin},
|
||||
</if>
|
||||
<if test="record.isAdmin != null">
|
||||
is_admin = #{record.isAdmin},
|
||||
</if>
|
||||
<if test="record.isBoss != null">
|
||||
is_boss = #{record.isBoss},
|
||||
</if>
|
||||
<if test="record.dingid != null">
|
||||
dingId = #{record.dingid},
|
||||
</if>
|
||||
<if test="record.unionid != null">
|
||||
unionid = #{record.unionid},
|
||||
</if>
|
||||
<if test="record.isHide != null">
|
||||
is_hide = #{record.isHide},
|
||||
</if>
|
||||
<if test="record.position != null">
|
||||
position = #{record.position},
|
||||
</if>
|
||||
<if test="record.avatar != null">
|
||||
avatar = #{record.avatar},
|
||||
</if>
|
||||
<if test="record.extattr != null">
|
||||
extattr = #{record.extattr},
|
||||
</if>
|
||||
<if test="record.isEnterprise != null">
|
||||
is_enterprise = #{record.isEnterprise},
|
||||
</if>
|
||||
<if test="record.roles != null">
|
||||
roles = #{record.roles},
|
||||
</if>
|
||||
<if test="record.isLeader != null">
|
||||
is_leader = #{record.isLeader},
|
||||
</if>
|
||||
<if test="record.faceUrl != null">
|
||||
face_url = #{record.faceUrl},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.language != null">
|
||||
language = #{record.language},
|
||||
</if>
|
||||
<if test="record.userStatus != null">
|
||||
user_status = #{record.userStatus},
|
||||
</if>
|
||||
<if test="record.thirdOaUniqueFlag != null">
|
||||
third_oa_unique_flag = #{record.thirdOaUniqueFlag},
|
||||
</if>
|
||||
<if test="record.subordinateChange != null">
|
||||
subordinate_change = #{record.subordinateChange},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
<if test="record.subordinateRange != null">
|
||||
subordinate_range = #{record.subordinateRange},
|
||||
</if>
|
||||
<if test="record.isLeaderInDepts != null">
|
||||
is_leader_in_depts = #{record.isLeaderInDepts},
|
||||
</if>
|
||||
<if test="record.department != null">
|
||||
department = #{record.department},
|
||||
</if>
|
||||
<if test="record.jobnumber != null">
|
||||
jobnumber = #{record.jobnumber},
|
||||
</if>
|
||||
<if test="record.monitoredDepartments != null">
|
||||
monitored_departments = #{record.monitoredDepartments},
|
||||
</if>
|
||||
<if test="record.departments != null">
|
||||
departments = #{record.departments},
|
||||
</if>
|
||||
<if test="record.userRegionIds != null">
|
||||
user_region_ids = #{record.userRegionIds},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.EnterpriseUserRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseUserRoleDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, role_id, user_id, create_time, update_time
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into enterprise_user_role_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.roleId != null">
|
||||
role_id,
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.roleId != null">
|
||||
#{record.roleId},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update enterprise_user_role_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.roleId != null">
|
||||
role_id = #{record.roleId},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
205
coolstore-partner-dao/src/main/resources/mapper/RegionMapper.xml
Normal file
205
coolstore-partner-dao/src/main/resources/mapper/RegionMapper.xml
Normal file
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.RegionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.RegionDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
|
||||
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||
<result column="create_name" jdbcType="VARCHAR" property="createName"/>
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||
<result column="update_name" jdbcType="VARCHAR" property="updateName"/>
|
||||
<result column="vds_group_corp_id" jdbcType="VARCHAR" property="vdsGroupCorpId"/>
|
||||
<result column="syn_ding_dept_id" jdbcType="VARCHAR" property="synDingDeptId"/>
|
||||
<result column="region_type" jdbcType="VARCHAR" property="regionType"/>
|
||||
<result column="region_path" jdbcType="VARCHAR" property="regionPath"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="store_num" jdbcType="INTEGER" property="storeNum"/>
|
||||
<result column="store_id" jdbcType="VARCHAR" property="storeId"/>
|
||||
<result column="unclassified_flag" jdbcType="TINYINT" property="unclassifiedFlag"/>
|
||||
<result column="order_num" jdbcType="INTEGER" property="orderNum"/>
|
||||
<result column="third_dept_id" jdbcType="VARCHAR" property="thirdDeptId"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, region_id, name, parent_id, group_id, create_time, create_name, update_time,
|
||||
update_name, vds_group_corp_id, syn_ding_dept_id, region_type, region_path, deleted,
|
||||
store_num, store_id, unclassified_flag, order_num, third_dept_id
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into region_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.regionId != null">
|
||||
region_id,
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="record.groupId != null">
|
||||
group_id,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.createName != null">
|
||||
create_name,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="record.updateName != null">
|
||||
update_name,
|
||||
</if>
|
||||
<if test="record.vdsGroupCorpId != null">
|
||||
vds_group_corp_id,
|
||||
</if>
|
||||
<if test="record.synDingDeptId != null">
|
||||
syn_ding_dept_id,
|
||||
</if>
|
||||
<if test="record.regionType != null">
|
||||
region_type,
|
||||
</if>
|
||||
<if test="record.regionPath != null">
|
||||
region_path,
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="record.storeNum != null">
|
||||
store_num,
|
||||
</if>
|
||||
<if test="record.storeId != null">
|
||||
store_id,
|
||||
</if>
|
||||
<if test="record.unclassifiedFlag != null">
|
||||
unclassified_flag,
|
||||
</if>
|
||||
<if test="record.orderNum != null">
|
||||
order_num,
|
||||
</if>
|
||||
<if test="record.thirdDeptId != null">
|
||||
third_dept_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.regionId != null">
|
||||
#{record.regionId},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
#{record.name},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
#{record.parentId},
|
||||
</if>
|
||||
<if test="record.groupId != null">
|
||||
#{record.groupId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.createName != null">
|
||||
#{record.createName},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
<if test="record.updateName != null">
|
||||
#{record.updateName},
|
||||
</if>
|
||||
<if test="record.vdsGroupCorpId != null">
|
||||
#{record.vdsGroupCorpId},
|
||||
</if>
|
||||
<if test="record.synDingDeptId != null">
|
||||
#{record.synDingDeptId},
|
||||
</if>
|
||||
<if test="record.regionType != null">
|
||||
#{record.regionType},
|
||||
</if>
|
||||
<if test="record.regionPath != null">
|
||||
#{record.regionPath},
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
#{record.deleted},
|
||||
</if>
|
||||
<if test="record.storeNum != null">
|
||||
#{record.storeNum},
|
||||
</if>
|
||||
<if test="record.storeId != null">
|
||||
#{record.storeId},
|
||||
</if>
|
||||
<if test="record.unclassifiedFlag != null">
|
||||
#{record.unclassifiedFlag},
|
||||
</if>
|
||||
<if test="record.orderNum != null">
|
||||
#{record.orderNum},
|
||||
</if>
|
||||
<if test="record.thirdDeptId != null">
|
||||
#{record.thirdDeptId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update region_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.regionId != null">
|
||||
region_id = #{record.regionId},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id = #{record.parentId},
|
||||
</if>
|
||||
<if test="record.groupId != null">
|
||||
group_id = #{record.groupId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.createName != null">
|
||||
create_name = #{record.createName},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
<if test="record.updateName != null">
|
||||
update_name = #{record.updateName},
|
||||
</if>
|
||||
<if test="record.vdsGroupCorpId != null">
|
||||
vds_group_corp_id = #{record.vdsGroupCorpId},
|
||||
</if>
|
||||
<if test="record.synDingDeptId != null">
|
||||
syn_ding_dept_id = #{record.synDingDeptId},
|
||||
</if>
|
||||
<if test="record.regionType != null">
|
||||
region_type = #{record.regionType},
|
||||
</if>
|
||||
<if test="record.regionPath != null">
|
||||
region_path = #{record.regionPath},
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
deleted = #{record.deleted},
|
||||
</if>
|
||||
<if test="record.storeNum != null">
|
||||
store_num = #{record.storeNum},
|
||||
</if>
|
||||
<if test="record.storeId != null">
|
||||
store_id = #{record.storeId},
|
||||
</if>
|
||||
<if test="record.unclassifiedFlag != null">
|
||||
unclassified_flag = #{record.unclassifiedFlag},
|
||||
</if>
|
||||
<if test="record.orderNum != null">
|
||||
order_num = #{record.orderNum},
|
||||
</if>
|
||||
<if test="record.thirdDeptId != null">
|
||||
third_dept_id = #{record.thirdDeptId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.SysDepartmentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysDepartmentDO">
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
|
||||
<result column="depart_order" jdbcType="INTEGER" property="departOrder"/>
|
||||
<result column="create_dept_group" jdbcType="BIT" property="createDeptGroup"/>
|
||||
<result column="auto_add_user" jdbcType="BIT" property="autoAddUser"/>
|
||||
<result column="dep_Hiding" jdbcType="BIT" property="depHiding"/>
|
||||
<result column="dept_perimits" jdbcType="VARCHAR" property="deptPerimits"/>
|
||||
<result column="user_perimits" jdbcType="VARCHAR" property="userPerimits"/>
|
||||
<result column="outer_dept" jdbcType="BIT" property="outerDept"/>
|
||||
<result column="outer_permit_depts" jdbcType="VARCHAR" property="outerPermitDepts"/>
|
||||
<result column="outer_permit_users" jdbcType="VARCHAR" property="outerPermitUsers"/>
|
||||
<result column="org_dept_owner" jdbcType="VARCHAR" property="orgDeptOwner"/>
|
||||
<result column="dept_manager_userid_list" jdbcType="VARCHAR" property="deptManagerUseridList"/>
|
||||
<result column="user_count" jdbcType="INTEGER" property="userCount"/>
|
||||
<result column="unactive_user_count" jdbcType="INTEGER" property="unactiveUserCount"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.SysDepartmentDO">
|
||||
<result column="parent_ids" jdbcType="LONGVARCHAR" property="parentIds"/>
|
||||
<result column="sub_ids" jdbcType="LONGVARCHAR" property="subIds"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, parent_id, depart_order, create_dept_group, auto_add_user, dep_Hiding,
|
||||
dept_perimits, user_perimits, outer_dept, outer_permit_depts, outer_permit_users,
|
||||
org_dept_owner, dept_manager_userid_list, user_count, unactive_user_count
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
parent_ids, sub_ids
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into sys_department_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="record.departOrder != null">
|
||||
depart_order,
|
||||
</if>
|
||||
<if test="record.createDeptGroup != null">
|
||||
create_dept_group,
|
||||
</if>
|
||||
<if test="record.autoAddUser != null">
|
||||
auto_add_user,
|
||||
</if>
|
||||
<if test="record.depHiding != null">
|
||||
dep_Hiding,
|
||||
</if>
|
||||
<if test="record.deptPerimits != null">
|
||||
dept_perimits,
|
||||
</if>
|
||||
<if test="record.userPerimits != null">
|
||||
user_perimits,
|
||||
</if>
|
||||
<if test="record.outerDept != null">
|
||||
outer_dept,
|
||||
</if>
|
||||
<if test="record.outerPermitDepts != null">
|
||||
outer_permit_depts,
|
||||
</if>
|
||||
<if test="record.outerPermitUsers != null">
|
||||
outer_permit_users,
|
||||
</if>
|
||||
<if test="record.orgDeptOwner != null">
|
||||
org_dept_owner,
|
||||
</if>
|
||||
<if test="record.deptManagerUseridList != null">
|
||||
dept_manager_userid_list,
|
||||
</if>
|
||||
<if test="record.userCount != null">
|
||||
user_count,
|
||||
</if>
|
||||
<if test="record.unactiveUserCount != null">
|
||||
unactive_user_count,
|
||||
</if>
|
||||
<if test="record.parentIds != null">
|
||||
parent_ids,
|
||||
</if>
|
||||
<if test="record.subIds != null">
|
||||
sub_ids,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.name != null">
|
||||
#{record.name},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
#{record.parentId},
|
||||
</if>
|
||||
<if test="record.departOrder != null">
|
||||
#{record.departOrder},
|
||||
</if>
|
||||
<if test="record.createDeptGroup != null">
|
||||
#{record.createDeptGroup},
|
||||
</if>
|
||||
<if test="record.autoAddUser != null">
|
||||
#{record.autoAddUser},
|
||||
</if>
|
||||
<if test="record.depHiding != null">
|
||||
#{record.depHiding},
|
||||
</if>
|
||||
<if test="record.deptPerimits != null">
|
||||
#{record.deptPerimits},
|
||||
</if>
|
||||
<if test="record.userPerimits != null">
|
||||
#{record.userPerimits},
|
||||
</if>
|
||||
<if test="record.outerDept != null">
|
||||
#{record.outerDept},
|
||||
</if>
|
||||
<if test="record.outerPermitDepts != null">
|
||||
#{record.outerPermitDepts},
|
||||
</if>
|
||||
<if test="record.outerPermitUsers != null">
|
||||
#{record.outerPermitUsers},
|
||||
</if>
|
||||
<if test="record.orgDeptOwner != null">
|
||||
#{record.orgDeptOwner},
|
||||
</if>
|
||||
<if test="record.deptManagerUseridList != null">
|
||||
#{record.deptManagerUseridList},
|
||||
</if>
|
||||
<if test="record.userCount != null">
|
||||
#{record.userCount},
|
||||
</if>
|
||||
<if test="record.unactiveUserCount != null">
|
||||
#{record.unactiveUserCount},
|
||||
</if>
|
||||
<if test="record.parentIds != null">
|
||||
#{record.parentIds},
|
||||
</if>
|
||||
<if test="record.subIds != null">
|
||||
#{record.subIds},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update sys_department_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id = #{record.parentId},
|
||||
</if>
|
||||
<if test="record.departOrder != null">
|
||||
depart_order = #{record.departOrder},
|
||||
</if>
|
||||
<if test="record.createDeptGroup != null">
|
||||
create_dept_group = #{record.createDeptGroup},
|
||||
</if>
|
||||
<if test="record.autoAddUser != null">
|
||||
auto_add_user = #{record.autoAddUser},
|
||||
</if>
|
||||
<if test="record.depHiding != null">
|
||||
dep_Hiding = #{record.depHiding},
|
||||
</if>
|
||||
<if test="record.deptPerimits != null">
|
||||
dept_perimits = #{record.deptPerimits},
|
||||
</if>
|
||||
<if test="record.userPerimits != null">
|
||||
user_perimits = #{record.userPerimits},
|
||||
</if>
|
||||
<if test="record.outerDept != null">
|
||||
outer_dept = #{record.outerDept},
|
||||
</if>
|
||||
<if test="record.outerPermitDepts != null">
|
||||
outer_permit_depts = #{record.outerPermitDepts},
|
||||
</if>
|
||||
<if test="record.outerPermitUsers != null">
|
||||
outer_permit_users = #{record.outerPermitUsers},
|
||||
</if>
|
||||
<if test="record.orgDeptOwner != null">
|
||||
org_dept_owner = #{record.orgDeptOwner},
|
||||
</if>
|
||||
<if test="record.deptManagerUseridList != null">
|
||||
dept_manager_userid_list = #{record.deptManagerUseridList},
|
||||
</if>
|
||||
<if test="record.userCount != null">
|
||||
user_count = #{record.userCount},
|
||||
</if>
|
||||
<if test="record.unactiveUserCount != null">
|
||||
unactive_user_count = #{record.unactiveUserCount},
|
||||
</if>
|
||||
<if test="record.parentIds != null">
|
||||
parent_ids = #{record.parentIds},
|
||||
</if>
|
||||
<if test="record.subIds != null">
|
||||
sub_ids = #{record.subIds},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.SysRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysRoleDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="role_name" jdbcType="VARCHAR" property="roleName"/>
|
||||
<result column="is_internal" jdbcType="BIT" property="isInternal"/>
|
||||
<result column="role_auth" jdbcType="VARCHAR" property="roleAuth"/>
|
||||
<result column="source" jdbcType="CHAR" property="source"/>
|
||||
<result column="position_type" jdbcType="VARCHAR" property="positionType"/>
|
||||
<result column="app_menu" jdbcType="VARCHAR" property="appMenu"/>
|
||||
<result column="syn_ding_role_id" jdbcType="BIGINT" property="synDingRoleId"/>
|
||||
<result column="priority" jdbcType="INTEGER" property="priority"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="role_enum" jdbcType="VARCHAR" property="roleEnum"/>
|
||||
<result column="create_user" jdbcType="VARCHAR" property="createUser"/>
|
||||
<result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
|
||||
<result column="third_unique_id" jdbcType="VARCHAR" property="thirdUniqueId"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, role_name, is_internal, role_auth, source, position_type, app_menu, syn_ding_role_id,
|
||||
priority, create_time, update_time, role_enum, create_user, update_user, third_unique_id
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into sys_role_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.roleName != null">
|
||||
role_name,
|
||||
</if>
|
||||
<if test="record.isInternal != null">
|
||||
is_internal,
|
||||
</if>
|
||||
<if test="record.roleAuth != null">
|
||||
role_auth,
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="record.positionType != null">
|
||||
position_type,
|
||||
</if>
|
||||
<if test="record.appMenu != null">
|
||||
app_menu,
|
||||
</if>
|
||||
<if test="record.synDingRoleId != null">
|
||||
syn_ding_role_id,
|
||||
</if>
|
||||
<if test="record.priority != null">
|
||||
priority,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="record.roleEnum != null">
|
||||
role_enum,
|
||||
</if>
|
||||
<if test="record.createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="record.updateUser != null">
|
||||
update_user,
|
||||
</if>
|
||||
<if test="record.thirdUniqueId != null">
|
||||
third_unique_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.roleName != null">
|
||||
#{record.roleName},
|
||||
</if>
|
||||
<if test="record.isInternal != null">
|
||||
#{record.isInternal},
|
||||
</if>
|
||||
<if test="record.roleAuth != null">
|
||||
#{record.roleAuth},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
#{record.source},
|
||||
</if>
|
||||
<if test="record.positionType != null">
|
||||
#{record.positionType},
|
||||
</if>
|
||||
<if test="record.appMenu != null">
|
||||
#{record.appMenu},
|
||||
</if>
|
||||
<if test="record.synDingRoleId != null">
|
||||
#{record.synDingRoleId},
|
||||
</if>
|
||||
<if test="record.priority != null">
|
||||
#{record.priority},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
<if test="record.roleEnum != null">
|
||||
#{record.roleEnum},
|
||||
</if>
|
||||
<if test="record.createUser != null">
|
||||
#{record.createUser},
|
||||
</if>
|
||||
<if test="record.updateUser != null">
|
||||
#{record.updateUser},
|
||||
</if>
|
||||
<if test="record.thirdUniqueId != null">
|
||||
#{record.thirdUniqueId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update sys_role_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.roleName != null">
|
||||
role_name = #{record.roleName},
|
||||
</if>
|
||||
<if test="record.isInternal != null">
|
||||
is_internal = #{record.isInternal},
|
||||
</if>
|
||||
<if test="record.roleAuth != null">
|
||||
role_auth = #{record.roleAuth},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source = #{record.source},
|
||||
</if>
|
||||
<if test="record.positionType != null">
|
||||
position_type = #{record.positionType},
|
||||
</if>
|
||||
<if test="record.appMenu != null">
|
||||
app_menu = #{record.appMenu},
|
||||
</if>
|
||||
<if test="record.synDingRoleId != null">
|
||||
syn_ding_role_id = #{record.synDingRoleId},
|
||||
</if>
|
||||
<if test="record.priority != null">
|
||||
priority = #{record.priority},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
<if test="record.roleEnum != null">
|
||||
role_enum = #{record.roleEnum},
|
||||
</if>
|
||||
<if test="record.createUser != null">
|
||||
create_user = #{record.createUser},
|
||||
</if>
|
||||
<if test="record.updateUser != null">
|
||||
update_user = #{record.updateUser},
|
||||
</if>
|
||||
<if test="record.thirdUniqueId != null">
|
||||
third_unique_id = #{record.thirdUniqueId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.SysRoleMenuMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysRoleMenuDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="menu_id" jdbcType="BIGINT" property="menuId"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
<result column="platform" jdbcType="VARCHAR" property="platform"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, menu_id, role_id, platform
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into sys_role_menu_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.menuId != null">
|
||||
menu_id,
|
||||
</if>
|
||||
<if test="record.roleId != null">
|
||||
role_id,
|
||||
</if>
|
||||
<if test="record.platform != null">
|
||||
platform,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.menuId != null">
|
||||
#{record.menuId},
|
||||
</if>
|
||||
<if test="record.roleId != null">
|
||||
#{record.roleId},
|
||||
</if>
|
||||
<if test="record.platform != null">
|
||||
#{record.platform},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update sys_role_menu_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.menuId != null">
|
||||
menu_id = #{record.menuId},
|
||||
</if>
|
||||
<if test="record.roleId != null">
|
||||
role_id = #{record.roleId},
|
||||
</if>
|
||||
<if test="record.platform != null">
|
||||
platform = #{record.platform},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.UserAuthMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.UserAuthMappingDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="mapping_id" jdbcType="VARCHAR" property="mappingId"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, mapping_id, type, source, create_id, create_time, update_id, update_time
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into user_auth_mapping_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
mapping_id,
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source,
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
#{record.mappingId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
#{record.type},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
#{record.source},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
#{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
#{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update user_auth_mapping_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId},
|
||||
</if>
|
||||
<if test="record.mappingId != null">
|
||||
mapping_id = #{record.mappingId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type},
|
||||
</if>
|
||||
<if test="record.source != null">
|
||||
source = #{record.source},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id = #{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id = #{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.UserRegionMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.UserRegionMappingDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
|
||||
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, region_id, user_id, create_id, create_time, update_id, update_time
|
||||
</sql>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into user_region_mapping_${enterpriseId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="record.regionId != null">
|
||||
region_id,
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id,
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id,
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="record.regionId != null">
|
||||
#{record.regionId},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
#{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
#{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
#{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
#{record.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective">
|
||||
update user_region_mapping_${enterpriseId}
|
||||
<set>
|
||||
<if test="record.regionId != null">
|
||||
region_id = #{record.regionId},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId},
|
||||
</if>
|
||||
<if test="record.createId != null">
|
||||
create_id = #{record.createId},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime},
|
||||
</if>
|
||||
<if test="record.updateId != null">
|
||||
update_id = #{record.updateId},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,35 @@
|
||||
package generator;
|
||||
|
||||
import org.mybatis.generator.api.MyBatisGenerator;
|
||||
import org.mybatis.generator.config.Configuration;
|
||||
import org.mybatis.generator.config.xml.ConfigurationParser;
|
||||
import org.mybatis.generator.internal.DefaultShellCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GeneratorCodeMain {
|
||||
|
||||
public static void generator() {
|
||||
List<String> warnings = new ArrayList<String>();
|
||||
try {
|
||||
// 解析
|
||||
ConfigurationParser cp = new ConfigurationParser(warnings);
|
||||
Configuration config = cp.parseConfiguration(GeneratorCodeMain.class.getResourceAsStream("/mybatis-generator.xml"));
|
||||
// 是否覆盖
|
||||
DefaultShellCallback dsc = new DefaultShellCallback(false);
|
||||
MyBatisGenerator mg = new MyBatisGenerator(config, dsc, warnings);
|
||||
mg.generate(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
GeneratorCodeMain.generator();
|
||||
System.out.println("done!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package generator.defined;
|
||||
|
||||
import org.mybatis.generator.api.CommentGenerator;
|
||||
import org.mybatis.generator.api.IntrospectedColumn;
|
||||
import org.mybatis.generator.api.IntrospectedTable;
|
||||
import org.mybatis.generator.api.dom.java.Field;
|
||||
import org.mybatis.generator.api.dom.java.Method;
|
||||
import org.mybatis.generator.api.dom.java.TopLevelClass;
|
||||
import org.mybatis.generator.api.dom.xml.XmlElement;
|
||||
import org.mybatis.generator.internal.DefaultCommentGenerator;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: MyCommentGenerator
|
||||
* @Description:
|
||||
* @date 2021-11-18 11:09
|
||||
*/
|
||||
public class MyCommentGenerator extends DefaultCommentGenerator implements CommentGenerator {
|
||||
private String author;
|
||||
/**
|
||||
* 当前时间
|
||||
*/
|
||||
private String currentDateStr;
|
||||
public static final ThreadLocal<String> authorName = new ThreadLocal<String>();
|
||||
|
||||
public MyCommentGenerator() {
|
||||
currentDateStr = (new SimpleDateFormat("yyyy-MM-dd hh:mm")).format(new Date());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addConfigurationProperties(Properties properties) {
|
||||
author = properties.getProperty("author");
|
||||
authorName.set(author);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段注释
|
||||
* @param field
|
||||
* @param introspectedTable
|
||||
* @param introspectedColumn
|
||||
*/
|
||||
@Override
|
||||
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
|
||||
String remarks = introspectedColumn.getRemarks();
|
||||
field.addAnnotation("@ApiModelProperty(\""+ remarks +"\")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFieldComment(Field field, IntrospectedTable introspectedTable) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
|
||||
String remarks = introspectedTable.getRemarks();
|
||||
topLevelClass.addJavaDocLine("/**");
|
||||
topLevelClass.addJavaDocLine(" * " + remarks);
|
||||
topLevelClass.addJavaDocLine(" * @author " + author);
|
||||
topLevelClass.addJavaDocLine(" * @date " + currentDateStr);
|
||||
topLevelClass.addJavaDocLine(" */");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSetterComment(Method method,
|
||||
IntrospectedTable introspectedTable,
|
||||
IntrospectedColumn introspectedColumn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGeneralMethodComment(Method method,
|
||||
IntrospectedTable introspectedTable) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
method.addJavaDocLine("/**");
|
||||
method.addJavaDocLine(" *");
|
||||
sb.append(" * " + MethodName.getMethodComment(method.getName()));
|
||||
method.addJavaDocLine(sb.toString());
|
||||
method.addJavaDocLine(" * dateTime:" +currentDateStr);
|
||||
method.addJavaDocLine(" */");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addComment(XmlElement xmlElement) {
|
||||
|
||||
}
|
||||
|
||||
public enum MethodName{
|
||||
INSERT_SELECTIVE("insertSelective","默认插入方法,只会给有值的字段赋值\n\t * 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null"),
|
||||
SELECT_BY_PRIMARY_KEY("selectByPrimaryKey","默认查询方法,通过主键获取所有字段的值"),
|
||||
UPDATE_BY_PRIMARY_KEY_SELECTIVE("updateByPrimaryKeySelective","默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的"),
|
||||
DELETE_BY_PRIMARY_KEY("deleteByPrimaryKey","默认更新方法,根据主键物理删除"),;
|
||||
private String methodName;
|
||||
private String comment;
|
||||
|
||||
MethodName(String methodName, String comment) {
|
||||
this.methodName = methodName;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public static String getMethodComment(String methodName){
|
||||
for (MethodName value : MethodName.values()) {
|
||||
if(value.methodName.equals(methodName)){
|
||||
return value.comment;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,517 @@
|
||||
package generator.defined;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mybatis.generator.api.CommentGenerator;
|
||||
import org.mybatis.generator.api.FullyQualifiedTable;
|
||||
import org.mybatis.generator.api.IntrospectedColumn;
|
||||
import org.mybatis.generator.api.ProgressCallback;
|
||||
import org.mybatis.generator.api.dom.java.*;
|
||||
import org.mybatis.generator.api.dom.xml.Attribute;
|
||||
import org.mybatis.generator.api.dom.xml.TextElement;
|
||||
import org.mybatis.generator.api.dom.xml.XmlElement;
|
||||
import org.mybatis.generator.codegen.AbstractJavaClientGenerator;
|
||||
import org.mybatis.generator.codegen.mybatis3.IntrospectedTableMyBatis3Impl;
|
||||
import org.mybatis.generator.codegen.mybatis3.ListUtilities;
|
||||
import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities;
|
||||
import org.mybatis.generator.codegen.mybatis3.javamapper.JavaMapperGenerator;
|
||||
import org.mybatis.generator.codegen.mybatis3.xmlmapper.XMLMapperGenerator;
|
||||
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator;
|
||||
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.InsertSelectiveElementGenerator;
|
||||
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.UpdateByPrimaryKeySelectiveElementGenerator;
|
||||
import org.mybatis.generator.config.GeneratedKey;
|
||||
import org.mybatis.generator.config.PropertyRegistry;
|
||||
import org.mybatis.generator.internal.util.JavaBeansUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
|
||||
import static org.mybatis.generator.internal.util.messages.Messages.getString;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: MyIntrospectedTableMyBatis3Impl
|
||||
* @Description:
|
||||
* @date 2021-11-18 15:38
|
||||
*/
|
||||
public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Impl {
|
||||
|
||||
private String enterpriseIdTableSuffix = "_${enterpriseId}";
|
||||
|
||||
@Override
|
||||
public String getFullyQualifiedTableNameAtRuntime() {
|
||||
return getTableName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAliasedFullyQualifiedTableNameAtRuntime() {
|
||||
return getTableName();
|
||||
}
|
||||
|
||||
private String getTableName() {
|
||||
String tableName = this.getTableConfiguration().getTableName();
|
||||
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
|
||||
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
|
||||
//企业库
|
||||
return tableName.substring(0, tableName.lastIndexOf("_")) + enterpriseIdTableSuffix;
|
||||
}
|
||||
//平台库
|
||||
return tableName;
|
||||
}
|
||||
|
||||
private String getTableNameFromConfigFile() {
|
||||
String tableName = getTableName();
|
||||
if(tableName.contains(enterpriseIdTableSuffix)){
|
||||
tableName = tableName.replace(enterpriseIdTableSuffix,"");
|
||||
}
|
||||
return JavaBeansUtil.getCamelCaseString(tableName,true);
|
||||
}
|
||||
|
||||
private boolean isConfigTable() {
|
||||
String tableName = this.getTableConfiguration().getTableName();
|
||||
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
|
||||
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
|
||||
//企业库
|
||||
return false;
|
||||
}
|
||||
//平台库
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String calculateMyBatis3XmlMapperFileName() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("Mapper.xml"); //$NON-NLS-1$
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void calculateJavaClientAttributes() {
|
||||
if (context.getJavaClientGeneratorConfiguration() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(calculateJavaClientImplementationPackage());
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("DAOImpl"); //$NON-NLS-1$
|
||||
setDAOImplementationType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(calculateJavaClientInterfacePackage());
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("DAO"); //$NON-NLS-1$
|
||||
setDAOInterfaceType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(calculateJavaClientInterfacePackage());
|
||||
sb.append('.');
|
||||
if (stringHasValue(tableConfiguration.getMapperName())) {
|
||||
sb.append(tableConfiguration.getMapperName());
|
||||
} else {
|
||||
if (stringHasValue(fullyQualifiedTable.getDomainObjectSubPackage())) {
|
||||
sb.append(fullyQualifiedTable.getDomainObjectSubPackage());
|
||||
sb.append('.');
|
||||
}
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("Mapper"); //$NON-NLS-1$
|
||||
}
|
||||
setMyBatis3JavaMapperType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(calculateJavaClientInterfacePackage());
|
||||
sb.append('.');
|
||||
if (stringHasValue(tableConfiguration.getSqlProviderName())) {
|
||||
sb.append(tableConfiguration.getSqlProviderName());
|
||||
} else {
|
||||
if (stringHasValue(fullyQualifiedTable.getDomainObjectSubPackage())) {
|
||||
sb.append(fullyQualifiedTable.getDomainObjectSubPackage());
|
||||
sb.append('.');
|
||||
}
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("SqlProvider"); //$NON-NLS-1$
|
||||
}
|
||||
setMyBatis3SqlProviderType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(calculateJavaClientInterfacePackage());
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("DynamicSqlSupport"); //$NON-NLS-1$
|
||||
setMyBatisDynamicSqlSupportType(sb.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void calculateModelAttributes() {
|
||||
String pakkage = calculateJavaModelPackage();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(pakkage);
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("Key"); //$NON-NLS-1$
|
||||
setPrimaryKeyType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(pakkage);
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile() + "DO");
|
||||
setBaseRecordType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(pakkage);
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("WithBLOBs"); //$NON-NLS-1$
|
||||
setRecordWithBLOBsType(sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(pakkage);
|
||||
sb.append('.');
|
||||
sb.append(getTableNameFromConfigFile());
|
||||
sb.append("Example"); //$NON-NLS-1$
|
||||
setExampleType(sb.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void calculateXmlMapperGenerator(AbstractJavaClientGenerator javaClientGenerator,
|
||||
List<String> warnings,
|
||||
ProgressCallback progressCallback) {
|
||||
xmlMapperGenerator = new MyXMLMapperGenerator();
|
||||
|
||||
initializeAbstractGenerator(xmlMapperGenerator, warnings, progressCallback);
|
||||
}
|
||||
|
||||
public class MyXMLMapperGenerator extends XMLMapperGenerator {
|
||||
|
||||
public MyXMLMapperGenerator() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected XmlElement getSqlMapElement() {
|
||||
FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
|
||||
progressCallback.startTask(getString(
|
||||
"Progress.12", table.toString())); //$NON-NLS-1$
|
||||
XmlElement answer = new XmlElement("mapper"); //$NON-NLS-1$
|
||||
String namespace = introspectedTable.getMyBatis3SqlMapNamespace();
|
||||
answer.addAttribute(new Attribute("namespace", //$NON-NLS-1$
|
||||
namespace));
|
||||
|
||||
context.getCommentGenerator().addRootComment(answer);
|
||||
addResultMapWithoutBLOBsElement(answer);
|
||||
addResultMapWithBLOBsElement(answer);
|
||||
addExampleWhereClauseElement(answer);
|
||||
addMyBatis3UpdateByExampleWhereClauseElement(answer);
|
||||
addBaseColumnListElement(answer);
|
||||
addBlobColumnListElement(answer);
|
||||
addInsertSelectiveElement(answer);
|
||||
addUpdateByPrimaryKeySelectiveElement(answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addInsertSelectiveElement(XmlElement parentElement) {
|
||||
if (introspectedTable.getRules().generateInsertSelective()) {
|
||||
AbstractXmlElementGenerator elementGenerator = new MyInsertSelectiveElementGenerator();
|
||||
initializeAndExecuteGenerator(elementGenerator, parentElement);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addUpdateByPrimaryKeySelectiveElement(XmlElement parentElement) {
|
||||
if (introspectedTable.getRules().generateUpdateByPrimaryKeySelective()) {
|
||||
AbstractXmlElementGenerator elementGenerator = new MyUpdateByPrimaryKeySelectiveElementGenerator();
|
||||
initializeAndExecuteGenerator(elementGenerator, parentElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected AbstractJavaClientGenerator createJavaClientGenerator() {
|
||||
if (context.getJavaClientGeneratorConfiguration() == null) {
|
||||
return null;
|
||||
}
|
||||
AbstractJavaClientGenerator javaGenerator;
|
||||
javaGenerator = new MyJavaMapperGenerator();
|
||||
|
||||
return javaGenerator;
|
||||
}
|
||||
|
||||
public class MyJavaMapperGenerator extends JavaMapperGenerator {
|
||||
|
||||
@Override
|
||||
public List<CompilationUnit> getCompilationUnits() {
|
||||
boolean isConfig = isConfigTable();
|
||||
progressCallback.startTask(getString("Progress.17", //$NON-NLS-1$
|
||||
introspectedTable.getFullyQualifiedTable().toString()));
|
||||
CommentGenerator commentGenerator = context.getCommentGenerator();
|
||||
|
||||
FullyQualifiedJavaType type = new FullyQualifiedJavaType(
|
||||
introspectedTable.getMyBatis3JavaMapperType());
|
||||
Interface interfaze = new Interface(type);
|
||||
interfaze.setVisibility(JavaVisibility.PUBLIC);
|
||||
commentGenerator.addJavaFileComment(interfaze);
|
||||
|
||||
String rootInterface = introspectedTable
|
||||
.getTableConfigurationProperty(PropertyRegistry.ANY_ROOT_INTERFACE);
|
||||
if (!stringHasValue(rootInterface)) {
|
||||
rootInterface = context.getJavaClientGeneratorConfiguration()
|
||||
.getProperty(PropertyRegistry.ANY_ROOT_INTERFACE);
|
||||
}
|
||||
|
||||
if (stringHasValue(rootInterface)) {
|
||||
FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(
|
||||
rootInterface);
|
||||
interfaze.addSuperInterface(fqjt);
|
||||
interfaze.addImportedType(fqjt);
|
||||
}
|
||||
if(!isConfig){
|
||||
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param"));
|
||||
}
|
||||
addInsertSelectiveMethod(interfaze);
|
||||
addUpdateByPrimaryKeySelectiveMethod(interfaze);
|
||||
List<Method> methods = interfaze.getMethods();
|
||||
for (Method method : methods) {
|
||||
List<Parameter> parameters = method.getParameters();
|
||||
for (Parameter parameter : parameters) {
|
||||
if(!isConfig){
|
||||
String name = parameter.getName();
|
||||
parameter.addAnnotation("@Param(\""+ name+"\")");
|
||||
}
|
||||
}
|
||||
if(!isConfig){
|
||||
Parameter enterpriseId = new Parameter(FullyQualifiedJavaType.getStringInstance(), "enterpriseId");
|
||||
enterpriseId.addAnnotation("@Param(\"enterpriseId\")");
|
||||
method.addParameter(enterpriseId);
|
||||
}
|
||||
}
|
||||
|
||||
List<CompilationUnit> answer = new ArrayList<CompilationUnit>();
|
||||
if (context.getPlugins().clientGenerated(interfaze, null,
|
||||
introspectedTable)) {
|
||||
answer.add(interfaze);
|
||||
}
|
||||
|
||||
List<CompilationUnit> extraCompilationUnits = getExtraCompilationUnits();
|
||||
if (extraCompilationUnits != null) {
|
||||
answer.addAll(extraCompilationUnits);
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
}
|
||||
|
||||
public class MyInsertSelectiveElementGenerator extends InsertSelectiveElementGenerator{
|
||||
|
||||
public MyInsertSelectiveElementGenerator() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addElements(XmlElement parentElement) {
|
||||
boolean isConfig = isConfigTable();
|
||||
XmlElement answer = new XmlElement("insert"); //$NON-NLS-1$
|
||||
|
||||
answer.addAttribute(new Attribute(
|
||||
"id", introspectedTable.getInsertSelectiveStatementId())); //$NON-NLS-1$
|
||||
|
||||
/*
|
||||
FullyQualifiedJavaType parameterType = introspectedTable.getRules()
|
||||
.calculateAllFieldsClass();
|
||||
answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$
|
||||
parameterType.getFullyQualifiedName()));*/
|
||||
|
||||
context.getCommentGenerator().addComment(answer);
|
||||
|
||||
GeneratedKey gk = introspectedTable.getGeneratedKey();
|
||||
if (gk != null) {
|
||||
IntrospectedColumn introspectedColumn = introspectedTable
|
||||
.getColumn(gk.getColumn());
|
||||
/*if (introspectedColumn != null) {
|
||||
if (gk.isJdbcStandard()) {
|
||||
answer.addAttribute(new Attribute("useGeneratedKeys", "true")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
answer.addAttribute(new Attribute("keyProperty", introspectedColumn.getJavaProperty())); //$NON-NLS-1$
|
||||
answer.addAttribute(new Attribute("keyColumn", introspectedColumn.getActualColumnName())); //$NON-NLS-1$
|
||||
} else {
|
||||
answer.addElement(getSelectKey(introspectedColumn, gk));
|
||||
}
|
||||
}*/
|
||||
if(introspectedColumn != null){
|
||||
answer.addAttribute(new Attribute("useGeneratedKeys", "true")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
answer.addAttribute(new Attribute("keyProperty", "record."+introspectedColumn.getJavaProperty())); //$NON-NLS-1$
|
||||
answer.addAttribute(new Attribute("keyColumn", introspectedColumn.getActualColumnName())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("insert into "); //$NON-NLS-1$
|
||||
sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime());
|
||||
answer.addElement(new TextElement(sb.toString()));
|
||||
|
||||
XmlElement insertTrimElement = new XmlElement("trim"); //$NON-NLS-1$
|
||||
insertTrimElement.addAttribute(new Attribute("prefix", "(")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
insertTrimElement.addAttribute(new Attribute("suffix", ")")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
insertTrimElement.addAttribute(new Attribute("suffixOverrides", ",")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
answer.addElement(insertTrimElement);
|
||||
|
||||
XmlElement valuesTrimElement = new XmlElement("trim"); //$NON-NLS-1$
|
||||
valuesTrimElement.addAttribute(new Attribute("prefix", "values (")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
valuesTrimElement.addAttribute(new Attribute("suffix", ")")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
valuesTrimElement.addAttribute(new Attribute("suffixOverrides", ",")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
answer.addElement(valuesTrimElement);
|
||||
|
||||
for (IntrospectedColumn introspectedColumn : ListUtilities.removeIdentityAndGeneratedAlwaysColumns(introspectedTable.getAllColumns())) {
|
||||
|
||||
if (introspectedColumn.isSequenceColumn() || introspectedColumn.getFullyQualifiedJavaType().isPrimitive()) {
|
||||
sb.setLength(0);
|
||||
sb.append(MyBatis3FormattingUtilities
|
||||
.getEscapedColumnName(introspectedColumn));
|
||||
sb.append(',');
|
||||
insertTrimElement.addElement(new TextElement(sb.toString()));
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(MyBatis3FormattingUtilities
|
||||
.getParameterClause(introspectedColumn));
|
||||
sb.append(',');
|
||||
valuesTrimElement.addElement(new TextElement(sb.toString()));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
sb.setLength(0);
|
||||
if(!isConfig){
|
||||
sb.append("record.");
|
||||
}
|
||||
sb.append(introspectedColumn.getJavaProperty());
|
||||
sb.append(" != null"); //$NON-NLS-1$
|
||||
XmlElement insertNotNullElement = new XmlElement("if"); //$NON-NLS-1$
|
||||
insertNotNullElement.addAttribute(new Attribute(
|
||||
"test", sb.toString())); //$NON-NLS-1$
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(MyBatis3FormattingUtilities
|
||||
.getEscapedColumnName(introspectedColumn));
|
||||
sb.append(',');
|
||||
insertNotNullElement.addElement(new TextElement(sb.toString()));
|
||||
insertTrimElement.addElement(insertNotNullElement);
|
||||
|
||||
sb.setLength(0);
|
||||
if(!isConfig){
|
||||
sb.append("record.");
|
||||
}
|
||||
sb.append(introspectedColumn.getJavaProperty());
|
||||
sb.append(" != null"); //$NON-NLS-1$
|
||||
XmlElement valuesNotNullElement = new XmlElement("if"); //$NON-NLS-1$
|
||||
valuesNotNullElement.addAttribute(new Attribute(
|
||||
"test", sb.toString())); //$NON-NLS-1$
|
||||
|
||||
sb.setLength(0);
|
||||
if(isConfig){
|
||||
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
|
||||
}else{
|
||||
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
|
||||
}
|
||||
sb.append(',');
|
||||
valuesNotNullElement.addElement(new TextElement(sb.toString()));
|
||||
valuesTrimElement.addElement(valuesNotNullElement);
|
||||
}
|
||||
|
||||
if (context.getPlugins().sqlMapInsertSelectiveElementGenerated(answer, introspectedTable)) {
|
||||
parentElement.addElement(answer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MyUpdateByPrimaryKeySelectiveElementGenerator extends UpdateByPrimaryKeySelectiveElementGenerator{
|
||||
public MyUpdateByPrimaryKeySelectiveElementGenerator() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addElements(XmlElement parentElement) {
|
||||
boolean isConfig = isConfigTable();
|
||||
XmlElement answer = new XmlElement("update"); //$NON-NLS-1$
|
||||
|
||||
answer.addAttribute(new Attribute(
|
||||
"id", introspectedTable.getUpdateByPrimaryKeySelectiveStatementId())); //$NON-NLS-1$
|
||||
|
||||
String parameterType;
|
||||
|
||||
if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
|
||||
parameterType = introspectedTable.getRecordWithBLOBsType();
|
||||
} else {
|
||||
parameterType = introspectedTable.getBaseRecordType();
|
||||
}
|
||||
|
||||
/*answer.addAttribute(new Attribute("parameterType", //$NON-NLS-1$
|
||||
parameterType));*/
|
||||
|
||||
context.getCommentGenerator().addComment(answer);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("update "); //$NON-NLS-1$
|
||||
sb.append(introspectedTable.getFullyQualifiedTableNameAtRuntime());
|
||||
answer.addElement(new TextElement(sb.toString()));
|
||||
|
||||
XmlElement dynamicElement = new XmlElement("set"); //$NON-NLS-1$
|
||||
answer.addElement(dynamicElement);
|
||||
|
||||
for (IntrospectedColumn introspectedColumn : ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns())) {
|
||||
sb.setLength(0);
|
||||
if(!isConfig){
|
||||
sb.append("record.");
|
||||
}
|
||||
sb.append(introspectedColumn.getJavaProperty());
|
||||
sb.append(" != null"); //$NON-NLS-1$
|
||||
XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$
|
||||
isNotNullElement.addAttribute(new Attribute("test", sb.toString())); //$NON-NLS-1$
|
||||
dynamicElement.addElement(isNotNullElement);
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append(MyBatis3FormattingUtilities
|
||||
.getEscapedColumnName(introspectedColumn));
|
||||
sb.append(" = ");
|
||||
if(!isConfig){
|
||||
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
|
||||
}else{
|
||||
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
|
||||
}
|
||||
sb.append(',');
|
||||
|
||||
isNotNullElement.addElement(new TextElement(sb.toString()));
|
||||
}
|
||||
|
||||
boolean and = false;
|
||||
for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
|
||||
sb.setLength(0);
|
||||
if (and) {
|
||||
sb.append(" and "); //$NON-NLS-1$
|
||||
} else {
|
||||
sb.append("where "); //$NON-NLS-1$
|
||||
and = true;
|
||||
}
|
||||
|
||||
sb.append(MyBatis3FormattingUtilities
|
||||
.getEscapedColumnName(introspectedColumn));
|
||||
sb.append(" = ");
|
||||
if(isConfig){
|
||||
sb.append("#{"+introspectedColumn.getJavaProperty() + "}");
|
||||
}else{
|
||||
sb.append("#{record."+introspectedColumn.getJavaProperty() + "}");
|
||||
}
|
||||
answer.addElement(new TextElement(sb.toString()));
|
||||
}
|
||||
|
||||
if (context.getPlugins()
|
||||
.sqlMapUpdateByPrimaryKeySelectiveElementGenerated(answer,
|
||||
introspectedTable)) {
|
||||
parentElement.addElement(answer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package generator.defined;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mybatis.generator.api.IntrospectedColumn;
|
||||
import org.mybatis.generator.api.IntrospectedTable;
|
||||
import org.mybatis.generator.api.PluginAdapter;
|
||||
import org.mybatis.generator.api.dom.java.*;
|
||||
import org.mybatis.generator.api.dom.xml.Document;
|
||||
import org.mybatis.generator.api.dom.xml.XmlElement;
|
||||
import org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: MyPluginAdapter
|
||||
* @Description: 自定义生成器
|
||||
* @date 2021-11-18 14:11
|
||||
*/
|
||||
public class MyPluginAdapter extends PluginAdapter {
|
||||
|
||||
@Override
|
||||
public boolean validate(List<String> list) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* model新增import
|
||||
* @param topLevelClass
|
||||
* @param introspectedTable
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
|
||||
topLevelClass.addImportedType("java.io.Serializable");
|
||||
topLevelClass.addImportedType("lombok.Data");
|
||||
topLevelClass.addImportedType("lombok.Builder");
|
||||
topLevelClass.addImportedType("lombok.NoArgsConstructor");
|
||||
topLevelClass.addImportedType("lombok.AllArgsConstructor");
|
||||
topLevelClass.addImportedType("io.swagger.annotations.ApiModelProperty");
|
||||
topLevelClass.addAnnotation("@Data");
|
||||
topLevelClass.addAnnotation("@Builder");
|
||||
topLevelClass.addAnnotation("@NoArgsConstructor");
|
||||
topLevelClass.addAnnotation("@AllArgsConstructor");
|
||||
topLevelClass.addSuperInterface(new FullyQualifiedJavaType("java.io.Serializable"));
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* model不生成set方法
|
||||
* @param method
|
||||
* @param topLevelClass
|
||||
* @param introspectedColumn
|
||||
* @param introspectedTable
|
||||
* @param modelClassType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* model不生成get方法
|
||||
* @param method
|
||||
* @param topLevelClass
|
||||
* @param introspectedColumn
|
||||
* @param introspectedTable
|
||||
* @param modelClassType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* sql文件 新增动态sql
|
||||
* @param document
|
||||
* @param introspectedTable
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sqlMapDocumentGenerated(Document document, IntrospectedTable introspectedTable) {
|
||||
AbstractXmlElementGenerator elementGenerator = new CustomAbstractXmlElementGenerator();
|
||||
elementGenerator.setContext(context);
|
||||
elementGenerator.setIntrospectedTable(introspectedTable);
|
||||
elementGenerator.addElements(document.getRootElement());
|
||||
return super.sqlMapDocumentGenerated(document, introspectedTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* mapper文件备注
|
||||
* @param interfaze
|
||||
* @param topLevelClass
|
||||
* @param introspectedTable
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
|
||||
interfaze.addJavaDocLine("/**");
|
||||
interfaze.addJavaDocLine(" * @author zhangchenbiao" );
|
||||
interfaze.addJavaDocLine(" * @date " + (new SimpleDateFormat("yyyy-MM-dd hh:mm")).format(new Date()));
|
||||
interfaze.addJavaDocLine(" */");
|
||||
return super.clientGenerated(interfaze, topLevelClass, introspectedTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* sql新增动态sql
|
||||
*/
|
||||
public class CustomAbstractXmlElementGenerator extends AbstractXmlElementGenerator {
|
||||
|
||||
@Override
|
||||
public void addElements(XmlElement parentElement) {
|
||||
/*String tableName =getTableName();
|
||||
// 增加base_query
|
||||
XmlElement sql = new XmlElement("sql");
|
||||
sql.addAttribute(new Attribute("id", "dynamicQuery"));
|
||||
//在这里添加where条件
|
||||
XmlElement selectTrimElement = new XmlElement("trim"); //设置trim标签
|
||||
selectTrimElement.addAttribute(new Attribute("prefix", "WHERE"));
|
||||
selectTrimElement.addAttribute(new Attribute("prefixOverrides", "AND | OR")); //添加where和and
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(IntrospectedColumn introspectedColumn : introspectedTable.getAllColumns()) {
|
||||
XmlElement selectNotNullElement = new XmlElement("if"); //$NON-NLS-1$
|
||||
sb.setLength(0);
|
||||
sb.append("null != ");
|
||||
sb.append(introspectedColumn.getJavaProperty());
|
||||
selectNotNullElement.addAttribute(new Attribute("test", sb.toString()));
|
||||
sb.setLength(0);
|
||||
// 添加and
|
||||
sb.append(" and ");
|
||||
// 添加别名t
|
||||
sb.append("t.");
|
||||
sb.append(MyBatis3FormattingUtilities.getEscapedColumnName(introspectedColumn));
|
||||
// 添加等号
|
||||
sb.append(" = ");
|
||||
sb.append("#{"+ introspectedColumn.getJavaProperty() +"}");
|
||||
selectNotNullElement.addElement(new TextElement(sb.toString()));
|
||||
selectTrimElement.addElement(selectNotNullElement);
|
||||
}
|
||||
|
||||
//sql.addElement(selectTrimElement);
|
||||
parentElement.addElement(sql);
|
||||
|
||||
// 公用include
|
||||
XmlElement include = new XmlElement("include");
|
||||
include.addAttribute(new Attribute("refid", "dynamicQuery"));*/
|
||||
|
||||
}
|
||||
|
||||
private String getTableName() {
|
||||
String tableName = introspectedTable.getTableConfiguration().getTableName();
|
||||
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
|
||||
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
|
||||
//企业库
|
||||
return tableName.substring(0, tableName.lastIndexOf("_")) + "_${enterpriseId}";
|
||||
}
|
||||
//平台库
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 对数据库中的tinyint->byte 处理为 tinyint->integer
|
||||
* @param field
|
||||
* @param topLevelClass
|
||||
* @param introspectedColumn
|
||||
* @param introspectedTable
|
||||
* @param modelClassType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean modelFieldGenerated(Field field,
|
||||
TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn,
|
||||
IntrospectedTable introspectedTable,
|
||||
ModelClassType modelClassType){
|
||||
int jdbcType = introspectedColumn.getJdbcType();
|
||||
if(jdbcType == Types.TINYINT){
|
||||
field.setType(new FullyQualifiedJavaType(Integer.class.getName()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
jdbc.driver = com.mysql.cj.jdbc.Driver
|
||||
jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_base?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
jdbc.user= coolstore
|
||||
jdbc.password = CSCErYcXniNYm7bT
|
||||
|
||||
table.name = sys_role_menu_e88b6a2bc1334164b54977a4dbfe5d9d
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE generatorConfiguration
|
||||
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
|
||||
<generatorConfiguration>
|
||||
<properties resource="mybatis-generator.properties" />
|
||||
<context id="Mysql" targetRuntime="generator.defined.MyIntrospectedTableMyBatis3Impl" defaultModelType="flat">
|
||||
<plugin type="generator.defined.MyPluginAdapter" >
|
||||
<property name="hasLombok" value="true"/>
|
||||
<property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
|
||||
</plugin>
|
||||
<commentGenerator type="generator.defined.MyCommentGenerator">
|
||||
<property name="suppressAllComments" value="true" />
|
||||
<property name="author" value="zhangchenbiao"/>
|
||||
</commentGenerator>
|
||||
|
||||
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="${jdbc.url}" userId="${jdbc.user}" password="${jdbc.password}">
|
||||
<property name="nullCatalogMeansCurrent" value="true" />
|
||||
</jdbcConnection>
|
||||
|
||||
<!-- targetProject:生成PO类的位置 -->
|
||||
<javaModelGenerator targetPackage="com.cool.store.model.entity" targetProject="coolstore-partner-model/src/main/java">
|
||||
<property name="enableSubPackages" value="true"/>
|
||||
</javaModelGenerator>
|
||||
|
||||
<!-- targetProject:mapperXML映射文件生成的位置 -->
|
||||
<sqlMapGenerator targetPackage="mapper" targetProject="coolstore-partner-dao/src/main/resources" />
|
||||
|
||||
<!-- targetPackage:mapper接口生成的位置 -->
|
||||
<javaClientGenerator targetPackage="com.cool.store.mapper" targetProject="coolstore-partner-dao/src/main/java" type="XMLMAPPER" />
|
||||
|
||||
<table tableName="${table.name}" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
|
||||
enableSelectByExample="false" selectByExampleQueryId="false">
|
||||
<generatedKey column="id" sqlStatement="Mysql" identity="true" type=""/>
|
||||
</table>
|
||||
</context>
|
||||
</generatorConfiguration>
|
||||
15
coolstore-partner-manage.iml
Normal file
15
coolstore-partner-manage.iml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
52
coolstore-partner-model/coolstore-partner-model.iml
Normal file
52
coolstore-partner-model/coolstore-partner-model.iml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
30
coolstore-partner-model/pom.xml
Normal file
30
coolstore-partner-model/pom.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-model</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.cool.store.model.dto;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: DatasourceInfoDTO
|
||||
* @Description:
|
||||
* @date 2023-05-18 14:28
|
||||
*/
|
||||
@Data
|
||||
public class DatasourceInfoDTO {
|
||||
|
||||
/**
|
||||
* serverurl
|
||||
*/
|
||||
private String dbServer;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
private Integer dbPort;
|
||||
|
||||
/**
|
||||
* 数据库用户
|
||||
*/
|
||||
private String dbUser;
|
||||
|
||||
/**
|
||||
* 数据库密码
|
||||
*/
|
||||
private String dbPwd;
|
||||
|
||||
|
||||
public static List<DatasourceInfoDTO> convertList(List<EnterpriseConfigDO> configList){
|
||||
if (CollectionUtils.isEmpty(configList)) {
|
||||
return null;
|
||||
}
|
||||
List<DatasourceInfoDTO> resultList = new ArrayList<>();
|
||||
for (EnterpriseConfigDO enterpriseConfig : configList) {
|
||||
DatasourceInfoDTO datasource = new DatasourceInfoDTO();
|
||||
datasource.setDbServer(enterpriseConfig.getDbServer());
|
||||
datasource.setDbPort(enterpriseConfig.getDbPort());
|
||||
datasource.setDbUser(enterpriseConfig.getDbUser());
|
||||
datasource.setDbPwd(enterpriseConfig.getDbPwd());
|
||||
resultList.add(datasource);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-18 11:09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EnterpriseConfigDO implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 当前套餐
|
||||
*/
|
||||
private Long currentPackage;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private String enterpriseId;
|
||||
|
||||
/**
|
||||
* 员工人数
|
||||
*/
|
||||
private Integer staffCount;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String dbSourceName;
|
||||
|
||||
/**
|
||||
* 数据库服务器
|
||||
*/
|
||||
private String dbServer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer dbPort;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String dbName;
|
||||
|
||||
/**
|
||||
* 数据库用户
|
||||
*/
|
||||
private String dbUser;
|
||||
|
||||
/**
|
||||
* 数据库密码
|
||||
*/
|
||||
private String dbPwd;
|
||||
|
||||
/**
|
||||
* 授权私钥
|
||||
*/
|
||||
private String license;
|
||||
|
||||
/**
|
||||
* 授权到期
|
||||
*/
|
||||
private Date licenseExpires;
|
||||
|
||||
/**
|
||||
* 授权类型
|
||||
*/
|
||||
private Integer licenseType;
|
||||
|
||||
/**
|
||||
* 钉钉业务id
|
||||
*/
|
||||
private String dingCorpId;
|
||||
|
||||
/**
|
||||
* 钉钉秘钥
|
||||
*/
|
||||
private String dingCorpSecret;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 主应用Id
|
||||
*/
|
||||
private String mainCorpId;
|
||||
|
||||
/**
|
||||
* 来源类型:默认dingding钉钉,qw企业微信 mobile
|
||||
*/
|
||||
private String appType;
|
||||
|
||||
/**
|
||||
* 授权码
|
||||
*/
|
||||
private String permanentCode;
|
||||
|
||||
/**
|
||||
* 应用id
|
||||
*/
|
||||
private String agentid;
|
||||
|
||||
/**
|
||||
* 开通酷学院企业映射的企业id
|
||||
*/
|
||||
private String coolCollegeEnterpriseId;
|
||||
|
||||
/**
|
||||
* 开通酷学院企业返回的企业秘钥
|
||||
*/
|
||||
private String coolCollegeSecret;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:58
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EnterpriseUserDO implements Serializable {
|
||||
@ApiModelProperty("用户主键id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("钉钉用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("分机号")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String workPlace;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("手机号码")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("员工的电子邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("员工的企业邮箱")
|
||||
private String orgEmail;
|
||||
|
||||
@ApiModelProperty("是否已经激活, true表示已激活, false表示未激活")
|
||||
private Boolean active;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String orderInDepts;
|
||||
|
||||
@ApiModelProperty("是否是主管理员,0:否,1:是")
|
||||
private Integer mainAdmin;
|
||||
|
||||
@ApiModelProperty("是否为企业的管理员, true表示是, false表示不是")
|
||||
private Boolean isAdmin;
|
||||
|
||||
@ApiModelProperty("是否为企业的老板, true表示是, false表示不是")
|
||||
private Boolean isBoss;
|
||||
|
||||
@ApiModelProperty("钉钉Id,在钉钉全局范围内标识用户的身份,但用户可以自行修改一次")
|
||||
private String dingid;
|
||||
|
||||
@ApiModelProperty("在当前isv全局范围内唯一标识一个用户的身份,用户无法修改")
|
||||
private String unionid;
|
||||
|
||||
@ApiModelProperty("是否号码隐藏, true表示隐藏, false表示不隐藏")
|
||||
private Boolean isHide;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty("头像url")
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty("扩展属性,可以设置多种属性(但手机上最多只能显示10个扩展属性,具体显示哪些属性,请到OA管理后台->设置->通讯录信息设置和OA管理后台->设置->手机端显示信息设置)性")
|
||||
private String extattr;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Boolean isEnterprise;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String roles;
|
||||
|
||||
@ApiModelProperty("是否是部门的主管, true表示是, false表示不是")
|
||||
private Boolean isLeader;
|
||||
|
||||
@ApiModelProperty("人脸照片url")
|
||||
private String faceUrl;
|
||||
|
||||
@ApiModelProperty("用户创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("用户语言环境:en_us/英语_美国,zh_cn/中文_简体,zh_hk/中文_繁体_HK")
|
||||
private String language;
|
||||
|
||||
@ApiModelProperty("用户状态 0待审核 1正常 2冻结")
|
||||
private Integer userStatus;
|
||||
|
||||
@ApiModelProperty("第三方OA系统唯一标识")
|
||||
private String thirdOaUniqueFlag;
|
||||
|
||||
@ApiModelProperty("下级是否变动,0 没变动,1 变动")
|
||||
private Integer subordinateChange;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("管辖用户范围:self-仅自己,all-全部人员,define-自定义")
|
||||
private String subordinateRange;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String isLeaderInDepts;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String department;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String jobnumber;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String monitoredDepartments;
|
||||
|
||||
@ApiModelProperty("部门全路径")
|
||||
private String departments;
|
||||
|
||||
@ApiModelProperty("部门集合(region_ids)")
|
||||
private String userRegionIds;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EnterpriseUserRoleDO implements Serializable {
|
||||
@ApiModelProperty("主键id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty("用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RegionDO implements Serializable {
|
||||
@ApiModelProperty("自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("区域ID")
|
||||
private String regionId;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("父区域id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("阿里云分组id")
|
||||
private String groupId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Long updateTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty("vds分组id")
|
||||
private String vdsGroupCorpId;
|
||||
|
||||
@ApiModelProperty("dinging部门id")
|
||||
private String synDingDeptId;
|
||||
|
||||
@ApiModelProperty("区域类型 root 根目录 path 区域 store 门店")
|
||||
private String regionType;
|
||||
|
||||
@ApiModelProperty("区域路径")
|
||||
private String regionPath;
|
||||
|
||||
@ApiModelProperty("删除标记")
|
||||
private Boolean deleted;
|
||||
|
||||
@ApiModelProperty("门店数量")
|
||||
private Integer storeNum;
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
private String storeId;
|
||||
|
||||
@ApiModelProperty("未分组标志 0 分组 1 未分组")
|
||||
private Integer unclassifiedFlag;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer orderNum;
|
||||
|
||||
@ApiModelProperty("第三方唯一id")
|
||||
private String thirdDeptId;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysDepartmentDO implements Serializable {
|
||||
@ApiModelProperty("主键id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("parent_id")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty("在父部门中的次序值")
|
||||
private Integer departOrder;
|
||||
|
||||
@ApiModelProperty("是否同步创建一个关联此部门的企业群, true表示是, false表示不是")
|
||||
private Boolean createDeptGroup;
|
||||
|
||||
@ApiModelProperty("当群已经创建后,是否有新人加入部门会自动加入该群, true表示是, false表示不是")
|
||||
private Boolean autoAddUser;
|
||||
|
||||
@ApiModelProperty("是否隐藏部门, true表示隐藏, false表示显示")
|
||||
private Boolean depHiding;
|
||||
|
||||
@ApiModelProperty("可以查看指定隐藏部门的其他部门列表,如果部门隐藏,则此值生效,取值为其他的部门id组成的的字符串,使用|符号进行分割")
|
||||
private String deptPerimits;
|
||||
|
||||
@ApiModelProperty("可以查看指定隐藏部门的其他人员列表,如果部门隐藏,则此值生效,取值为其他的人员userid组成的的字符串,使用|符号进行分割")
|
||||
private String userPerimits;
|
||||
|
||||
@ApiModelProperty("是否本部门的员工仅可见员工自己, 为true时,本部门员工默认只能看到员工自己")
|
||||
private Boolean outerDept;
|
||||
|
||||
@ApiModelProperty("本部门的员工仅可见员工自己为true时,可以配置额外可见部门,值为部门id组成的的字符串,使用|符号进行分割")
|
||||
private String outerPermitDepts;
|
||||
|
||||
@ApiModelProperty("本部门的员工仅可见员工自己为true时,可以配置额外可见人员,值为userid组成的的字符串,使用| 符号进行分割")
|
||||
private String outerPermitUsers;
|
||||
|
||||
@ApiModelProperty("企业群群主")
|
||||
private String orgDeptOwner;
|
||||
|
||||
@ApiModelProperty("部门的主管列表,取值为由主管的userid组成的字符串,不同的userid使用|符号进行分割")
|
||||
private String deptManagerUseridList;
|
||||
|
||||
@ApiModelProperty("部门下总人数(包括子部门)")
|
||||
private Integer userCount;
|
||||
|
||||
@ApiModelProperty("部门下未激活总人数(包括子部门)")
|
||||
private Integer unactiveUserCount;
|
||||
|
||||
@ApiModelProperty("部门所有父级部门id, 不包括自己, 以/分隔")
|
||||
private String parentIds;
|
||||
|
||||
@ApiModelProperty("部门所有子部门id,以英文逗号分隔")
|
||||
private String subIds;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleDO implements Serializable {
|
||||
@ApiModelProperty("自增id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty("是否预制")
|
||||
private Boolean isInternal;
|
||||
|
||||
@ApiModelProperty("角色权限范围all(全企业数据)include_subordinate(所在组织架构包含下级) not_include_subordinate(所在的组织架构不包含下级) personal (仅自己的数据) ")
|
||||
private String roleAuth;
|
||||
|
||||
@ApiModelProperty("岗位来源:(create:自建岗位, sync:从钉钉同步的角色,sync_position从钉钉同步的职位, ehr 从第三方ehr同步的)")
|
||||
private String source;
|
||||
|
||||
@ApiModelProperty("职位类型:store_outside-店外,store_inside-店内")
|
||||
private String positionType;
|
||||
|
||||
@ApiModelProperty("移动端菜单")
|
||||
private String appMenu;
|
||||
|
||||
@ApiModelProperty("钉钉角色id")
|
||||
private Long synDingRoleId;
|
||||
|
||||
@ApiModelProperty("角色排序 1.管理员 1-99.门店职位 100+.钉钉角色")
|
||||
private Integer priority;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("角色枚举用于判定逻辑")
|
||||
private String roleEnum;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createUser;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateUser;
|
||||
|
||||
@ApiModelProperty("第三方唯一id")
|
||||
private String thirdUniqueId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:01
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRoleMenuDO implements Serializable {
|
||||
@ApiModelProperty("自增id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("菜单id")
|
||||
private Long menuId;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
private Long roleId;
|
||||
|
||||
@ApiModelProperty("菜单类型")
|
||||
private String platform;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserAuthMappingDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("映射主键(区域或者是门店)")
|
||||
private String mappingId;
|
||||
|
||||
@ApiModelProperty("映射类型 region (区域) store(门店)")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("来源:create-数智门店创建 sync-钉钉同步")
|
||||
private String source;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateId;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Long updateTime;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.model.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserRegionMappingDO implements Serializable {
|
||||
@ApiModelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("映射主键(区域或者是门店)")
|
||||
private String regionId;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateId;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Long updateTime;
|
||||
}
|
||||
81
coolstore-partner-service/coolstore-partner-service.iml
Normal file
81
coolstore-partner-service/coolstore-partner-service.iml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-model" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
34
coolstore-partner-service/pom.xml
Normal file
34
coolstore-partner-service/pom.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-service</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-dao</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-model</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface EnterpriseConfigService {
|
||||
|
||||
EnterpriseConfigDO selectByEnterpriseId(String enterpriseId);
|
||||
|
||||
/**
|
||||
* 根据dbName获取dbServer
|
||||
* @param dbName
|
||||
* @return
|
||||
*/
|
||||
EnterpriseConfigDO getDbInfoByDbName(String dbName);
|
||||
|
||||
/**
|
||||
* 获取dbServer
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseConfigDO> getDistinctDbServer();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.cool.store.service.config.redis;
|
||||
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
import redis.clients.jedis.JedisPoolConfig;
|
||||
import redis.clients.jedis.JedisShardInfo;
|
||||
import redis.clients.jedis.ShardedJedisPool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName RedisUtilConfig
|
||||
* @Description 用一句话描述什么
|
||||
*/
|
||||
@Component
|
||||
public class RedisUtilConfig {
|
||||
|
||||
@Value("${redis.host.uri}")
|
||||
private String REDIS_HOST_URI;
|
||||
|
||||
@Bean
|
||||
public RedisUtilPool redisUtilPool() {
|
||||
|
||||
RedisUtilPool redisUtil = new RedisUtilPool();
|
||||
|
||||
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
|
||||
jedisPoolConfig.setMaxTotal(1024);
|
||||
jedisPoolConfig.setMaxIdle(200);
|
||||
jedisPoolConfig.setMaxWaitMillis(1000);
|
||||
jedisPoolConfig.setTestOnBorrow(false);
|
||||
|
||||
List<JedisShardInfo> shards = new ArrayList<>();
|
||||
JedisShardInfo jedisShardInfo = new JedisShardInfo(REDIS_HOST_URI);
|
||||
shards.add(jedisShardInfo);
|
||||
redisUtil.setShardedJedisPool(new ShardedJedisPool(jedisPoolConfig, shards));
|
||||
return redisUtil;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.service.context;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class CurrentUser {
|
||||
|
||||
private String userId;
|
||||
|
||||
private String enterpriseId;
|
||||
|
||||
private String dingCorpId;
|
||||
|
||||
private String appType;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 员工角色
|
||||
*/
|
||||
private String roleIds;
|
||||
|
||||
private String dbName;
|
||||
|
||||
/**
|
||||
* 钉钉管理员和数智门店无关
|
||||
*/
|
||||
private Boolean isAdmin;
|
||||
|
||||
/**
|
||||
* 角色权限
|
||||
*/
|
||||
private String roleAuth;
|
||||
|
||||
private String mainCorpId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.service.context;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DataSourceContext {
|
||||
|
||||
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
|
||||
|
||||
private static List<String> dataSourceIds = new ArrayList<>();
|
||||
|
||||
public static void setDataSourceType(String dataSourceType) {
|
||||
CONTEXT_HOLDER.set(dataSourceType);
|
||||
}
|
||||
|
||||
public static String getDataSourceType() {
|
||||
return CONTEXT_HOLDER.get();
|
||||
}
|
||||
|
||||
public static void clearDataSourceType() {
|
||||
CONTEXT_HOLDER.remove();
|
||||
}
|
||||
|
||||
public static boolean containsDataSource(String dsId) {
|
||||
return dataSourceIds.contains(dsId);
|
||||
}
|
||||
|
||||
public static void setDataSourceIds(List<String> dids){
|
||||
dataSourceIds = dids;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.service.context;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class UserContext {
|
||||
|
||||
private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();
|
||||
|
||||
public static CurrentUser getUser() {
|
||||
String userStr = contextHolder.get();
|
||||
if (StringUtils.isNotBlank(userStr)) {
|
||||
return JSON.parseObject(userStr, CurrentUser.class);
|
||||
}
|
||||
return new CurrentUser();
|
||||
}
|
||||
|
||||
public static void setUser(String user) {
|
||||
contextHolder.set(user);
|
||||
}
|
||||
|
||||
public static void removeUser(){
|
||||
contextHolder.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.EnterpriseConfigDAO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName EnterpriseConfigServiceImpl
|
||||
* @Description 用一句话描述什么
|
||||
*/
|
||||
@Service(value = "enterpriseConfigService")
|
||||
@Slf4j
|
||||
public class EnterpriseConfigServiceImpl implements EnterpriseConfigService {
|
||||
|
||||
@Resource
|
||||
private EnterpriseConfigDAO enterpriseConfigDAO;
|
||||
|
||||
@Override
|
||||
public EnterpriseConfigDO selectByEnterpriseId(String enterpriseId) {
|
||||
return enterpriseConfigDAO.selectByEnterpriseId(enterpriseId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnterpriseConfigDO getDbInfoByDbName(String dbName) {
|
||||
return enterpriseConfigDAO.getDbInfoByDbName(dbName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EnterpriseConfigDO> getDistinctDbServer() {
|
||||
return enterpriseConfigDAO.getDistinctDbServer();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.cool.store.service.utils;
|
||||
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.cool.store.service.context.UserContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Slf4j
|
||||
public class DataSourceHelper {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataSourceHelper.class);
|
||||
|
||||
/**
|
||||
* @param
|
||||
* @return void
|
||||
* @throws
|
||||
* @Title changeToMy
|
||||
* @Description 切换到自己的数据库
|
||||
*/
|
||||
public static void changeToMy() {
|
||||
DataSourceContext.clearDataSourceType();
|
||||
String dbName = UserContext.getUser().getDbName();
|
||||
DataSourceContext.setDataSourceType(dbName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param datasource
|
||||
* @return void
|
||||
* @throws
|
||||
* @Title changeToSpecificDataSource
|
||||
* @Description 切换到指定的数据库
|
||||
*/
|
||||
public static void changeToSpecificDataSource(String datasource) {
|
||||
DataSourceContext.clearDataSourceType();
|
||||
String dbName = datasource;
|
||||
DataSourceContext.setDataSourceType(dbName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param
|
||||
* @return void
|
||||
* @throws
|
||||
* @Title reset
|
||||
* @Description 重置链接到主库
|
||||
*/
|
||||
public static void reset() {
|
||||
DataSourceContext.clearDataSourceType();
|
||||
}
|
||||
}
|
||||
95
coolstore-partner-webb/coolstore-partner-webb.iml
Normal file
95
coolstore-partner-webb/coolstore-partner-webb.iml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-service" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-model" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
96
coolstore-partner-webb/pom.xml
Normal file
96
coolstore-partner-webb/pom.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-webb</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-service</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profileActive>dev</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>local</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<profileActive>local</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>ab</id>
|
||||
<properties>
|
||||
<profileActive>ab</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>online</id>
|
||||
<properties>
|
||||
<profileActive>online</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>hd</id>
|
||||
<properties>
|
||||
<profileActive>hd</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profileActive>pre</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.cool.store;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PartnerCWebApplication
|
||||
* @Description: C端web层
|
||||
* @date 2023-05-17 11:28
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.cool.store.mapper")
|
||||
@EnableAsync
|
||||
@EnableCaching
|
||||
@ServletComponentScan
|
||||
public class PartnerBWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PartnerBWebApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties("default.datasource")
|
||||
public DataSourceProperties defaultDataSourceProperties() {
|
||||
return new DataSourceProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.hikari")
|
||||
public DataSource defaultDataSource() {
|
||||
DataSource defaultDataSource = defaultDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||
return defaultDataSource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonBeanConfig
|
||||
* @Description:
|
||||
* @date 2022-01-25 18:41
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CommonBeanConfig {
|
||||
|
||||
@Autowired
|
||||
private DynamicDataSourceServiceImpl dynamicDataSourceServiceImpl;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void loadDataSource(){
|
||||
List<DatasourceInfoDTO> dbServerList = dynamicDataSourceServiceImpl.getDbNodes();
|
||||
if (CollectionUtils.isEmpty(dbServerList)) {
|
||||
return;
|
||||
}
|
||||
dbServerList.forEach(node -> {
|
||||
dynamicDataSourceServiceImpl.createDataSource(node);
|
||||
});
|
||||
log.info("数据源加载完毕:{}", JSONObject.toJSONString(dbServerList));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.jdbc.datasource.AbstractDataSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
@Primary
|
||||
@Component
|
||||
public class DynamicDataSource extends AbstractDataSource {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DynamicDataSource.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource defaultDataSource;
|
||||
|
||||
@Autowired
|
||||
private DynamicDataSourceServiceImpl dynamicDataSourceService;
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
String currentDbName = getCurrentDbName();
|
||||
if(CommonConstants.DEFAULT_DB.equals(currentDbName)){
|
||||
Connection connection = defaultDataSource.getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
Connection connection = this.determineTargetDataSource().getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
String currentDbName = getCurrentDbName();
|
||||
if(CommonConstants.DEFAULT_DB.equals(currentDbName)){
|
||||
Connection connection = defaultDataSource.getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
Connection connection = this.determineTargetDataSource().getConnection(username, password);
|
||||
connection.setCatalog(getCurrentDbName());
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||
return iface.isInstance(this) ? (T) this : this.determineTargetDataSource().unwrap(iface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
||||
return iface.isInstance(this) || this.determineTargetDataSource().isWrapperFor(iface);
|
||||
}
|
||||
|
||||
|
||||
protected DataSource determineTargetDataSource() {
|
||||
DataSource dataSource = null;
|
||||
Map<String, DataSource> resolvedDataSources = dynamicDataSourceService.getResolvedDataSources();
|
||||
if (resolvedDataSources != null) {
|
||||
String lookupKey = getDbServerByDbName();
|
||||
if (StringUtils.isNotBlank(lookupKey)) {
|
||||
dataSource = resolvedDataSources.get(lookupKey);
|
||||
}
|
||||
}
|
||||
if (dataSource == null) {
|
||||
dataSource = defaultDataSource;
|
||||
}
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过dbName获取dbServer
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String getDbServerByDbName() {
|
||||
String dbName = getCurrentDbName();
|
||||
return dynamicDataSourceService.getDbServerByDbName(dbName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前线程上下文对应的库名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String getCurrentDbName() {
|
||||
String dbName = DataSourceContext.getDataSourceType();
|
||||
if (StringUtils.isBlank(dbName)) {
|
||||
dbName = CommonConstants.DEFAULT_DB;
|
||||
}
|
||||
return dbName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @ClassName DynamicDataSourceServiceImpl
|
||||
* @Description 用一句话描述什么
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DynamicDataSourceServiceImpl {
|
||||
|
||||
private static int defaultMaxPoolSize = 150;
|
||||
|
||||
private static String dbUrl = "jdbc:mysql://{0}:{1}/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true";
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
@Autowired
|
||||
private MyHikariConfig myHikariConfig;
|
||||
|
||||
@Autowired
|
||||
private EnterpriseConfigService enterpriseConfigService;
|
||||
|
||||
/**
|
||||
* 数据库实例和数据源的映射
|
||||
*/
|
||||
private ConcurrentHashMap<String, DataSource> resolvedDataSources = new ConcurrentHashMap();
|
||||
|
||||
/**
|
||||
* dbName 和 serverUrl的映射
|
||||
*/
|
||||
private ConcurrentHashMap<String, String> dbNameUrlServerMap = new ConcurrentHashMap();
|
||||
|
||||
/**
|
||||
* 查询所有的企业数据库实例节点配置信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<DatasourceInfoDTO> getDbNodes() {
|
||||
List<EnterpriseConfigDO> configList = enterpriseConfigService.getDistinctDbServer();
|
||||
return DatasourceInfoDTO.convertList(configList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据dbName查询dbServer
|
||||
*
|
||||
* @param dbName
|
||||
* @return
|
||||
*/
|
||||
public String getDbServerByDbName(String dbName) {
|
||||
if(CommonConstants.DEFAULT_DB.equals(dbName)){
|
||||
return null;
|
||||
}
|
||||
String dbServerUrl = dbNameUrlServerMap.get(dbName);
|
||||
if(StringUtils.isBlank(dbServerUrl)){
|
||||
Page<Object> localPage = PageHelper.getLocalPage();
|
||||
if(Objects.nonNull(localPage)){
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
String currentDbName = DataSourceContext.getDataSourceType();
|
||||
EnterpriseConfigDO config = enterpriseConfigService.getDbInfoByDbName(dbName);
|
||||
dbServerUrl = config.getDbServer();
|
||||
if(StringUtils.isNotBlank(currentDbName)){
|
||||
DataSourceContext.setDataSourceType(currentDbName);
|
||||
}
|
||||
if(Objects.nonNull(localPage)){
|
||||
//上下文中的东西及时还回去
|
||||
PageHelper.startPage(localPage.getPageNum(), localPage.getPageSize());
|
||||
}
|
||||
dbNameUrlServerMap.put(dbName, dbServerUrl);
|
||||
}
|
||||
return dbServerUrl;
|
||||
}
|
||||
|
||||
public void createDataSource(DatasourceInfoDTO datasource) {
|
||||
DataSource dataSource = buildDataSourceByConfig(datasource);
|
||||
if (dataSource != null) {
|
||||
this.resolvedDataSources.putIfAbsent(datasource.getDbServer(), dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, DataSource> getResolvedDataSources() {
|
||||
return resolvedDataSources;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* build datasource
|
||||
* @param dbServerUrl
|
||||
* @return
|
||||
*/
|
||||
private DataSource buildDataSourceByConfig(DatasourceInfoDTO datasource) {
|
||||
HikariConfig hikariConfig = new HikariConfig();
|
||||
String url = MessageFormat.format(dbUrl, datasource.getDbServer(), String.valueOf(datasource.getDbPort()));
|
||||
hikariConfig.setDriverClassName(myHikariConfig.getDriverClassName());
|
||||
hikariConfig.setMinimumIdle(myHikariConfig.getMinimumIdle());
|
||||
hikariConfig.setMaximumPoolSize(myHikariConfig.getMaximumPoolSize());
|
||||
hikariConfig.setMaxLifetime(myHikariConfig.getMaxLifetime());
|
||||
hikariConfig.setConnectionTimeout(myHikariConfig.getConnectionTimeout());
|
||||
hikariConfig.setIdleTimeout(myHikariConfig.getIdleTimeout());
|
||||
hikariConfig.setJdbcUrl(url);
|
||||
hikariConfig.setUsername(datasource.getDbUser());
|
||||
hikariConfig.setPassword(datasource.getDbPwd());
|
||||
hikariConfig.setMaximumPoolSize(defaultMaxPoolSize);
|
||||
String poolName = "HikariCP_" + datasource.getDbServer();
|
||||
hikariConfig.setPoolName(poolName);
|
||||
HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);
|
||||
log.info("{} dataSource is {}, maxPoolSize={}", poolName, hikariDataSource, hikariDataSource.getMaximumPoolSize());
|
||||
return hikariDataSource;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties("spring.datasource.hikari")
|
||||
public class MyHikariConfig extends HikariConfig {
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://tzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,41 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
#default.datasource.url=jdbc:mysql://dstore-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
#default.datasource.url=jdbc:mysql://127.0.0.1:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
#default.datasource.username=root
|
||||
#default.datasource.password=root
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://dzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.7.53.199:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,44 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
#default.datasource.url=jdbc:mysql://dstore-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
#default.datasource.url=jdbc:mysql://127.0.0.1:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
#default.datasource.username=root
|
||||
#default.datasource.password=root
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
#subtable size
|
||||
customize_sub_table_size=10
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://localhost:2181
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.6.49.221:2188,10.6.49.222:2188,10.6.49.223:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.7.54.149:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://tzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=31010
|
||||
@@ -0,0 +1,52 @@
|
||||
spring.application.name=coolstore-partner-webb
|
||||
spring.profiles.active=@profileActive@
|
||||
|
||||
server.port=31000
|
||||
server.servlet.context-path=/partner
|
||||
|
||||
#logback
|
||||
logging.config=classpath:logback-spring.xml
|
||||
logging.path=/data/log/partner
|
||||
|
||||
#connection pool config
|
||||
spring.datasource.hikari.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.hikari.cachePrepStmts=true
|
||||
spring.datasource.hikari.prepStmtCacheSize=250
|
||||
spring.datasource.hikari.prepStmtCacheSqlLimit=2048
|
||||
spring.datasource.hikari.useServerPrepStmts=true
|
||||
spring.datasource.hikari.useLocalSessionState=true
|
||||
spring.datasource.hikari.rewriteBatchedStatements=true
|
||||
spring.datasource.hikari.cacheResultSetMetadata=true
|
||||
spring.datasource.hikari.cacheServerConfiguration=true
|
||||
spring.datasource.hikari.elideSetAutoCommits=true
|
||||
spring.datasource.hikari.maintainTimeStats=false
|
||||
spring.datasource.hikari.minimumIdle=10
|
||||
spring.datasource.hikari.maximumPoolSize=150
|
||||
spring.datasource.hikari.maxLifetime=200000
|
||||
spring.datasource.hikari.connectionTimeout=3000
|
||||
spring.datasource.hikari.poolName=DefaultHikariCP
|
||||
spring.datasource.hikari.idleTimeout=300000
|
||||
#\u914D\u7F6E\u8FD4\u56DE\u65F6\u95F4\u6233
|
||||
spring.jackson.serialization.write-dates-as-timestamps=true
|
||||
# file size
|
||||
spring.servlet.multipart.maxFileSize=1024MB
|
||||
spring.servlet.multipart.maxRequestSize=1024MB
|
||||
# Max file size.
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
# Max request size.
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
spring.main.allow-circular-references=true
|
||||
|
||||
allow.upload.image.ext=jpg,jpeg,gif,png,bmp,jfif
|
||||
allow.upload.file.ext=zip,mp4,pptx,ppt,doc,docx,pdf
|
||||
allow.upload.video.ext=3gp,asf,avi,dat,dv,flv,f4v,gif,m2t,m3u8,m4v,mj2,mjpeg,mkv,mov,mp4,mpe,mpg,mpeg,mts,ogg,qt,rm,rmvb,swf,ts,vob,wmv,webm
|
||||
allow.upload.audio.ext=mp3
|
||||
allow.upload.image.size=1024 * 1024L * 1024L
|
||||
allow.upload.file.size=30 * 1024 * 1024L
|
||||
allow.upload.video.size=1024 * 1024 * 10L
|
||||
allow.upload.audio.size=1024 * 1024 * 10L
|
||||
|
||||
server.connection-timeout=18000000
|
||||
server.tomcat.basedir=/tmp/tomcat/partner-b
|
||||
|
||||
log4j2.formatMsgNoLookups=true
|
||||
58
coolstore-partner-webb/src/main/resources/logback-spring.xml
Normal file
58
coolstore-partner-webb/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--scan:配置文件如果发生改变,将会被重新加载,scanPeriod:设置监测配置文件是否有修改的时间间隔 -->
|
||||
<configuration scan="true" scanPeriod="60 seconds">
|
||||
<!--应用的名称 -->
|
||||
<property name="APPNAME" value="partner-web-b" />
|
||||
<!--应用的端口号 -->
|
||||
<property name="PORT" value="31000" />
|
||||
<!--日志文件本地存放目录路径-->
|
||||
<property name="logBaseFolder" value="/data/log/partner" />
|
||||
<!--日志文件名称的前缀部分 -->
|
||||
<property name="logFileNamePrefix" value="${APPNAME}-${PORT}" />
|
||||
<!--日志文件最小切割单位 -->
|
||||
<property name="every_file_size" value="300MB" />
|
||||
<!--日志文件保存时间 -->
|
||||
<property name="every_his_size" value="5" />
|
||||
<!--用来指定日志文件的上限大小,删除旧的日志 -->
|
||||
<property name="every_max_size" value="20GB" />
|
||||
<!-- 日志文件的编码 -->
|
||||
<property name="log_charset" value="UTF-8" />
|
||||
<!--|日志时间|线程id|端口号|应用名称|类名|方法名|日志级别|traceId |输入参数|输出参数|耗时|任意多个扩展字段|具体打印的msg内容然后换行-->
|
||||
<property name="log_pattern" value="|%d{yyyy-MM-dd HH:mm:ss.SSS}|%t|${APPNAME}|[%X{requestId}]|[%X{messageId}]%logger|%M|%p|%m%n"/>
|
||||
|
||||
<!-- 输出到控制台 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 核心系统日志输出到文件,基于日志大小和时间归档 -->
|
||||
<appender name="rollingFile"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">>
|
||||
<fileNamePattern>${logBaseFolder}/${logFileNamePrefix}.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>${every_his_size}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="com.cool.store.mapper" level="DEBUG" additivity="true" />
|
||||
<!--灰度、线上、预防 不输出到console-->
|
||||
<springProfile name="hd,online,pre">
|
||||
<root level="info">
|
||||
<appender-ref ref="rollingFile"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="ab,dev,test,local">
|
||||
<root level="info">
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
||||
95
coolstore-partner-webc/coolstore-partner-webc.iml
Normal file
95
coolstore-partner-webc/coolstore-partner-webc.iml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-service" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-model" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
101
coolstore-partner-webc/pom.xml
Normal file
101
coolstore-partner-webc/pom.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<parent>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>coolstore-partner-webc</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-service</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<profileActive>dev</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>local</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<profileActive>local</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>ab</id>
|
||||
<properties>
|
||||
<profileActive>ab</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>online</id>
|
||||
<properties>
|
||||
<profileActive>online</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>hd</id>
|
||||
<properties>
|
||||
<profileActive>hd</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>pre</id>
|
||||
<properties>
|
||||
<profileActive>pre</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: PartnerBWebApplication
|
||||
* @Description: B端web层
|
||||
* @date 2023-05-17 11:28
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.cool.store.mapper")
|
||||
@EnableAsync
|
||||
@EnableCaching
|
||||
@ServletComponentScan
|
||||
public class PartnerCWebApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PartnerCWebApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties("default.datasource")
|
||||
public DataSourceProperties defaultDataSourceProperties() {
|
||||
return new DataSourceProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConfigurationProperties("spring.datasource.hikari")
|
||||
public DataSource defaultDataSource() {
|
||||
DataSource defaultDataSource = defaultDataSourceProperties().initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||
return defaultDataSource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonBeanConfig
|
||||
* @Description:
|
||||
* @date 2022-01-25 18:41
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CommonBeanConfig {
|
||||
|
||||
@Autowired
|
||||
private DynamicDataSourceServiceImpl dynamicDataSourceServiceImpl;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void loadDataSource(){
|
||||
List<DatasourceInfoDTO> dbServerList = dynamicDataSourceServiceImpl.getDbNodes();
|
||||
if (CollectionUtils.isEmpty(dbServerList)) {
|
||||
return;
|
||||
}
|
||||
dbServerList.forEach(node -> {
|
||||
dynamicDataSourceServiceImpl.createDataSource(node);
|
||||
});
|
||||
log.info("数据源加载完毕:{}", JSONObject.toJSONString(dbServerList));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.jdbc.datasource.AbstractDataSource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
@Primary
|
||||
@Component
|
||||
public class DynamicDataSource extends AbstractDataSource {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DynamicDataSource.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource defaultDataSource;
|
||||
|
||||
@Autowired
|
||||
private DynamicDataSourceServiceImpl dynamicDataSourceService;
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
String currentDbName = getCurrentDbName();
|
||||
if(CommonConstants.DEFAULT_DB.equals(currentDbName)){
|
||||
Connection connection = defaultDataSource.getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
Connection connection = this.determineTargetDataSource().getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
String currentDbName = getCurrentDbName();
|
||||
if(CommonConstants.DEFAULT_DB.equals(currentDbName)){
|
||||
Connection connection = defaultDataSource.getConnection();
|
||||
connection.setCatalog(currentDbName);
|
||||
return connection;
|
||||
}
|
||||
Connection connection = this.determineTargetDataSource().getConnection(username, password);
|
||||
connection.setCatalog(getCurrentDbName());
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||
return iface.isInstance(this) ? (T) this : this.determineTargetDataSource().unwrap(iface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
||||
return iface.isInstance(this) || this.determineTargetDataSource().isWrapperFor(iface);
|
||||
}
|
||||
|
||||
|
||||
protected DataSource determineTargetDataSource() {
|
||||
DataSource dataSource = null;
|
||||
Map<String, DataSource> resolvedDataSources = dynamicDataSourceService.getResolvedDataSources();
|
||||
if (resolvedDataSources != null) {
|
||||
String lookupKey = getDbServerByDbName();
|
||||
if (StringUtils.isNotBlank(lookupKey)) {
|
||||
dataSource = resolvedDataSources.get(lookupKey);
|
||||
}
|
||||
}
|
||||
if (dataSource == null) {
|
||||
dataSource = defaultDataSource;
|
||||
}
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过dbName获取dbServer
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String getDbServerByDbName() {
|
||||
String dbName = getCurrentDbName();
|
||||
return dynamicDataSourceService.getDbServerByDbName(dbName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前线程上下文对应的库名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String getCurrentDbName() {
|
||||
String dbName = DataSourceContext.getDataSourceType();
|
||||
if (StringUtils.isBlank(dbName)) {
|
||||
dbName = CommonConstants.DEFAULT_DB;
|
||||
}
|
||||
return dbName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @ClassName DynamicDataSourceServiceImpl
|
||||
* @Description 用一句话描述什么
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DynamicDataSourceServiceImpl {
|
||||
|
||||
private static int defaultMaxPoolSize = 150;
|
||||
|
||||
private static String dbUrl = "jdbc:mysql://{0}:{1}/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true";
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
@Autowired
|
||||
private MyHikariConfig myHikariConfig;
|
||||
|
||||
@Autowired
|
||||
private EnterpriseConfigService enterpriseConfigService;
|
||||
|
||||
/**
|
||||
* 数据库实例和数据源的映射
|
||||
*/
|
||||
private ConcurrentHashMap<String, DataSource> resolvedDataSources = new ConcurrentHashMap();
|
||||
|
||||
/**
|
||||
* dbName 和 serverUrl的映射
|
||||
*/
|
||||
private ConcurrentHashMap<String, String> dbNameUrlServerMap = new ConcurrentHashMap();
|
||||
|
||||
/**
|
||||
* 查询所有的企业数据库实例节点配置信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<DatasourceInfoDTO> getDbNodes() {
|
||||
List<EnterpriseConfigDO> configList = enterpriseConfigService.getDistinctDbServer();
|
||||
return DatasourceInfoDTO.convertList(configList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据dbName查询dbServer
|
||||
*
|
||||
* @param dbName
|
||||
* @return
|
||||
*/
|
||||
public String getDbServerByDbName(String dbName) {
|
||||
if(CommonConstants.DEFAULT_DB.equals(dbName)){
|
||||
return null;
|
||||
}
|
||||
String dbServerUrl = dbNameUrlServerMap.get(dbName);
|
||||
if(StringUtils.isBlank(dbServerUrl)){
|
||||
Page<Object> localPage = PageHelper.getLocalPage();
|
||||
if(Objects.nonNull(localPage)){
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
String currentDbName = DataSourceContext.getDataSourceType();
|
||||
EnterpriseConfigDO config = enterpriseConfigService.getDbInfoByDbName(dbName);
|
||||
dbServerUrl = config.getDbServer();
|
||||
if(StringUtils.isNotBlank(currentDbName)){
|
||||
DataSourceContext.setDataSourceType(currentDbName);
|
||||
}
|
||||
if(Objects.nonNull(localPage)){
|
||||
//上下文中的东西及时还回去
|
||||
PageHelper.startPage(localPage.getPageNum(), localPage.getPageSize());
|
||||
}
|
||||
dbNameUrlServerMap.put(dbName, dbServerUrl);
|
||||
}
|
||||
return dbServerUrl;
|
||||
}
|
||||
|
||||
public void createDataSource(DatasourceInfoDTO datasource) {
|
||||
DataSource dataSource = buildDataSourceByConfig(datasource);
|
||||
if (dataSource != null) {
|
||||
this.resolvedDataSources.putIfAbsent(datasource.getDbServer(), dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, DataSource> getResolvedDataSources() {
|
||||
return resolvedDataSources;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* build datasource
|
||||
* @param dbServerUrl
|
||||
* @return
|
||||
*/
|
||||
private DataSource buildDataSourceByConfig(DatasourceInfoDTO datasource) {
|
||||
HikariConfig hikariConfig = new HikariConfig();
|
||||
String url = MessageFormat.format(dbUrl, datasource.getDbServer(), String.valueOf(datasource.getDbPort()));
|
||||
hikariConfig.setDriverClassName(myHikariConfig.getDriverClassName());
|
||||
hikariConfig.setMinimumIdle(myHikariConfig.getMinimumIdle());
|
||||
hikariConfig.setMaximumPoolSize(myHikariConfig.getMaximumPoolSize());
|
||||
hikariConfig.setMaxLifetime(myHikariConfig.getMaxLifetime());
|
||||
hikariConfig.setConnectionTimeout(myHikariConfig.getConnectionTimeout());
|
||||
hikariConfig.setIdleTimeout(myHikariConfig.getIdleTimeout());
|
||||
hikariConfig.setJdbcUrl(url);
|
||||
hikariConfig.setUsername(datasource.getDbUser());
|
||||
hikariConfig.setPassword(datasource.getDbPwd());
|
||||
hikariConfig.setMaximumPoolSize(defaultMaxPoolSize);
|
||||
String poolName = "HikariCP_" + datasource.getDbServer();
|
||||
hikariConfig.setPoolName(poolName);
|
||||
HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);
|
||||
log.info("{} dataSource is {}, maxPoolSize={}", poolName, hikariDataSource, hikariDataSource.getMaximumPoolSize());
|
||||
return hikariDataSource;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties("spring.datasource.hikari")
|
||||
public class MyHikariConfig extends HikariConfig {
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://tzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,41 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
#default.datasource.url=jdbc:mysql://dstore-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
#default.datasource.url=jdbc:mysql://127.0.0.1:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
#default.datasource.username=root
|
||||
#default.datasource.password=root
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://dzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.7.53.199:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,44 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||
#default.datasource.url=jdbc:mysql://dstore-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
#default.datasource.url=jdbc:mysql://127.0.0.1:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
#default.datasource.username=root
|
||||
#default.datasource.password=root
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
#subtable size
|
||||
customize_sub_table_size=10
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://localhost:2181
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.6.49.221:2188,10.6.49.222:2188,10.6.49.223:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://store-coolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=store-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@store-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://10.7.54.149:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,37 @@
|
||||
#mysql config
|
||||
default.datasource.url=jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_config?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
default.datasource.username=coolstore
|
||||
default.datasource.password=CSCErYcXniNYm7bT
|
||||
|
||||
#redis
|
||||
spring.redis.host=tstore-coolcollege.redis.rds.aliyuncs.com
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=Cx111111
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=2000ms
|
||||
spring.redis.lettuce.pool.max-wait=100ms
|
||||
spring.redis.lettuce.pool.max-active=1024
|
||||
spring.redis.lettuce.pool.max-idle=200
|
||||
spring.redis.lettuce.pool.min-idle=0
|
||||
spring.redis.lettuce.shutdown-timeout=100ms
|
||||
redis.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/0
|
||||
redis.isv.host.uri=http://userInfo:Cx111111@tstore-coolcollege.redis.rds.aliyuncs.com:6379/2
|
||||
|
||||
#pagehelper
|
||||
pagehelper.helper-dialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
pagehelper.returnPageInfo=check
|
||||
pagehelper.support-methods-arguments=false
|
||||
pagehelper.params=count=countSql
|
||||
pagehelper.page-size-zero=true
|
||||
|
||||
spring.mvc.async.request-timeout=60000
|
||||
|
||||
# mybatis config
|
||||
mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
|
||||
|
||||
mybatis.configuration.call-setters-on-nulls=true
|
||||
mybatis.configuration.map-underscore-to-camel-case=true
|
||||
|
||||
com.alipay.sofa.rpc.registry.address=zookeeper://tzk.coolcollege.cn:2188
|
||||
com.alipay.sofa.rpc.bolt.port=30910
|
||||
@@ -0,0 +1,52 @@
|
||||
spring.application.name=coolstore-partner-webc
|
||||
spring.profiles.active=@profileActive@
|
||||
|
||||
server.port=30900
|
||||
server.servlet.context-path=/partner
|
||||
|
||||
#logback
|
||||
logging.config=classpath:logback-spring.xml
|
||||
logging.path=/data/log/partner
|
||||
|
||||
#connection pool config
|
||||
spring.datasource.hikari.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.hikari.cachePrepStmts=true
|
||||
spring.datasource.hikari.prepStmtCacheSize=250
|
||||
spring.datasource.hikari.prepStmtCacheSqlLimit=2048
|
||||
spring.datasource.hikari.useServerPrepStmts=true
|
||||
spring.datasource.hikari.useLocalSessionState=true
|
||||
spring.datasource.hikari.rewriteBatchedStatements=true
|
||||
spring.datasource.hikari.cacheResultSetMetadata=true
|
||||
spring.datasource.hikari.cacheServerConfiguration=true
|
||||
spring.datasource.hikari.elideSetAutoCommits=true
|
||||
spring.datasource.hikari.maintainTimeStats=false
|
||||
spring.datasource.hikari.minimumIdle=10
|
||||
spring.datasource.hikari.maximumPoolSize=150
|
||||
spring.datasource.hikari.maxLifetime=200000
|
||||
spring.datasource.hikari.connectionTimeout=3000
|
||||
spring.datasource.hikari.poolName=DefaultHikariCP
|
||||
spring.datasource.hikari.idleTimeout=300000
|
||||
#\u914D\u7F6E\u8FD4\u56DE\u65F6\u95F4\u6233
|
||||
spring.jackson.serialization.write-dates-as-timestamps=true
|
||||
# file size
|
||||
spring.servlet.multipart.maxFileSize=1024MB
|
||||
spring.servlet.multipart.maxRequestSize=1024MB
|
||||
# Max file size.
|
||||
spring.servlet.multipart.max-file-size=1024MB
|
||||
# Max request size.
|
||||
spring.servlet.multipart.max-request-size=1024MB
|
||||
spring.main.allow-circular-references=true
|
||||
|
||||
allow.upload.image.ext=jpg,jpeg,gif,png,bmp,jfif
|
||||
allow.upload.file.ext=zip,mp4,pptx,ppt,doc,docx,pdf
|
||||
allow.upload.video.ext=3gp,asf,avi,dat,dv,flv,f4v,gif,m2t,m3u8,m4v,mj2,mjpeg,mkv,mov,mp4,mpe,mpg,mpeg,mts,ogg,qt,rm,rmvb,swf,ts,vob,wmv,webm
|
||||
allow.upload.audio.ext=mp3
|
||||
allow.upload.image.size=1024 * 1024L * 1024L
|
||||
allow.upload.file.size=30 * 1024 * 1024L
|
||||
allow.upload.video.size=1024 * 1024 * 10L
|
||||
allow.upload.audio.size=1024 * 1024 * 10L
|
||||
|
||||
server.connection-timeout=18000000
|
||||
server.tomcat.basedir=/tmp/tomcat/partner-c
|
||||
|
||||
log4j2.formatMsgNoLookups=true
|
||||
58
coolstore-partner-webc/src/main/resources/logback-spring.xml
Normal file
58
coolstore-partner-webc/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--scan:配置文件如果发生改变,将会被重新加载,scanPeriod:设置监测配置文件是否有修改的时间间隔 -->
|
||||
<configuration scan="true" scanPeriod="60 seconds">
|
||||
<!--应用的名称 -->
|
||||
<property name="APPNAME" value="partner-web-c" />
|
||||
<!--应用的端口号 -->
|
||||
<property name="PORT" value="30900" />
|
||||
<!--日志文件本地存放目录路径-->
|
||||
<property name="logBaseFolder" value="/data/log/partner" />
|
||||
<!--日志文件名称的前缀部分 -->
|
||||
<property name="logFileNamePrefix" value="${APPNAME}-${PORT}" />
|
||||
<!--日志文件最小切割单位 -->
|
||||
<property name="every_file_size" value="300MB" />
|
||||
<!--日志文件保存时间 -->
|
||||
<property name="every_his_size" value="5" />
|
||||
<!--用来指定日志文件的上限大小,删除旧的日志 -->
|
||||
<property name="every_max_size" value="20GB" />
|
||||
<!-- 日志文件的编码 -->
|
||||
<property name="log_charset" value="UTF-8" />
|
||||
<!--|日志时间|线程id|端口号|应用名称|类名|方法名|日志级别|traceId |输入参数|输出参数|耗时|任意多个扩展字段|具体打印的msg内容然后换行-->
|
||||
<property name="log_pattern" value="|%d{yyyy-MM-dd HH:mm:ss.SSS}|%t|${APPNAME}|[%X{requestId}]|[%X{messageId}]%logger|%M|%p|%m%n"/>
|
||||
|
||||
<!-- 输出到控制台 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!-- 核心系统日志输出到文件,基于日志大小和时间归档 -->
|
||||
<appender name="rollingFile"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">>
|
||||
<fileNamePattern>${logBaseFolder}/${logFileNamePrefix}.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>${every_his_size}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log_pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="com.cool.store.mapper" level="DEBUG" additivity="true" />
|
||||
<!--灰度、线上、预防 不输出到console-->
|
||||
<springProfile name="hd,online,pre">
|
||||
<root level="info">
|
||||
<appender-ref ref="rollingFile"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="ab,dev,test,local">
|
||||
<root level="info">
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
||||
192
pom.xml
Normal file
192
pom.xml
Normal file
@@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-manage</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0.0</version>
|
||||
<modules>
|
||||
<module>coolstore-partner-webb</module>
|
||||
<module>coolstore-partner-common</module>
|
||||
<module>coolstore-partner-webc</module>
|
||||
<module>coolstore-partner-dao</module>
|
||||
<module>coolstore-partner-model</module>
|
||||
<module>coolstore-partner-service</module>
|
||||
</modules>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.11</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-webc</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-webb</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-service</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-model</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-partner-dao</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.60</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.5.0.1254</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sonar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>prepare-agent-integration</id>
|
||||
<goals>
|
||||
<goal>prepare-agent-integration</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>jacoco-site</id>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>collcollege</name>
|
||||
<url>http://nexus.coolcollege.cn/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>nexus</id>
|
||||
<name>collcollege</name>
|
||||
<url>http://nexus.coolcollege.cn/repository/maven-public/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>nexus</id>
|
||||
<name>nexus snapshot</name>
|
||||
<url>http://nexus.coolcollege.cn/repository/maven-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>nexus release</name>
|
||||
<url>http://nexus.coolcollege.cn/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user