Compare commits
2 Commits
master
...
feature/in
Author | SHA1 | Date |
---|---|---|
|
d85f6af915 | 4 years ago |
|
b9e49b7f30 | 4 years ago |
42 changed files with 600 additions and 48 deletions
@ -1 +1 @@ |
|||||
Subproject commit 80264ec0f84a8692e3d23254710bf6f987f126a9 |
Subproject commit 8988e6551401ce573c21834f842f0f68ddbd98b2 |
@ -1 +1 @@ |
|||||
Subproject commit 5b077ffda98e46ce47e9c5540dabbc50f092968d |
Subproject commit 60b469fb3d9fccb7220f65c3ddbaa412033ecc01 |
@ -0,0 +1,20 @@ |
|||||
|
# 基础镜像 |
||||
|
FROM openjdk:8u242-jdk-buster |
||||
|
# 作者 |
||||
|
MAINTAINER rongchao@elink-cn.com |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_FILE的值 |
||||
|
ARG JAR_FILE |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_NAME的值 |
||||
|
ARG JAR_NAME |
||||
|
# 对应pom.xml文件中的dockerfile-maven-plugin插件SERVER_PORT的值 |
||||
|
ARG SERVER_PORT |
||||
|
# 复制打包完成后的jar文件到/opt目录下 |
||||
|
ENV JAR_PATH /mnt/epdc/${JAR_NAME}.jar |
||||
|
ADD ${JAR_FILE} $JAR_PATH |
||||
|
# /data设为环境变量 |
||||
|
ENV DATAPATH /data |
||||
|
# 挂载/data目录到主机 |
||||
|
VOLUME $DATAPATH |
||||
|
# 启动容器时执行 |
||||
|
ENTRYPOINT java -jar $JAR_CONFIG $JAR_PATH |
||||
|
EXPOSE ${SERVER_PORT} |
@ -0,0 +1,31 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc; |
||||
|
|
||||
|
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.1.0 |
||||
|
*/ |
||||
|
@SpringBootApplication |
||||
|
@EnableDiscoveryClient |
||||
|
@EnableFeignClients |
||||
|
public class VimApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(VimApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.config; |
||||
|
|
||||
|
import com.elink.esua.epdc.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 "vim"; |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.elink.esua.epdc.config; |
||||
|
|
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.core.task.TaskExecutor; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
||||
|
|
||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||
|
|
||||
|
/** |
||||
|
* 线程池 |
||||
|
* |
||||
|
* @author rongchao |
||||
|
* @Date 18-11-27 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
@EnableAsync |
||||
|
public class ThreadConfig { |
||||
|
|
||||
|
@Bean |
||||
|
public TaskExecutor taskExecutor() { |
||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
||||
|
// 设置核心线程数
|
||||
|
executor.setCorePoolSize(5); |
||||
|
// 设置最大线程数
|
||||
|
executor.setMaxPoolSize(10); |
||||
|
// 设置队列容量
|
||||
|
executor.setQueueCapacity(20); |
||||
|
// 设置线程活跃时间(秒)
|
||||
|
executor.setKeepAliveSeconds(60); |
||||
|
// 设置默认线程名称
|
||||
|
executor.setThreadNamePrefix("esd-"); |
||||
|
// 设置拒绝策略
|
||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
||||
|
// 等待所有任务结束后再关闭线程池
|
||||
|
executor.setWaitForTasksToCompleteOnShutdown(true); |
||||
|
executor.setAwaitTerminationSeconds(60); |
||||
|
executor.initialize(); |
||||
|
return executor; |
||||
|
} |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
spring: |
||||
|
redis: |
||||
|
database: @spring.redis.index@ |
||||
|
host: @spring.redis.host@ |
||||
|
timeout: 30s |
||||
|
port: @spring.redis.port@ |
||||
|
password: @spring.redis.password@ |
||||
|
datasource: |
||||
|
druid: |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/yushan_esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
||||
|
username: yushan_epdc_test |
||||
|
password: elink-epdc@yushan |
||||
|
#Oracle |
||||
|
# driver-class-name: oracle.jdbc.OracleDriver |
||||
|
# url: jdbc:oracle:thin:@localhost:1521:xe |
||||
|
# username: renren_cloud |
||||
|
# password: 123456 |
||||
|
#SQLServer |
||||
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
||||
|
# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_cloud |
||||
|
# username: sa |
||||
|
# password: 123456 |
||||
|
#postgresql |
||||
|
# driver-class-name: org.postgresql.Driver |
||||
|
# url: jdbc:postgresql://localhost:5432/renren_cloud |
||||
|
# username: postgres |
||||
|
# password: 123456 |
||||
|
initial-size: 10 |
||||
|
max-active: 100 |
||||
|
min-idle: 10 |
||||
|
max-wait: 60000 |
||||
|
pool-prepared-statements: true |
||||
|
max-pool-prepared-statement-per-connection-size: 20 |
||||
|
time-between-eviction-runs-millis: 60000 |
||||
|
min-evictable-idle-time-millis: 300000 |
||||
|
#Oracle需要打开注释 |
||||
|
#validation-query: SELECT 1 FROM DUAL |
||||
|
test-while-idle: true |
||||
|
test-on-borrow: false |
||||
|
test-on-return: false |
||||
|
|
||||
|
|
||||
|
##多数据源的配置,需要引用renren-commons-dynamic-datasource |
||||
|
#dynamic: |
||||
|
# datasource: |
||||
|
# slave1: |
||||
|
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
||||
|
# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_cloud |
||||
|
# username: sa |
||||
|
# password: 123456 |
||||
|
# slave2: |
||||
|
# driver-class-name: org.postgresql.Driver |
||||
|
# url: jdbc:postgresql://localhost:5432/renren_cloud |
||||
|
# username: postgres |
||||
|
# password: 123456 |
@ -0,0 +1,36 @@ |
|||||
|
spring: |
||||
|
redis: |
||||
|
database: @spring.redis.index@ |
||||
|
host: @spring.redis.host@ |
||||
|
timeout: 30s |
||||
|
port: @spring.redis.port@ |
||||
|
password: @spring.redis.password@ |
||||
|
datasource: |
||||
|
druid: |
||||
|
driver-class-name: com.mysql.jdbc.Driver |
||||
|
url: @spring.datasource.druid.url@ |
||||
|
username: @spring.datasource.druid.username@ |
||||
|
password: @spring.datasource.druid.password@ |
||||
|
initial-size: 10 |
||||
|
max-active: 100 |
||||
|
min-idle: 10 |
||||
|
max-wait: 60000 |
||||
|
pool-prepared-statements: true |
||||
|
max-pool-prepared-statement-per-connection-size: 20 |
||||
|
time-between-eviction-runs-millis: 60000 |
||||
|
min-evictable-idle-time-millis: 300000 |
||||
|
#Oracle需要打开注释 |
||||
|
#validation-query: SELECT 1 FROM DUAL |
||||
|
test-while-idle: true |
||||
|
test-on-borrow: false |
||||
|
test-on-return: false |
||||
|
stat-view-servlet: |
||||
|
enabled: true |
||||
|
url-pattern: /druid/* |
||||
|
#login-username: admin |
||||
|
#login-password: admin |
||||
|
filter: |
||||
|
stat: |
||||
|
log-slow-sql: true |
||||
|
slow-sql-millis: 1000 |
||||
|
merge-sql: false |
@ -0,0 +1,36 @@ |
|||||
|
spring: |
||||
|
redis: |
||||
|
database: @spring.redis.index@ |
||||
|
host: @spring.redis.host@ |
||||
|
timeout: 30s |
||||
|
port: @spring.redis.port@ |
||||
|
password: @spring.redis.password@ |
||||
|
datasource: |
||||
|
druid: |
||||
|
driver-class-name: com.mysql.cj.jdbc.Driver |
||||
|
url: jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/yushan_esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
||||
|
username: yushan_epdc_test |
||||
|
password: elink-epdc@yushan |
||||
|
initial-size: 10 |
||||
|
max-active: 100 |
||||
|
min-idle: 10 |
||||
|
max-wait: 60000 |
||||
|
pool-prepared-statements: true |
||||
|
max-pool-prepared-statement-per-connection-size: 20 |
||||
|
time-between-eviction-runs-millis: 60000 |
||||
|
min-evictable-idle-time-millis: 300000 |
||||
|
#Oracle需要打开注释 |
||||
|
#validation-query: SELECT 1 FROM DUAL |
||||
|
test-while-idle: true |
||||
|
test-on-borrow: false |
||||
|
test-on-return: false |
||||
|
stat-view-servlet: |
||||
|
enabled: true |
||||
|
url-pattern: /druid/* |
||||
|
#login-username: admin |
||||
|
#login-password: admin |
||||
|
filter: |
||||
|
stat: |
||||
|
log-slow-sql: true |
||||
|
slow-sql-millis: 1000 |
||||
|
merge-sql: false |
@ -0,0 +1,21 @@ |
|||||
|
registry { |
||||
|
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa |
||||
|
type = "nacos" |
||||
|
|
||||
|
nacos { |
||||
|
serverAddr = "@nacos.server-addr@" |
||||
|
namespace = "@nacos.namespace@" |
||||
|
cluster = "default" |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
config { |
||||
|
# file、nacos 、apollo、zk、consul、etcd3 |
||||
|
type = "nacos" |
||||
|
|
||||
|
nacos { |
||||
|
serverAddr = "@nacos.server-addr@" |
||||
|
namespace = "@nacos.namespace@" |
||||
|
cluster = "default" |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue