Merge branch 'dev' into 'master'

Dev

See merge request eshop/biz_service_ebtp_extend!1
This commit is contained in:
付庆吉
2021-03-09 18:56:07 +08:00
9 changed files with 312 additions and 29 deletions

View File

@ -7,4 +7,4 @@ RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
RUN mkdir -p /model RUN mkdir -p /model
COPY /target/classes/model/. /model/ COPY /target/classes/model/. /model/
ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"] ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=uat", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"]

10
Dockerfile-test Normal file
View File

@ -0,0 +1,10 @@
FROM harbor.dcos.guangzhou.unicom.local/eshop/skywalking_agent_springboot_8.1.0:v1.0
ENV LC_ALL=zh_CN.utf8
ENV LANG=zh_CN.utf8
ENV LANGUAGE=zh_CN.utf8
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
RUN mkdir -p /model
COPY /target/classes/model/. /model/
ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=test", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"]

17
config-test Normal file
View File

@ -0,0 +1,17 @@
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://10.125.164.54:41967
name: demok8s
contexts:
- context:
cluster: demok8s
user: cluster-admin
name: default
current-context: default
kind: Config
users:
- name: cluster-admin
user:
token: b69792983bfe0ec502e081ad8a31f9e2

71
deployment-test.yaml Normal file
View File

@ -0,0 +1,71 @@
# 接口版本
apiVersion: apps/v1
# 接口类型
kind: Deployment
metadata:
name: biz-service-ebtp-extend
namespace: default
labels:
app: biz-service-ebtp-extend
# 必选,详细定义
spec:
# pod 副本数量
replicas: 1
# 滚动升级配置信息
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
# 选择器匹配pod模板
selector:
matchLabels:
app: biz-service-ebtp-extend
template:
metadata:
labels:
# 模板名称
app: biz-service-ebtp-extend
annotations:
prometheus.io/port: '18018'
prometheus.io/jl-pod: 'true'
# 定义容器模板,该模板可以包含多个容器
spec:
# 必选Pod中容器列表
containers:
- name: biz-service-ebtp-extend
image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest
# 需要暴露的端口库号列表
ports:
- containerPort: 18018
# 容器运行前需设置的环境变量列表
env:
# Apollo 配置中心变量设置
- name: APOLLO_CONFIGSERVICE
value: http://10.242.37.1488:6001
---
kind: Service
apiVersion: v1
metadata:
name: biz-service-ebtp-extend
namespace: default
labels:
app: biz-service-ebtp-extend
annotations:
lb.cke.tg.unicom/target-vports: 18018-18018
prometheus.io/port: '18018'
prometheus.io/jl-svc: 'true'
spec:
ports:
- port: 18018
targetPort: 18018
selector:
app: biz-service-ebtp-extend
status:
loadBalancer: {}
---

View File

