Browse Source

Merge remote-tracking branch 'origin/dev_issue_project' into dev_issue_project

master
wangchao 5 years ago
parent
commit
63b91256b4
  1. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ValidateException.java
  3. 74
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java
  4. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/CustomerClientShowGroup.java
  5. 10
      epmet-gateway/pom.xml
  6. 18
      epmet-gateway/src/main/resources/bootstrap.yml
  7. 2
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml
  8. 2
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml
  9. 2
      epmet-module/gov-issue/gov-issue-server/pom.xml
  10. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml
  11. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml
  12. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  13. 1
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml
  14. 41
      epmet-module/gov-voice/gov-voice-client/pom.xml
  15. 11
      epmet-module/gov-voice/gov-voice-server/Dockerfile
  16. 17
      epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml
  17. 17
      epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml
  18. 143
      epmet-module/gov-voice/gov-voice-server/pom.xml
  19. 20
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java
  20. 26
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  21. 95
      epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml
  22. 164
      epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml
  23. 20
      epmet-module/gov-voice/pom.xml
  24. 2
      epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml
  25. 2
      epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml
  26. 4
      epmet-module/pom.xml
  27. 2
      epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml
  28. 2
      epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml
  29. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml
  30. 20
      epmet-module/resi-voice/pom.xml
  31. 41
      epmet-module/resi-voice/resi-voice-client/pom.xml
  32. 11
      epmet-module/resi-voice/resi-voice-server/Dockerfile
  33. 17
      epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml
  34. 17
      epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml
  35. 131
      epmet-module/resi-voice/resi-voice-server/pom.xml
  36. 20
      epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/ResiVoiceApplication.java
  37. 26
      epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  38. 67
      epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml
  39. 164
      epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml
  40. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  41. 2
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml
  42. 2
      epmet-user/epmet-user-server/pom.xml
  43. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -19,7 +19,7 @@ public enum EpmetErrorCode {
ERR10007(10007, "当前帐号已在别处登录"),
ERR10019(10019, "验证码不正确"),
ERR401(401, "未授权"),
VALIDATE_ERROR(7000, "数据校验异常"),
INTERNAL_VALIDATE_ERROR(7000, "内部数据校验异常"),
SERVER_ERROR(8000, "服务器开小差了..."),
CANNOT_JOIN_GROUP(8001, "只有注册居民才可以加入小组"),
CANNOT_CREATE_GROUP(8002, "只有党员和热心居民才能创建小组,请选择您的身份"),
@ -63,7 +63,9 @@ public enum EpmetErrorCode {
OPER_ADD_CUSTOMER_ERROR(8705, "新增客户失败"),
OPER_ADD_CUSTOMER_MANAGER_ERROR(8706, "新增客户管理员失败"),
OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"),
OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误");
OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"),
CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常");
private int code;
private String msg;

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ValidateException.java

@ -59,13 +59,13 @@ public class ValidateException extends RuntimeException {
public ValidateException(String msg) {
super(msg);
this.code = EpmetErrorCode.VALIDATE_ERROR.getCode();
this.code = EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode();
this.msg = msg;
}
public ValidateException(String msg, Throwable e) {
super(msg, e);
this.code = EpmetErrorCode.VALIDATE_ERROR.getCode();
this.code = EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode();
this.msg = msg;
}

74
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java

@ -1,25 +1,26 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* <p>
* https://www.renren.io
*
* <p>
* 版权所有侵权必究
*/
package com.epmet.commons.tools.validator;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.beanvalidation.MessageSourceResourceBundleLocator;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import java.util.Locale;
import java.util.Set;
import java.util.*;
/**
* hibernate-validator校验工具类
@ -39,20 +40,67 @@ public class ValidatorUtils {
/**
* 校验对象
* @param object 待校验对象
* @param groups 待校验的组
* @throws ValidateException 校验不通过则报RenException异常
*
* @param object 待校验对象
* @param groups 待校验的组
* @throws ValidateException 校验不通过则报RenException异常
*/
public static void validateEntity(Object object, Class<?>... groups)
throws ValidateException {
List<Class<?>> customerShowGroups = new ArrayList<>();
List<Class<?>> internalGroups = new ArrayList<>();
Arrays.asList(groups).forEach(g -> {
if (CustomerClientShowGroup.class.isAssignableFrom(g)) {
//如果派生自客户端显示分组,那么会优先校验,并且将错误提示给客户端,返回客户端可见的错误码
customerShowGroups.add(g);
} else {
internalGroups.add(g);
}
});
// 1.校验客户端显示分组
if (!CollectionUtils.isEmpty(customerShowGroups)) {
validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR ,object, customerShowGroups.toArray(new Class<?>[customerShowGroups.size()]));
}
// 2.内部校验分组
if (!CollectionUtils.isEmpty(internalGroups)) {
validate(EpmetErrorCode.INTERNAL_VALIDATE_ERROR, object, internalGroups.toArray(new Class<?>[internalGroups.size()]));
}
}
private static Validator getValidator() {
Locale.setDefault(LocaleContextHolder.getLocale());
Validator validator = Validation.byDefaultProvider().configure().messageInterpolator(
new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(getMessageSource())))
.buildValidatorFactory().getValidator();
return Validation
.byDefaultProvider()
.configure()
.messageInterpolator(new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(getMessageSource())))
.buildValidatorFactory()
.getValidator();
}
/**
* 真正的校验方法
* @param object
* @param errorCode
* @param groups
*/
private static void validate(EpmetErrorCode errorCode, Object object, Class<?>... groups) {
Validator validator = getValidator();
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups);
if (!constraintViolations.isEmpty()) {
ConstraintViolation<Object> constraint = constraintViolations.iterator().next();
throw new ValidateException(constraint.getMessage());
StringBuilder sb = new StringBuilder();
Iterator<ConstraintViolation<Object>> it = constraintViolations.iterator();
while (it.hasNext()) {
ConstraintViolation<Object> constraint = it.next();
sb.append(constraint.getMessage()).append(",");
}
int lastDouhaoIndex = sb.lastIndexOf(",");
sb.replace(lastDouhaoIndex, lastDouhaoIndex + 1, "");
throw new ValidateException(errorCode.getCode(),sb.toString());
}
}
}

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/group/CustomerClientShowGroup.java

