diff --git a/config-dev b/config-dev new file mode 100644 index 0000000..27abdb5 --- /dev/null +++ b/config-dev @@ -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 \ No newline at end of file diff --git a/config-master b/config-master new file mode 100644 index 0000000..cfa151b --- /dev/null +++ b/config-master @@ -0,0 +1,17 @@ +apiVersion: v1 +clusters: +- cluster: + insecure-skip-tls-verify: true + server: https://10.172.48.16:44039 + name: demok8s +contexts: +- context: + cluster: demok8s + user: cluster-admin + name: default +current-context: default +kind: Config +users: +- name: cluster-admin + user: + token: 2c00232d4e3b1498008315e8ab14283c diff --git a/config-sim b/config-sim new file mode 100644 index 0000000..cfa151b --- /dev/null +++ b/config-sim @@ -0,0 +1,17 @@ +apiVersion: v1 +clusters: +- cluster: + insecure-skip-tls-verify: true + server: https://10.172.48.16:44039 + name: demok8s +contexts: +- context: + cluster: demok8s + user: cluster-admin + name: default +current-context: default +kind: Config +users: +- name: cluster-admin + user: + token: 2c00232d4e3b1498008315e8ab14283c diff --git a/config-uat b/config-uat new file mode 100644 index 0000000..980e05b --- /dev/null +++ b/config-uat @@ -0,0 +1,17 @@ +apiVersion: v1 +clusters: +- cluster: + insecure-skip-tls-verify: true + server: https://10.125.164.111:42733;https://10.125.164.158:41745;https://10.125.164.8:43001 + name: demok8s +contexts: +- context: + cluster: demok8s + user: cluster-admin + name: default +current-context: default +kind: Config +users: +- name: cluster-admin + user: + token: ae123cd22080c2712d08cb31633a2fa6 \ No newline at end of file diff --git a/deployment-dev.yaml b/deployment-dev.yaml new file mode 100644 index 0000000..40f01d8 --- /dev/null +++ b/deployment-dev.yaml @@ -0,0 +1,81 @@ +# 接口版本 +apiVersion: apps/v1 +# 接口类型 +kind: Deployment +metadata: + name: sys-manager-ebtp-project + namespace: default + labels: + app: sys-manager-ebtp-project + +# 必选,详细定义 +spec: + # pod 副本数量 + replicas: 1 + + # 滚动升级配置信息 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + + # 选择器,匹配pod模板 + selector: + matchLabels: + app: sys-manager-ebtp-project + + template: + metadata: + labels: + # 模板名称 + app: sys-manager-ebtp-project + annotations: + prometheus.io/port: '18012' + prometheus.io/jl-pod: 'true' + + # 定义容器模板,该模板可以包含多个容器 + spec: + # 必选,Pod中容器列表 + containers: + - name: sys-manager-ebtp-project + image: harbor.dcos.guangzhou.unicom.local/eshop/sys-manager-ebtp-project:latest + # 需要暴露的端口库号列表 + ports: + - containerPort: 18012 + # 容器运行前需设置的环境变量列表 + env: + # Apollo 配置中心变量设置 + - name: APOLLO_CONFIGSERVICE + value: http://10.242.37.148:6001 + - name: APP_NAME + value: sys_manager_ebtp_project_dev + - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES + value: skywalking-oap-cluster.skywalking:11800 + - name: SW_AGENT_NAME + value: sys-manager-ebtp-project + - name: MY_POD_IP #自动获取pod ip作为agent id + valueFrom: + fieldRef: + fieldPath: status.podIP +--- +kind: Service +apiVersion: v1 +metadata: + name: sys-manager-ebtp-project + namespace: default + labels: + app: sys-manager-ebtp-project + annotations: + lb.cke.tg.unicom/target-vports: 18012-18012 + prometheus.io/port: '18012' + prometheus.io/jl-svc: 'true' +spec: + ports: + - port: 18012 + targetPort: 18012 + selector: + app: sys-manager-ebtp-project +status: + loadBalancer: {} + +--- \ No newline at end of file diff --git a/deployment-master.yaml b/deployment-master.yaml new file mode 100644 index 0000000..89364cb --- /dev/null +++ b/deployment-master.yaml @@ -0,0 +1,112 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sys_manager_ebtp_project #[1] Deployment名称,可填写微服务名称 + namespace: default + labels: + app: sys_manager_ebtp_project + +spec: + replicas: 10 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + selector: + matchLabels: + app: sys-manager-ebtp-project #[2] 选择器匹配时标签名称,可填写微服务名称 + template: + metadata: + labels: + app: sys-manager-ebtp-project #[3] 模板名称,可填写微服务名称 + annotations: + prometheus.io/port: '18012' + prometheus.io/jl-pod: 'true' + spec: + volumes: + - name: log + hostPath: + path: /var/lib/docker/log/349553515466-prod/default-group/30days + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - sys-manager-ebtp-project + topologyKey: "kubernetes.io/hostname" + containers: + - name: sys-manager-ebtp-project #[6] 必选,容器名称,可填写微服务名称 + image: harbor.dcos.xixian.unicom.local/eshop/sys-manager-ebtp-project:latest #[7] 镜像名称,请把sys-manager-ebtp-project替换为服务名称 + args: ["java","-Djava.security.egd=file:/dev/./urandom","-javaagent:/pinpoint/pinpoint-bootstrap-2.0.3.jar","-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)","-Dpinpoint.licence=$(AGENT_LICENCE)","-jar","/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18012 #[8] 容器需要监听的端口号,与配置文件中的server.port参数相同,与参数[4]相同 + livenessProbe: + failureThreshold: 3 + httpGet: + port: 18012 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + path: /actuator/health + scheme: HTTP + initialDelaySeconds: 300 + periodSeconds: 60 + successThreshold: 1 + timeoutSeconds: 2 + readinessProbe: + failureThreshold: 1 + httpGet: + port: 18012 #[12] pod就绪检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + path: /actuator/health + scheme: HTTP + periodSeconds: 5 + successThreshold: 2 + timeoutSeconds: 2 + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 3000m + memory: 6Gi + env: + - name: APP_NAME + value: biz_ebtp_project #24位长度限,制统一去掉service + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: JAVA_TOOL_OPTIONS + value: -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 + +--- +kind: Service +apiVersion: v1 +metadata: + name: sys-manager-ebtp-project-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: sys-manager-ebtp-project-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18012' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18012 #[15] 与参数4相同 + targetPort: 18012 #[16] 与参数4相同 + selector: + app: sys-manager-ebtp-project #[17] 该service对应Deployment的名字,与参数[1]相同 +--- \ No newline at end of file diff --git a/deployment-sim.yaml b/deployment-sim.yaml new file mode 100644 index 0000000..20dc5fb --- /dev/null +++ b/deployment-sim.yaml @@ -0,0 +1,113 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sys_manager_ebtp_project #[1] Deployment名称,可填写微服务名称 + namespace: default + labels: + app: sys_manager_ebtp_project + +spec: + replicas: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + selector: + matchLabels: + app: sys-manager-ebtp-project #[2] 选择器匹配时标签名称,可填写微服务名称 + template: + metadata: + labels: + app: sys-manager-ebtp-project #[3] 模板名称,可填写微服务名称 + annotations: + prometheus.io/port: '18012' + prometheus.io/jl-pod: 'true' + spec: + volumes: + - name: log + hostPath: + path: /var/lib/docker/log/349553515466-preprod/default-group/all + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - sys-manager-ebtp-project + topologyKey: "kubernetes.io/hostname" + containers: + - name: sys-manager-ebtp-project #[6] 必选,容器名称,可填写微服务名称 + image: harbor.dcos.guangzhou.unicom.local/eshop/sys-manager-ebtp-project:latest #[7] 镜像名称,请把sys-manager-ebtp-project替换为服务名称 + args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18012 + livenessProbe: + failureThreshold: 3 + httpGet: + port: 18012 + path: /actuator/health + scheme: HTTP + initialDelaySeconds: 300 + periodSeconds: 60 + successThreshold: 1 + timeoutSeconds: 2 + readinessProbe: + failureThreshold: 1 + httpGet: + port: 18012 + path: /actuator/health + scheme: HTTP + periodSeconds: 5 + successThreshold: 2 + timeoutSeconds: 2 + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 3000m + memory: 6Gi + env: + - name: APP_NAME + value: biz_ebtp_project_sim + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: JAVA_TOOL_OPTIONS + value: + -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 + +--- +kind: Service +apiVersion: v1 +metadata: + name: sys-manager-ebtp-project-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: sys-manager-ebtp-project-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18012' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18012 #[15] 与参数4相同 + targetPort: 18012 #[16] 与参数4相同 + selector: + app: sys-manager-ebtp-project #[17] 该service对应Deployment的名字,与参数[1]相同 +--- \ No newline at end of file diff --git a/deployment-uat.yaml b/deployment-uat.yaml new file mode 100644 index 0000000..d1e5a62 --- /dev/null +++ b/deployment-uat.yaml @@ -0,0 +1,105 @@ +# 接口版本 +apiVersion: apps/v1 +# 接口类型 +kind: Deployment +metadata: + name: sys_manager_ebtp_project + namespace: default + labels: + app: sys_manager_ebtp_project + +# 必选,详细定义 +spec: + # pod 副本数量 + replicas: 1 + + # 滚动升级配置信息 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + + # 选择器,匹配pod模板 + selector: + matchLabels: + app: sys-manager-ebtp-project + + template: + metadata: + labels: + # 模板名称 + app: sys-manager-ebtp-project + annotations: + prometheus.io/port: '18012' + prometheus.io/jl-pod: 'true' + + # 定义容器模板,该模板可以包含多个容器 + spec: + # 挂载日志存储 + volumes: + - name: log + hostPath: #以下三选一 + path: /var/lib/docker/log/349553515466-uat/default-group/all #uat环境 + + # 必选,Pod中容器列表 + containers: + - name: sys-manager-ebtp-project + image: harbor.dcos.guangzhou.unicom.local/eshop/sys-manager-ebtp-project:latest + # 在容器中挂载日志存储区 + volumeMounts: + - name: log + mountPath: /log + # 需要暴露的端口库号列表 + ports: + - containerPort: 18012 + resources: + requests: + cpu: 2000m + memory: 4Gi + limits: + cpu: 4000m + memory: 8Gi + # 容器运行前需设置的环境变量列表 + env: + # Apollo 配置中心变量设置 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: APP_NAME + value: sys_manager_ebtp_project_uat + - name: MY_POD_IP #自动获取pod ip作为agent id + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES + value: skywalking-oap-cluster.skywalking:11800 + - name: SW_AGENT_NAME + value: sys_manager_ebtp_project + - name: JAVA_TOOL_OPTIONS + value: -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 +--- +kind: Service +apiVersion: v1 +metadata: + name: sys-manager-ebtp-project + namespace: default + labels: + app: sys-manager-ebtp-project + annotations: +# lb.cke.tg.unicom/target-vports: 18012-18012 + prometheus.io/port: '18012' + prometheus.io/jl-svc: 'true' +spec: + ports: + - port: 18012 + targetPort: 18012 + selector: + app: sys-manager-ebtp-project +status: + loadBalancer: {} + +--- \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9d0b94a --- /dev/null +++ b/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + com.chinaunicom.ebtp + mall-ebtp-cloud-parent + 2.4.1-zyhy-SNAPSHOT + + com.chinaunicom.mall.ebtp + sys_manager_ebtp_project + 0.0.1 + sys_manager_ebtp_project + + + + com.chinaunicom.mall.ebtp + uboot-core + 2.4.1-zyhy-SNAPSHOT + + + + + + maven-snapshot-local + maven-snapshot-local + http://ccp.tianti.tg.unicom.local/artifactory/tianti-maven-snapshot-local/ + + false + + + true + always + + + + + + + + src/main/resources + true + + + src/main/java + + **/mapper/*Mapper.xml + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/SysManagerEbtpProjectApplication.java b/src/main/java/com/chinaunicom/mall/ebtp/project/SysManagerEbtpProjectApplication.java new file mode 100644 index 0000000..0561dcc --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/SysManagerEbtpProjectApplication.java @@ -0,0 +1,40 @@ +package com.chinaunicom.mall.ebtp.project; + +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; +import io.micrometer.core.instrument.MeterRegistry; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication(exclude = { + DataSourceAutoConfiguration.class, + DruidDataSourceAutoConfigure.class +}) +@EnableFeignClients +@MapperScan({"com.chinaunicom.mall.ebtp.project.**.dao"}) +@ComponentScan("com.chinaunicom.mall.ebtp.*") +public class SysManagerEbtpProjectApplication { + + public static void main(String[] args) { + SpringApplication.run(SysManagerEbtpProjectApplication.class, args); + } + + /** + * Grafana 注册项 + * + * @param applicationName 应用名称, 用于grafana应用列表 + * @return + */ + @Bean + public MeterRegistryCustomizer configurer( + @Value("${spring.application.name}") String applicationName) { + return (registry) -> registry.config().commonTags("application", applicationName); + } + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/column/DictProvincesCodeField.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/column/DictProvincesCodeField.java new file mode 100644 index 0000000..34235cc --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/column/DictProvincesCodeField.java @@ -0,0 +1,35 @@ +package com.chinaunicom.mall.ebtp.project.dict.column; + +/** + * 字段常量 DictProvincesCode + * + * @author daixc + * @date 2021/04/06 + */ +public class DictProvincesCodeField { + + private DictProvincesCodeField(){ + + } + /** + * 编号 + */ + public static final String ID = "id"; + + /** + * 省份编码 + */ + public static final String PROVINCES_NUMBER = "provinces_number"; + + /** + * 省份名称 + */ + public static final String PROVINCES_NAME = "provinces_name"; + + /** + * 省份名称缩写 + */ + public static final String PROVINCES_CODE = "provinces_code"; + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProjectController.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProjectController.java new file mode 100644 index 0000000..47c48a4 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProjectController.java @@ -0,0 +1,105 @@ +package com.chinaunicom.mall.ebtp.project.dict.controller; + + +import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProject; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictProjectService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; +import java.util.Map; + +/** + * 字典查询 + * + * @author daixc + * @date 2020/11/02 + */ +@RestController +@Api(tags = "字典查询") +@RequestMapping("/v1/dictProject") +public class DictProjectController{ + + @Resource + private IDictProjectService dictProjectService; + + /** + * 插入新数据 + * + * @param dictProject 字典对象 + * + * @return 返回结果 + */ + @ApiOperation("插入新数据") + @PostMapping("") + public BaseResponse insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid DictProject dictProject){ + + boolean save = dictProjectService.save(dictProject); + + return BaseResponse.success(save); + } + + /** + * 修改数据 + * + * @param dictProject 字典对象 + * + * @return 返回结果 + */ + @ApiOperation("修改数据") + @PostMapping("/update") + public BaseResponse update(@ApiParam(value = "对象数据", required = true) @RequestBody DictProject dictProject){ + + + return BaseResponse.success(dictProjectService.updateById(dictProject)); + } + + /** + * 查询数据 + * + * @param id ID + * + * @return 返回结果 + */ + @ApiOperation("查询数据") + @GetMapping("/{id}") + public BaseResponse get(@ApiParam(value = "主键id", required = true) @PathVariable String id){ + + DictProject dictProject = dictProjectService.getById(id); + + return BaseResponse.success(dictProject); + } + + + /** + * 查询字典数据 + * @param parentCode 字典父类code + * @param toParentCode 字典父类对应的父类code + * @return 返回结果 + */ + @ApiOperation("查询数据集合") + @GetMapping("/getDictList") + public BaseResponse> getDictList(@ApiParam(value = "字典父类code", required = true)String parentCode, + @ApiParam(value = "字典父类对应的父类code", required = true)String toParentCode){ + + return BaseResponse.success(dictProjectService.getDictList(parentCode,toParentCode)); + } + + + /** + * 字典缓存查询数据 + * @return 返回结果 + */ + @ApiOperation("字典缓存查询数据") + @GetMapping("/refreshDictCache") + public BaseResponse>> refreshDictCache(){ + + return BaseResponse.success(dictProjectService.refreshDictCache()); + } + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProvincesCodeController.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProvincesCodeController.java new file mode 100644 index 0000000..b8a58ff --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictProvincesCodeController.java @@ -0,0 +1,98 @@ +package com.chinaunicom.mall.ebtp.project.dict.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProvincesCode; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictProvincesCodeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 省份对应缩写字典表 + * @author daixc + * @date 2021/ + */ +@RestController +@Api(tags = "省份对应缩写字典表") +@RequestMapping("/v1/dictprovincescode") +public class DictProvincesCodeController{ + + @Resource + private IDictProvincesCodeService idictProvincesCodeService; + + /** + * 插入新数据 + * @param dictProvincesCode 省分代码实体 + * @return 返回结果 + */ + @ApiOperation("插入新数据") + @PostMapping("") + public BaseResponse insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid DictProvincesCode dictProvincesCode){ + + boolean save = idictProvincesCodeService.save(dictProvincesCode); + + return BaseResponse.success(save); + } + + /** + * 修改数据 + * @param dictProvincesCode 省分代码实体 + * @return 返回结果 + */ + @ApiOperation("修改数据") + @PostMapping("/update") + public BaseResponse update(@ApiParam(value = "对象数据", required = true) @RequestBody DictProvincesCode dictProvincesCode){ + + return BaseResponse.success(idictProvincesCodeService.updateById(dictProvincesCode)); + } + + /** + * 查询数据 + * @param id 主键id + * @return 返回结果 + */ + @ApiOperation("查询数据") + @GetMapping("/{id}") + public BaseResponse get(@ApiParam(value = "主键id", required = true) @PathVariable Integer id){ + + DictProvincesCode dictProvincesCode = idictProvincesCodeService.getById(id); + + return BaseResponse.success(dictProvincesCode); + } + + /** + * 根据省分编码查询数据 + * @param provincesNumber 省分编码 + * @return 返回结果 + */ + @ApiOperation("根据省分编码查询数据") + @GetMapping("getByProvincesNumber/{provincesNumber}") + public BaseResponse getByProvincesNumber(@ApiParam(value = "主键id", required = true) @PathVariable String provincesNumber){ + + DictProvincesCode dictProvincesCode = idictProvincesCodeService.getByProvincesNumber(provincesNumber); + + return BaseResponse.success(dictProvincesCode); + } + + /** + * 查询所有数据 + * + * @return 返回结果 + */ + @ApiOperation("查询所有数据") + @GetMapping("queryAll") + public BaseResponse> queryAll(@RequestParam(value = "childCompany", required = false) Boolean childCompany) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + wrapper.eq(childCompany != null, DictProvincesCode::getChildCompany, childCompany); + return BaseResponse.success(idictProvincesCodeService.list(wrapper)); + } + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictRegionController.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictRegionController.java new file mode 100644 index 0000000..336f536 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/controller/DictRegionController.java @@ -0,0 +1,92 @@ +package com.chinaunicom.mall.ebtp.project.dict.controller; + + +import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictRegion; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictRegionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 全国行政区域信息 + * @author daixc + * @date 2020/10/29 + */ +@RestController +@Api(tags = "全国行政区划表") +@RequestMapping("/v1/dictRegion") +public class DictRegionController{ + + @Resource + private IDictRegionService idictRegionService; + + /** + * 插入新数据 + * + * @param dictRegion 字典信息 + * + * @return 返回结果 + */ + @ApiOperation("插入新数据") + @PostMapping("") + public BaseResponse insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid DictRegion dictRegion){ + + boolean save = idictRegionService.save(dictRegion); + + return BaseResponse.success(save); + } + + /** + * 修改数据 + * + * @param dictRegion 字典信息 + * + * @return 返回结果 + */ + @ApiOperation("修改数据") + @PostMapping("/update") + public BaseResponse update(@ApiParam(value = "对象数据", required = true) @RequestBody DictRegion dictRegion){ + + return BaseResponse.success(idictRegionService.updateById(dictRegion)); + } + + /** + * 查询数据 + * + * @param id id值 + * + * @return 返回结果 + */ + @ApiOperation("查询数据") + @GetMapping("/{id}") + public BaseResponse get(@ApiParam(value = "主键id", required = true) @PathVariable String id){ + + DictRegion dictRegion = idictRegionService.getById(id); + + return BaseResponse.success(dictRegion); + } + + /** + * 查询数据 + * + * @param pId 父类id值 + * + * @return 返回结果 + */ + @ApiOperation("查询数据") + @GetMapping("/getChild") + public BaseResponse> getChild(@ApiParam(value = "主键id", required = true) @RequestParam(name = "pId") String pId){ + + List dictRegion = idictRegionService.getChild(pId); + + return BaseResponse.success(dictRegion); + } + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProjectMapper.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProjectMapper.java new file mode 100644 index 0000000..65d38be --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProjectMapper.java @@ -0,0 +1,16 @@ +package com.chinaunicom.mall.ebtp.project.dict.dao; + + +import com.chinaunicom.mall.ebtp.common.base.dao.IBaseMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProject; + + +/** + * 字典表mapper + * @author daixc + * @date 2020/11/03 + */ +public interface DictProjectMapper extends IBaseMapper { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProvincesCodeMapper.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProvincesCodeMapper.java new file mode 100644 index 0000000..dc67dc4 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictProvincesCodeMapper.java @@ -0,0 +1,10 @@ +package com.chinaunicom.mall.ebtp.project.dict.dao; + + +import com.chinaunicom.mall.ebtp.common.base.dao.IBaseMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProvincesCode; + +public interface DictProvincesCodeMapper extends IBaseMapper { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictRegionMapper.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictRegionMapper.java new file mode 100644 index 0000000..3578c3f --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/DictRegionMapper.java @@ -0,0 +1,10 @@ +package com.chinaunicom.mall.ebtp.project.dict.dao; + + +import com.chinaunicom.mall.ebtp.common.base.dao.IBaseMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictRegion; + +public interface DictRegionMapper extends IBaseMapper { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProjectMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProjectMapper.xml new file mode 100644 index 0000000..1141584 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProjectMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + update dict_project + set + delete_flag="deleted" + where ID=#{id} + + \ No newline at end of file diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProvincesCodeMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProvincesCodeMapper.xml new file mode 100644 index 0000000..baeb6fa --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictProvincesCodeMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + update dict_provinces_code + set + delete_flag="deleted" + where ID=#{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictRegionMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictRegionMapper.xml new file mode 100644 index 0000000..9fc807a --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/dao/mapper/DictRegionMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + update dict_region + set + delete_flag="deleted" + where ID=#{id} + + \ No newline at end of file diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProject.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProject.java new file mode 100644 index 0000000..ac81012 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProject.java @@ -0,0 +1,80 @@ +package com.chinaunicom.mall.ebtp.project.dict.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 实体类 DictProject + * + * @author daixc + * @date 2020/11/02 + */ +@Data +@Accessors(chain = true) +@ApiModel +@TableName(value = "dict_project", autoResultMap = true) +public class DictProject implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 编号 + */ + @ApiModelProperty(value = "编号") + private Integer id; + + /** + * 字典code + */ + @ApiModelProperty(value = "字典code") + private String code; + + /** + * 字典名称 + */ + @ApiModelProperty(value = "字典名称") + private String dicName; + + /** + * 父类code + */ + @ApiModelProperty(value = "父类code") + private String parentCode; + + /** + * 父类类型 + */ + @ApiModelProperty(value = "父类类型") + private String parentType; + + /** + * 是否应用 + */ + @ApiModelProperty(value = "是否应用") + private String useFlag; + + /** + * 是否默认 + */ + @ApiModelProperty(value = "是否默认") + private String defaultFlag; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer orderFlag; + + + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + private String description; + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProvincesCode.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProvincesCode.java new file mode 100644 index 0000000..214b8a6 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictProvincesCode.java @@ -0,0 +1,69 @@ +package com.chinaunicom.mall.ebtp.project.dict.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 实体类 DictProvincesCode + * + * @author daixc + */ +@Data +@Accessors(chain = true) +@ApiModel +@TableName(value = "dict_provinces_code", autoResultMap = true) +public class DictProvincesCode implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 编号 + */ + @ApiModelProperty(value = "编号") + private Integer id; + + /** + * 省份编码 + */ + @ApiModelProperty(value = "省份编码") + private String provincesNumber; + + /** + * 省份名称 + */ + @ApiModelProperty(value = "省份名称") + private String provincesName; + + /** + * 省份名称缩写 + */ + @ApiModelProperty(value = "省份名称缩写") + private String provincesCode; + + /** + * 省份名称 + */ + @ApiModelProperty(value = "省份名称") + private String provincesRemark; + + + /** + * 省份地市编码 + */ + @ApiModelProperty(value = "省份地市编码") + private String provinces; +; + + + /** + * 公司级别 + */ + @ApiModelProperty(value = "公司级别") + private Integer childCompany; + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictRegion.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictRegion.java new file mode 100644 index 0000000..546835f --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/entity/DictRegion.java @@ -0,0 +1,54 @@ +package com.chinaunicom.mall.ebtp.project.dict.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 全国行政区域实体类 DictRegion + * + * @author daixc + * @date 2020/10/29 + */ +@Data +@Accessors(chain = true) +@ApiModel("全国行政区域实体类") +@TableName(value = "dict_region", autoResultMap = true) +public class DictRegion implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + private String id; + + /** + * 上级id + */ + @ApiModelProperty(value = "上级id") + private String pId; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 类型:0-省,1-市,2-县 + */ + @ApiModelProperty(value = "类型:0-省,1-市,2-县") + private String level; + /** + * 缩写 + */ + @ApiModelProperty(value = "缩写") + private String ab; + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProjectService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProjectService.java new file mode 100644 index 0000000..bcd3df5 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProjectService.java @@ -0,0 +1,40 @@ +package com.chinaunicom.mall.ebtp.project.dict.service; + + +import com.chinaunicom.mall.ebtp.common.base.service.IBaseService; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProject; + +import java.util.List; +import java.util.Map; + +/** + * 对数据表 dict_project 操作的 service + * @author daixc + * @date 2020/11/03 + */ +public interface IDictProjectService extends IBaseService{ + + + /** + * 字典缓存查询数据 + * @return 返回结果 + */ + Map> refreshDictCache(); + + /** + * 查询字典数据 + * @param parentCode 字典父类code + * @param toParentCode 字典父类对应的父类code + * @return 返回结果 + */ + List getDictList(String parentCode, String toParentCode); + + /** + * 查询字典数据 + * @param parentCode 字典父类code + * @param toParentCode 字典父类对应的父类code + * @param code 字典code + * @return 返回结果 + */ + DictProject getDict(String code, String parentCode, String toParentCode); +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProvincesCodeService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProvincesCodeService.java new file mode 100644 index 0000000..42e078a --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictProvincesCodeService.java @@ -0,0 +1,20 @@ +package com.chinaunicom.mall.ebtp.project.dict.service; + + +import com.chinaunicom.mall.ebtp.common.base.service.IBaseService; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProvincesCode; + +/** + * 对数据表 dict_provinces_code 操作的 service + * @author Auto create + * + */ +public interface IDictProvincesCodeService extends IBaseService{ + + /** + * 根据省分编号获取省分信息 + * @param provincesNumber 省分编码 + * @return 返回结果 + */ + DictProvincesCode getByProvincesNumber(String provincesNumber); +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictRegionService.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictRegionService.java new file mode 100644 index 0000000..ddebe68 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/IDictRegionService.java @@ -0,0 +1,24 @@ +package com.chinaunicom.mall.ebtp.project.dict.service; + + +import com.chinaunicom.mall.ebtp.common.base.service.IBaseService; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictRegion; + + +import java.util.List; + +/** + * 对数据表 dict_region 操作的 service + * @author Auto create + * + */ +public interface IDictRegionService extends IBaseService{ + + + /** + * 查询子元素 + * @param pId 父ID + * @return + */ + List getChild(String pId); +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProjectServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProjectServiceImpl.java new file mode 100644 index 0000000..7c1eba9 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProjectServiceImpl.java @@ -0,0 +1,76 @@ +package com.chinaunicom.mall.ebtp.project.dict.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl; + +import com.chinaunicom.mall.ebtp.project.dict.dao.DictProjectMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProject; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictProjectService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 对数据表 dict_project 操作的 serviceImpl + * @author daixc + * @date 2020/11/03 + */ +@Service +public class DictProjectServiceImpl extends BaseServiceImpl implements IDictProjectService { + + + + + private static final String COMMON_STR = "="; + + private static final String USE_FLAG_YES = "0"; + + /** + * 字典缓存查询数据 + */ + @Override + public Map> refreshDictCache(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("use_flag",USE_FLAG_YES); + + queryWrapper.orderByAsc("id").orderByAsc("order_flag"); + + List dictProjects = this.list(queryWrapper); + + return dictProjects.stream().collect(Collectors.groupingBy(DictProject::getParentType)); + } + + + /** + * 查询字典集合 + * @param parentCode 字典父类code + * @param toParentCode 字典父类对应的父类code + * @return + */ + @Override + public List getDictList(String parentCode, String toParentCode) { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("use_flag", USE_FLAG_YES); + queryWrapper.eq("parent_type", parentCode + COMMON_STR + toParentCode); + queryWrapper.orderByAsc("order_flag"); + + return this.list(queryWrapper); + + } + + @Override + public DictProject getDict(String code, String parentCode, String toParentCode) { + + DictProject dictProject = null; + List dictProjectList = getDictList(parentCode,toParentCode); + if(null != dictProjectList && !dictProjectList.isEmpty()){ + dictProject = dictProjectList.stream().filter(n -> n.getCode().equals(code)).collect(Collectors.toList()).get(0); + } + return dictProject; + } + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProvincesCodeServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProvincesCodeServiceImpl.java new file mode 100644 index 0000000..ceb48ed --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictProvincesCodeServiceImpl.java @@ -0,0 +1,27 @@ +package com.chinaunicom.mall.ebtp.project.dict.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl; +import com.chinaunicom.mall.ebtp.project.dict.column.DictProvincesCodeField; +import com.chinaunicom.mall.ebtp.project.dict.dao.DictProvincesCodeMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictProvincesCode; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictProvincesCodeService; +import org.springframework.stereotype.Service; + +/** + * 对数据表 dict_provinces_code 操作的 serviceImpl + * @author Auto create + * + */ +@Service +public class DictProvincesCodeServiceImpl extends BaseServiceImpl implements IDictProvincesCodeService { + + + @Override + public DictProvincesCode getByProvincesNumber(String provincesNumber) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(DictProvincesCodeField.PROVINCES_NUMBER,provincesNumber); + return this.getOne(queryWrapper); + } +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictRegionServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictRegionServiceImpl.java new file mode 100644 index 0000000..45c575c --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/dict/service/impl/DictRegionServiceImpl.java @@ -0,0 +1,35 @@ +package com.chinaunicom.mall.ebtp.project.dict.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl; +import com.chinaunicom.mall.ebtp.project.dict.dao.DictRegionMapper; +import com.chinaunicom.mall.ebtp.project.dict.entity.DictRegion; +import com.chinaunicom.mall.ebtp.project.dict.service.IDictRegionService; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 对数据表 dict_region 操作的 serviceImpl + * @author Auto create + * + */ +@Service +public class DictRegionServiceImpl extends BaseServiceImpl implements IDictRegionService { + + /** + * 父类ID默认值 + */ + private static final String P_ID = "0"; + + @Override + public List getChild(String pId) { + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("p_id", StringUtils.isNotBlank(pId)?pId : P_ID); + queryWrapper.orderByAsc("id"); + return this.list(queryWrapper); + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..3fb50e2 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,177 @@ +server: + port: 18012 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + sys-manager-ebtp-project-service-group: default + grouplist: + default: 10.242.37.148:18035 + +# 对应 apollo 配置中心的应用名 +app: + id: sys-manager-ebtp-project + +# Apollo 配置信息 +apollo: + meta: http://10.242.37.148:6001/ + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: sys-manager-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true + url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=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://eureka-1-svc:8080/eureka, http://eureka-2-svc:8080/eureka, http://eureka-3-svc:8080/eureka + instance: + prefer-ip-address: true + instance-id: http://10.242.37.148:${server.port} + # 这是客户端的注册地址, eureka 会通过这个地址建立管道 + ip-address: 10.242.37.148 + +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-not-delete-value: normal # 逻辑删除标记:正常数据 + logic-delete-value: deleted # 逻辑删除标记:已删除的数据 + type-aliases-package: com.chinaunicom.mall.ebtp.project + +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: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 #终端ID + datacenter-id: 1 #数据中心ID + host-name: http://10.242.37.148/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query: biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps: biz-service-ebtp-resps #标段应答文件 + service-name-rsms: biz-service-ebtp-rsms #评审微服务 + service-name-tender: biz-service-ebtp-tender #标段投标微服务 + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" \ No newline at end of file diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..139dd5f --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,203 @@ +server: + port: 18012 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + sys-manager-ebtp-project-ceshi-service-group: seata-server-jl + grouplist: + default: 10.242.37.148:18035 + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: sys-manager-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: Unicom160_30 + jdbc-url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true + url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=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 + database: + idempotent: 0 + sharding: 1 + cache: 2 + backup: 3 + +# 天宫Eureka配置 +eureka: + client: + service-url: + defaultZone: http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka + instance: + prefer-ip-address: true + ip-address: 125.32.114.204 + hostname: 125.32.114.204 + instance-id: 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: 0 # 逻辑已删除值 + logic-not-delete-value: 1 # 逻辑未删除值 + + +check: + porject: + name-value: 33333 + num-value: 33333 + length: 2000 + checkBoolen: false + tokentime: + timeLimit: 5000 + onof: 0 + checkprivateKey : MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAk7N3OeQS9WJa/v5dX/s9/DCKpJ8kOjR1Zrh1X+TF98udqGbGBWmiyVk2SqGPA4Q9kUCWw46CocjE047gx5AFrQIDAQABAkAIHG/stvCvlxImNLPOBI8X3VaPycmEhML5vCF9/aM9g1SuFa298Q5W8FqAmm8SE5lRpw2yyToWtLbufJtAa7wFAiEAxViJBkLU4wfPCwiPiAn17owXbocC9rj3fAzEH9DYDdcCIQC/mZp4ujO035Qqw2QQeFWpDc/vITx1OTWaxq6/LvvwGwIgXTZLSmzItw9aKOD7QotJ4UnES41zxetp4er5u/leA3MCIGcRw2ZEjII1b+hdOdweT75kfsId9/77apm7Xc/c/4yXAiEAnBrCiVXRNN+slO0MYaxynr4eIiPG/EjYBYxXlwBpeOc= + checkpublicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJOzdznkEvViWv7+XV/7PfwwiqSfJDo0dWa4dV/kxffLnahmxgVposlZNkqhjwOEPZFAlsOOgqHIxNOO4MeQBa0CAwEAAQ== + +hystrix: + command: + default: + execution: + timeout: + enabled: true + isolation: + strategy: SEMAPHORE + thread: + timeoutInMilliseconds: 600000 #熔断超时时间 + circuitBreaker: + sleepWindowInMilliseconds: 20000 + forceClosed: true + +ribbon: + ReadTimeout: 60000 #请求处理的超时时间 + ConnectTimeout: 20000 #请求连接超时时间 + MaxAutoRetries: 0 #对当前实例的重试次数 + MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 + +mconfig: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 + datacenter-id: 5 + + host-name: http://10.242.37.148/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query : biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps : biz-service-ebtp-resps #标段应答文件 + service-name-rsms : biz-service-ebtp-rsms #评审微服务 + service-name-tender : biz-service-ebtp-tender #标段投标微服务 + service-name-evaluation : biz-service-ebtp-evaluation + service-name-open : biz-service-ebtp-opening + service-name-notification : core-service-notification-center + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + rsa: + field: + pivate_key: MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBALYmN7QH5Bh3mjeeNOZzvhvgXJq3PKteb5vO7EtyM7C1IGg60CLePc1zISF5m48F7VIORtj48w4Ci0S/5oYxkjv2GTIhiPHD9GV1HsakpNTl475VZiVIfuDsTujghUZH9CW0UZB37yTI0njQBhsyjpTswKaUGb1LRZoqUcj1w4mFAgMBAAECgYEAmG93YoTQEOHXAAC4iLwIN1AWb6w1a70GbkBHZARY2eNbEZ9WnDedRRi6e0dINfNh3q/v/pio3+qlHo3yoA9QLs68YW8yy1xgGqTBsFMhn8Zh1KQ7Alle0+KJdytvpfvf6/YwW6oUk2Y44vm6nVa8EjXKYqloV/PROMa0uTYWUQECQQDvMk/XJ1wjG42IoyLxVSfsMfSCelJvYBYxaFfNPxOYWdOfSSEnAj7QNkDnhuDrLbbsnyy3KvLnUqkILU8fuZLhAkEAwvH5MRwSXpjwZY8xFCLv4YShDB6pG8l4rScjzV5B8SL2DhE/evha5obMO5d+iB73JBP03W6juSCilksy5zovJQJBAI+/Q54ASG3MzCTWLVStIV3fs5qKGmpWa1/r3gA5rPP836G1GBhSUB9ey2iYdSjAg1L2Ya/+PpXn5i9E0200X+ECQQCCQ05QEoHz1B5Ovq/81JuWBhnXD2XQu393tH+n6yQFDWd9XukcMngLMmemKkTSkF50LSGiFRwxyCzcYMNS3v5BAkEA5t2hOtPieYU9SrFENtgQTvtU7WmUumS0mTsDnnGUKsx2hMn8acKPVOskT+VzGg4A2kDoKo+5C9LQp1lc/RkI6A== + + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" + health: + mongo: + enabled: false + +client: + notification-url: http://10.242.31.158:8806/auth/sso/cloudPortal?return=https://uat-uscm.chinaunicom.cn:18022/redirect?page=subscription?id={{id}}&source=supplier + clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 +allow: + apis: + - ^POST\./?v1/.*$ + - ^GET\./?v1/.*$ + + diff --git a/src/main/resources/application-master.yml b/src/main/resources/application-master.yml new file mode 100644 index 0000000..060bb60 --- /dev/null +++ b/src/main/resources/application-master.yml @@ -0,0 +1,150 @@ +server: + port: 18012 + servlet: + context-path: / + +spring: + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: sys-manager-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: Unicom@2024 + jdbc-url: jdbc:mysql://59.110.10.99:53306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://59.110.10.99:53306/ebtp_mall_project?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: false + + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + serialization: + write-dates-as-timestamps: false + + # 天宫Kafka增加了安全认证,需要配置安全属性 + kafka: + bootstrap-servers: 10.172.48.110:32050,10.172.48.109:32050,10.172.48.111:32050 + template: + default-topic: jl_eshop + + # 生产者配置参数 + 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="eshop-kafka" password="Unicom#135"; + + # 消费者配置参数 + 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="eshop-kafka" password="Unicom#135"; + + # 生产区 redis 配置 + redis: + sentinel: + master: mymaster + nodes: 10.60.161.59:26379, 10.60.161.59:26380, 10.60.161.59:26381 + password: pass + + +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-not-delete-value: normal # 逻辑删除标记:正常数据 + logic-delete-value: deleted # 逻辑删除标记:已删除的数据 + type-aliases-package: com.chinaunicom.mall.ebtp.project + +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: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 #终端ID + datacenter-id: 1 #数据中心ID + host-name: http://10.238.25.112/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query: biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps: biz-service-ebtp-resps #标段应答文件 + service-name-rsms: biz-service-ebtp-rsms #评审微服务 + service-name-tender: biz-service-ebtp-tender #标段投标微服务 + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml new file mode 100644 index 0000000..f2337cc --- /dev/null +++ b/src/main/resources/application-sim.yml @@ -0,0 +1,176 @@ +server: + port: 18012 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + sys-manager-ebtp-project-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/eureka + +# 对应 apollo 配置中心的应用名 +app: + id: sys-manager-ebtp-project + +# Apollo 配置信息 +apollo: + meta: http://10.242.31.54:6001 + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: sys-manager-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + jdbc-url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=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: false + + 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.24:32002,10.125.164.192:32096,10.125.164.89:32002 + template: + default-topic: jl_eshop + + # 生产者配置参数 + 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="eshop-kafka-sim" password="Unicom#135"; + + # 消费者配置参数 + 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="eshop-kafka-sim" password="Unicom#135"; + + # 生产区 redis 配置 + redis: + sentinel: + master: eshop-redis-sim + nodes: 10.125.164.24:32510,10.125.164.90:32515,10.125.164.89:32516 + password: Unicom#135 + +# 天宫Eureka配置 +eureka: + client: + service-url: + defaultZone: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/eureka + instance: + prefer-ip-address: true + instance-ip: ${spring.cloud.client.ip-address}:${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-not-delete-value: normal # 逻辑删除标记:正常数据 + logic-delete-value: deleted # 逻辑删除标记:已删除的数据 + type-aliases-package: com.chinaunicom.mall.ebtp.project + +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: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 #终端ID + datacenter-id: 1 #数据中心ID + host-name: http://10.242.31.54/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query: biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps: biz-service-ebtp-resps #标段应答文件 + service-name-rsms: biz-service-ebtp-rsms #评审微服务 + service-name-tender: biz-service-ebtp-tender #标段投标微服务 + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" \ No newline at end of file diff --git a/src/main/resources/application-uat.yml b/src/main/resources/application-uat.yml new file mode 100644 index 0000000..a850462 --- /dev/null +++ b/src/main/resources/application-uat.yml @@ -0,0 +1,177 @@ +server: + port: 18012 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + sys-manager-ebtp-project-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka + +# 对应 apollo 配置中心的应用名 +app: + id: sys-manager-ebtp-project + +# Apollo 配置信息 +apollo: + meta: http://apollo-configservice:8080/ + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: sys-manager-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + jdbc-url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true + url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=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: false + + 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://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka + instance: + prefer-ip-address: true + instance-ip: ${spring.cloud.client.ip-address}:${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-not-delete-value: normal # 逻辑删除标记:正常数据 + logic-delete-value: deleted # 逻辑删除标记:已删除的数据 + type-aliases-package: com.chinaunicom.mall.ebtp.project + +hystrix: + command: + default: + execution: + timeout: + enabled: true + isolation: + strategy: SEMAPHORE + thread: + timeoutInMilliseconds: 200000 #熔断超时时间 + circuitBreaker: + sleepWindowInMilliseconds: 200000 + forceClosed: true + +ribbon: + ReadTimeout: 200000 #请求处理的超时时间 + ConnectTimeout: 200000 #请求连接超时时间 + MaxAutoRetries: 0 #对当前实例的重试次数 + MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 + +mconfig: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 #终端ID + datacenter-id: 1 #数据中心ID + host-name: http://10.242.31.158/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query: biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps: biz-service-ebtp-resps #标段应答文件 + service-name-rsms: biz-service-ebtp-rsms #评审微服务 + service-name-tender: biz-service-ebtp-tender #标段投标微服务 + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..6baa157 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,127 @@ +# 对应 apollo 配置中心的应用名 +app: + id: sys_manager_ebtp_project + +# Apollo 配置信息 +apollo: + bootstrap: + enabled: true + namespace: application + +spring: + profiles: + active: master + +jasypt: + encryptor: + bean: stringEncryptor + +client: + notification-url: 1 + clientHttpUrl: 1 + +check: + porject: + num-value: 1 + name-value: 1 + length: 1 + checkBoolen: 1 + + +user: + auth: + resource: + serviceId:mall-auth: 1 + + + +unifast: + sso: + getCode: + url: 1 + redirectUrl: 1 + clientId: 1 + public-key: 1 + +jury: + loginCheck: + privateKey: 1 + +message: + privateKey: 1 + callBackUrl: 1 + appCode: 1 + checkVerifycodeHttpUrl: 1 + sendVerifycodeHttpUrl: 1 + +oss: + bucketName: 1 + accessKeySecret: 1 + accessKeyId: 1 + endpoint: 1 + +KingSoftWps: + downloadUrl: 1 + downloadUrl2: 1 + publicKey: 1 + privateKey: 1 + host: 1 + time_limit: 1 + kswpsurl: 1 + kswpsurl-preview: 1 + tempDocFileId: 1 + + + +mconfig: + rsa: + field: + pivate_key: 1 + wps: + bss: + appTokenUrl: 1 + previewUrl: 1 + editUrl: 1 + url: + appTokenUrl: 1 + previewUrl: 1 + downFileUrl: 1 + editUrl: 1 + bssAppId: 1 + bssAppSecret: 1 + bssAppUrl: 1 + appid: 1 + appKey: 1 + + bss: + app-url: 1 + app-url-test: 1 + app-secret: 1 + app-id: 1 + feign: + name: + usercenter: 1 + tender: 1 + rsms: 1 + strategy-center: 1 + resps: 1 + project: 2 + process: 1 + notification: 1 + documentcenter: 2 + service-name-wfap: 1 + service-price-usercenter: 1 + service-price-query: 1 + service-name-notification: 1 + service-name-resu: 1 + service-name-purp: 1 + service-name-tender: 1 + service-name-rsms: 1 + service-name-resps: 1 + service-name-proces: 1 + service-name-open: 1 + service-name-bid: 1 + service-name-evaluation: 1 + service-name-calibration: 1 + service-name-auction: 1 + service-name-archive: 1 diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..0f35ed8 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,50 @@ + + + + + + + ${logback.appname} + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} ${MY_POD_IP} %contextName [%thread] %-5level %logger{50}  - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n + + + + + + + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.log + + + + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.%d{yyyy-MM-dd}.log + + 3 + + true + + + + + + UTF-8 + %d ${MY_POD_IP} [%thread] %-5level %logger{64} %line - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n + + + + + + + + + + + diff --git a/src/main/resources/swagger-configuration.properties b/src/main/resources/swagger-configuration.properties new file mode 100644 index 0000000..18fa96b --- /dev/null +++ b/src/main/resources/swagger-configuration.properties @@ -0,0 +1,7 @@ +unifast.swagger.basePackage=com.chinaunicom.mall.ebtp.project +unifast.swagger.title=\u6D4B\u8BD5\u63A5\u53E3\u6587\u6863 +unifast.swagger.contactName=\u5409\u6797\u9879\u76EE\u7EC4 +unifast.swagger.contactUrl=http://chinaunicom.com +unifast.swagger.contactEmail=chinaunicom@chinaunicom.com +unifast.swagger.version=0.0.1 +unifast.swagger.description=\u8BC4\u5BA1\u7ED3\u6784\u5316\u670D\u52A1 \ No newline at end of file