@ -29,6 +29,19 @@ public class BizBidNoticeController {
@Autowired @Autowired
private IBaseCacheUserService iBaseCacheUserService; private IBaseCacheUserService iBaseCacheUserService;
/**
* 查询发布数据
*
* @param id
* @return
*/
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public BaseResponse<BizBidNotice> getById(@PathVariable String id) {
return BaseResponse.success(ibizBidNoticeService.getById(id));
}
/** /**
* 查询发布数据 * 查询发布数据
* *

View File

@ -0,0 +1,162 @@
server:
port: 18018
servlet:
context-path: /
# 对应 apollo 配置中心的应用名
app:
id: biz-service-ebtp-extend
# Apollo 配置信息
apollo:
meta: http://10.242.37.148:6001/
bootstrap:
namespace: application
enabled: true
eagerLoad:
enabled: true
seata:
service:
vgroup-mapping:
biz-service-ebtp-extend-dev-service-group: default
spring:
aop:
auto: true #开启spring的aop配置
proxy-target-class: true
application:
name: biz-service-ebtp-extend-dev
shardingsphere:
datasource:
names: ds0
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
jdbc-url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
filters: stat,wall,log4j
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000
props:
sql:
show: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
serialization:
write-dates-as-timestamps: false
# 天宫Kafka增加了安全认证需要配置安全属性
kafka:
bootstrap-servers: 10.125.164.192:32005,10.125.164.193:32005,10.125.164.194:32005
template:
default-topic: jl_test
# 生产者配置参数
producer:
client-id: core-service-ebtp-crypt
properties:
security.protocol: SASL_PLAINTEXT
sasl.mechanism: SCRAM-SHA-256
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
# 消费者配置参数
consumer:
group-id: core-service-ebtp-crypt-consumer
auto-offset-reset: latest
properties:
security.protocol: SASL_PLAINTEXT
sasl.mechanism: SCRAM-SHA-256
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
# 天宫 redis 需要使用哨兵进行访问
redis:
sentinel:
master: eshop-redis
nodes: 10.125.164.124:32718, 10.125.164.118:32716, 10.125.164.121:32716
password: Unicom#135
# 天宫Eureka配置
eureka:
client:
service-url:
defaultZone: http://10.242.37.148:5001/eureka
instance:
prefer-ip-address: true
ip-address: 125.32.114.204
hostname: 125.32.114.204
instance-ip: 125.32.114.204:${server.port}
mybatis-plus:
configuration:
# 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
map-underscore-to-camel-case: true
auto-mapping-behavior: full
# 这个配置会将执行的sql打印出来在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml
global-config:
# 逻辑删除配置
db-config:
# logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) @TableLogic
logic-delete-value: deleted # 逻辑已删除值
logic-not-delete-value: normal # 逻辑未删除值
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
strategy: SEMAPHORE
thread:
timeoutInMilliseconds: 200000 #熔断超时时间
circuitBreaker:
sleepWindowInMilliseconds: 20000
forceClosed: true
ribbon:
ReadTimeout: 20000 #请求处理的超时时间
ConnectTimeout: 20000 #请求连接超时时间
MaxAutoRetries: 0 #对当前实例的重试次数
MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1
mconfig:
workerId: 1
datacenterId: 1
# 服务名
feign:
name:
open: biz-service-ebtp-opening #开标大厅服务
process: biz-service-ebtp-process #评审流程服务
project: biz-service-ebtp-project #项目服务
resps: biz-service-ebtp-resps #应答结构化服务
rsms: biz-service-ebtp-rsms #评审结构化服务
tender: biz-service-ebtp-tender #投标服务
# 用户暴露给 prometheus 的健康数据
management:
endpoints:
web:
exposure:
include: "*"
cors:
allowed-origins: "*"
allowed-methods: "*"

View File

@ -2,31 +2,40 @@ server:
port: 18018 port: 18018
servlet: servlet:
context-path: / context-path: /
seata:
service:
vgroup-mapping:
biz-service-ebtp-extend-service-group: default
grouplist:
default: 10.242.37.148:18035
#registry:
# type: eureka
# eureka:
# serviceUrl: http://10.242.37.148:5001/eureka,http://10.242.37.148:5002/eureka,http://10.242.37.148:5003/eureka
# 对应 apollo 配置中心的应用名 # 对应 apollo 配置中心的应用名
app: app:
id: biz-service-ebtp-extend id: biz-service-ebtp-extend
# Apollo 配置信息 # Apollo 配置信息
apollo: apollo:
meta: http://10.242.31.158:6001/ meta: http://10.242.37.148:6001/
bootstrap: bootstrap:
namespace: application namespace: application
enabled: true enabled: true
eagerLoad: eagerLoad:
enabled: true enabled: true
seata:
service:
vgroup-mapping:
biz-service-ebtp-extend-dev-service-group: default
spring: spring:
aop: aop:
auto: true #开启spring的aop配置 auto: true #开启spring的aop配置
proxy-target-class: true proxy-target-class: true
application: application:
name: biz-service-ebtp-extend-dev name: biz-service-ebtp-extend
shardingsphere: shardingsphere:
datasource: datasource:
names: ds0 names: ds0
@ -35,8 +44,8 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: root username: root
password: root password: root
jdbc-url: jdbc:mysql://10.242.31.158:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.242.31.158:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
filters: stat,wall,log4j filters: stat,wall,log4j
maxActive: 20 maxActive: 20
initialSize: 1 initialSize: 1
@ -60,22 +69,22 @@ spring:
time-zone: GMT+8 time-zone: GMT+8
serialization: serialization:
write-dates-as-timestamps: false write-dates-as-timestamps: false
# 天宫Kafka增加了安全认证需要配置安全属性 # 天宫Kafka增加了安全认证需要配置安全属性
kafka: kafka:
bootstrap-servers: 10.125.164.192:32005,10.125.164.193:32005,10.125.164.194:32005 bootstrap-servers: 10.125.164.192:32005,10.125.164.193:32005,10.125.164.194:32005
template: template:
default-topic: jl_test default-topic: jl_test
# 生产者配置参数 # 生产者配置参数
producer: producer:
client-id: core-service-ebtp-crypt client-id: core-service-ebtp-crypt
properties: properties:
security.protocol: SASL_PLAINTEXT security.protocol: SASL_PLAINTEXT
sasl.mechanism: SCRAM-SHA-256 sasl.mechanism: SCRAM-SHA-256
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123"; sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
# 消费者配置参数 # 消费者配置参数
consumer: consumer:
group-id: core-service-ebtp-crypt-consumer group-id: core-service-ebtp-crypt-consumer
auto-offset-reset: latest auto-offset-reset: latest
@ -83,7 +92,7 @@ spring:
security.protocol: SASL_PLAINTEXT security.protocol: SASL_PLAINTEXT
sasl.mechanism: SCRAM-SHA-256 sasl.mechanism: SCRAM-SHA-256
sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123"; sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123";
# 天宫 redis 需要使用哨兵进行访问 # 天宫 redis 需要使用哨兵进行访问
redis: redis:
sentinel: sentinel:
@ -95,12 +104,12 @@ spring:
eureka: eureka:
client: client:
service-url: service-url:
defaultZone: http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka defaultZone: http://eureka-1-svc:8080/eureka, http://eureka-2-svc:8080/eureka, http://eureka-3-svc:8080/eureka
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: 125.32.114.204:${server.port} instance-id: http://10.242.37.148:${server.port}
hostname: 125.32.114.204 # 这是客户端的注册地址, eureka 会通过这个地址建立管道
ip-address: 125.32.114.204 ip-address: 10.242.37.148
mybatis-plus: mybatis-plus:
configuration: configuration:
@ -116,7 +125,7 @@ mybatis-plus:
# logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) @TableLogic # logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) @TableLogic
logic-delete-value: deleted # 逻辑已删除值 logic-delete-value: deleted # 逻辑已删除值
logic-not-delete-value: normal # 逻辑未删除值 logic-not-delete-value: normal # 逻辑未删除值
hystrix: hystrix:
command: command:
default: default:
@ -130,13 +139,13 @@ hystrix:
circuitBreaker: circuitBreaker:
sleepWindowInMilliseconds: 20000 sleepWindowInMilliseconds: 20000
forceClosed: true forceClosed: true
ribbon: ribbon:
ReadTimeout: 20000 #请求处理的超时时间 ReadTimeout: 20000 #请求处理的超时时间
ConnectTimeout: 20000 #请求连接超时时间 ConnectTimeout: 20000 #请求连接超时时间
MaxAutoRetries: 0 #对当前实例的重试次数 MaxAutoRetries: 0 #对当前实例的重试次数
MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1
mconfig: mconfig:
workerId: 1 workerId: 1
datacenterId: 1 datacenterId: 1
@ -149,7 +158,8 @@ mconfig:
resps: biz-service-ebtp-resps #应答结构化服务 resps: biz-service-ebtp-resps #应答结构化服务
rsms: biz-service-ebtp-rsms #评审结构化服务 rsms: biz-service-ebtp-rsms #评审结构化服务
tender: biz-service-ebtp-tender #投标服务 tender: biz-service-ebtp-tender #投标服务
# 用户暴露给 prometheus 的健康数据
# 用户暴露给 prometheus 的健康数据
management: management:
endpoints: endpoints:
web: web:

View File

@ -1,3 +1,3 @@
spring: spring:
profiles: profiles:
active: dev active: uat