@ -0,0 +1,8 @@
package com.epmet.commons.tools.validator.group;
/**
* 客户终端显示错误信息的校验分组该分组下的错误会被提示到客户端界面显示
* 其他具体接口中的校验分组接口应当继承自该接口
*/
public interface CustomerClientShowGroup {
}

10
epmet-gateway/pom.xml

@ -169,6 +169,12 @@
<!-- 25、党建园地 -->
<gateway.routes.resi-home-server.uri>lb://resi-home-server</gateway.routes.resi-home-server.uri>
<!-- <gateway.routes.resi-home-server.uri>http://localhost:8104</gateway.routes.resi-home-server.uri>-->
<!-- 26、政府端-党建声音 -->
<gateway.routes.gov-voice-server.uri>lb://gov-voice-server</gateway.routes.gov-voice-server.uri>
<!-- <gateway.routes.gov-voice-server.uri>http://localhost:8104</gateway.routes.gov-voice-server.uri>-->
<!-- 27、居民端-党建声音 -->
<gateway.routes.resi-voice-server.uri>lb://resi-voice-server</gateway.routes.resi-voice-server.uri>
<!-- <gateway.routes.resi-voice-server.uri>http://localhost:8104</gateway.routes.resi-voice-server.uri>-->
</properties>
</profile>
<profile>
@ -241,6 +247,10 @@
<gateway.routes.common-service-server.uri>lb://common-service-server</gateway.routes.common-service-server.uri>
<!-- 25、党建园地 -->
<gateway.routes.resi-home-server.uri>lb://resi-home-server</gateway.routes.resi-home-server.uri>
<!-- 26、政府端-党建声音 -->
<gateway.routes.gov-voice-server.uri>lb://gov-voice-server</gateway.routes.gov-voice-server.uri>
<!-- 27、居民端-党建声音 -->
<gateway.routes.resi-voice-server.uri>lb://resi-voice-server</gateway.routes.resi-voice-server.uri>
</properties>
</profile>
</profiles>

18
epmet-gateway/src/main/resources/bootstrap.yml

@ -241,6 +241,24 @@ spring:
filters:
- StripPrefix=1
- CpAuth=true
#政府端-党建声音
- id: gov-voice-server
uri: @gateway.routes.gov-voice-server.uri@
order: 26
predicates:
- Path=${server.servlet.context-path}/gov/voice/**
filters:
- StripPrefix=1
- CpAuth=true
#居民端-党建声音
- id: resi-voice-server
uri: @gateway.routes.resi-voice-server.uri@
order: 27
predicates:
- Path=${server.servlet.context-path}/resi/voice/**
filters:
- StripPrefix=1
- CpAuth=true
nacos:
discovery:
server-addr: @nacos.server-addr@

2
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-issue-server:
container_name: gov-issue-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.39
image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.40
ports:
- "8101:8101"
network_mode: host # 使用现有网络

2
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-issue-server:
container_name: gov-issue-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.36
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.40
ports:
- "8101:8101"
network_mode: host # 使用现有网络

2
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -2,7 +2,7 @@
<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">
<version>0.3.39</version>
<version>0.3.40</version>
<parent>
<artifactId>gov-issue</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.22
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.23
ports:
- "8102:8102"
network_mode: host # 使用现有网络

2
epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.21
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.23
ports:
- "8102:8102"
network_mode: host # 使用现有网络

2
epmet-module/gov-project/gov-project-server/pom.xml

@ -2,7 +2,7 @@
<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">
<version>0.3.22</version>
<version>0.3.23</version>
<parent>
<artifactId>gov-project</artifactId>
<groupId>com.epmet</groupId>

1
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml

@ -43,6 +43,7 @@
project_process
WHERE
project_id = #{projectId}
AND public_reply != "" AND public_reply is not null
AND del_flag = 0
ORDER BY created_time DESC
</select>

41
epmet-module/gov-voice/gov-voice-client/pom.xml

@ -0,0 +1,41 @@
<?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>gov-voice</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gov-voice-client</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

11
epmet-module/gov-voice/gov-voice-server/Dockerfile

@ -0,0 +1,11 @@
FROM java:8
RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./app.jar
EXPOSE 8102
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"]

17
epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
gov-project-server:
container_name: gov-voice-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.1
ports:
- "8105:8105"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

17
epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
gov-project-server:
container_name: gov-voice-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.1
ports:
- "8105:8105"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 400M

143
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -0,0 +1,143 @@
<?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>
<version>0.3.1</version>
<parent>
<artifactId>gov-voice</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<artifactId>gov-voice-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-voice-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-mybatis</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8105</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet_voice_user</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
<profile>
<id>test</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8104</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>EpmEtrEdIs!q@w</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.10.150:8848</nacos.server-addr>
<nacos.discovery.namespace>67e3c350-533e-4d7c-9f8f-faf1b4aa82ae</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
</profiles>
</project>

20
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java

@ -0,0 +1,20 @@
package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class GovVoiceApplication {
public static void main(String[] args) {
SpringApplication.run(GovVoiceApplication.class, args);
}
}

26
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java

@ -0,0 +1,26 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.config;
import com.epmet.commons.tools.config.ModuleConfig;
import org.springframework.stereotype.Service;
/**
* 模块配置信息
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Service
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "govvoice";
}
}

95
epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml

@ -0,0 +1,95 @@
server:
port: @server.port@
servlet:
context-path: /gov/voice
spring:
main:
allow-bean-definition-overriding: true
application:
name: gov-voice-server
#环境 dev|test|prod
profiles:
active: dev
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
database: @spring.redis.index@
host: @spring.redis.host@
port: @spring.redis.port@
password: @spring.redis.password@
timeout: 30s
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: @spring.datasource.druid.url@
username: @spring.datasource.druid.username@
password: @spring.datasource.druid.password@
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
#nacos的命名空间ID,默认是public
namespace: @nacos.discovery.namespace@
#不把自己注册到注册中心的地址
register-enabled: @nacos.register-enabled@
ip: @nacos.ip@
config:
enabled: @nacos.config-enabled@
server-addr: @nacos.server-addr@
namespace: @nacos.config.namespace@
group: @nacos.config.group@
file-extension: yaml
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.epmet.entity
global-config:
#数据库相关配置
db-config:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type: ID_WORKER
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
field-strategy: NOT_NULL
#驼峰下划线转换
column-underline: true
banner: false
#原生配置
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
feign:
hystrix:
enabled: true
client:
config:
default:
loggerLevel: BASIC
httpclient:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000

164
epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/gov-voice"/>
<springProperty scope="context" name="appname" source="spring.application.name"/>
<!-- 日志上下文名称 -->
<contextName>${appname}</contextName>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

20
epmet-module/gov-voice/pom.xml

@ -0,0 +1,20 @@
<?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>epmet-module</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gov-voice</artifactId>
<packaging>pom</packaging>
<modules>
<module>gov-voice-client</module>
<module>gov-voice-server</module>
</modules>
</project>

2
epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-crm-server:
container_name: oper-crm-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.20
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.21
ports:
- "8090:8090"
network_mode: host # 使用现有网络

2
epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-customize-server:
container_name: oper-customize-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.17
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.20
ports:
- "8089:8089"
network_mode: host # 使用现有网络

4
epmet-module/pom.xml

@ -35,6 +35,8 @@
<module>gov-project</module>
<module>epmet-common-service</module>
<module>resi-home</module>
</modules>
<module>gov-voice</module>
<module>resi-voice</module>
</modules>
</project>

2
epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-group-server:
container_name: resi-group-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.45
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.50
ports:
- "8095:8095"
network_mode: host # 使用现有网络

2
epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-guide-server:
container_name: resi-guide-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.12
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.13
ports:
- "8091:8091"
network_mode: host # 使用现有网络

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-partymember-server:
container_name: resi-partymember-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.38
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.42
ports:
- "8096:8096"
network_mode: host # 使用现有网络

20
epmet-module/resi-voice/pom.xml

@ -0,0 +1,20 @@
<?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>epmet-module</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resi-voice</artifactId>
<packaging>pom</packaging>
<modules>
<module>resi-voice-client</module>
<module>resi-voice-server</module>
</modules>
</project>

41
epmet-module/resi-voice/resi-voice-client/pom.xml

@ -0,0 +1,41 @@
<?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>resi-voice</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>resi-voice-client</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

11
epmet-module/resi-voice/resi-voice-server/Dockerfile

@ -0,0 +1,11 @@
FROM java:8
RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./app.jar
EXPOSE 8102
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"]

17
epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
gov-project-server:
container_name: resi-voice-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-voice-server:0.3.1
ports:
- "8106:8106"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

17
epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
gov-project-server:
container_name: resi-voice-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-voice-server:0.3.1
ports:
- "8106:8106"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 400M

131
epmet-module/resi-voice/resi-voice-server/pom.xml

@ -0,0 +1,131 @@
<?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>
<version>0.3.1</version>
<parent>
<artifactId>resi-voice</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<artifactId>resi-voice-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-voice-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8106</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
<profile>
<id>test</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8104</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>EpmEtrEdIs!q@w</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.10.150:8848</nacos.server-addr>
<nacos.discovery.namespace>67e3c350-533e-4d7c-9f8f-faf1b4aa82ae</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
</profiles>
</project>

20
epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/ResiVoiceApplication.java

@ -0,0 +1,20 @@
package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ResiVoiceApplication {
public static void main(String[] args) {
SpringApplication.run(ResiVoiceApplication.class, args);
}
}

26
epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java

@ -0,0 +1,26 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.config;
import com.epmet.commons.tools.config.ModuleConfig;
import org.springframework.stereotype.Service;
/**
* 模块配置信息
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Service
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "resivoice";
}
}

67
epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml

@ -0,0 +1,67 @@
server:
port: @server.port@
servlet:
context-path: /resi/voice
spring:
main:
allow-bean-definition-overriding: true
application:
name: resi-voice-server
#环境 dev|test|prod
profiles:
active: dev
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
database: @spring.redis.index@
host: @spring.redis.host@
port: @spring.redis.port@
password: @spring.redis.password@
timeout: 30s
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
#nacos的命名空间ID,默认是public
namespace: @nacos.discovery.namespace@
#不把自己注册到注册中心的地址
register-enabled: @nacos.register-enabled@
ip: @nacos.ip@
config:
enabled: @nacos.config-enabled@
server-addr: @nacos.server-addr@
namespace: @nacos.config.namespace@
group: @nacos.config.group@
file-extension: yaml
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
feign:
hystrix:
enabled: true
client:
config:
default:
loggerLevel: BASIC
httpclient:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000

164
epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/resi-voice"/>
<springProperty scope="context" name="appname" source="spring.application.name"/>
<!-- 日志上下文名称 -->
<contextName>${appname}</contextName>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.52
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.53
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.51
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.53
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<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>
<version>0.3.52</version>
<version>0.3.53</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

@ -28,7 +28,7 @@
<if test='null != province and "" != province '>
PROVINCE = #{province},
</if>
<if test='null != sex and "" != sex '>
<if test='null != sex'>
SEX = #{sex},
</if>
UPDATED_BY = #{updatedBy},

Loading…
Cancel
Save