Browse Source

Merge branch 'sprint/s4' into develop

develop
董书康 8 months ago
parent
commit
a1a1ed606a
7 changed files with 15 additions and 81 deletions
  1. +8
    -8
      .drone.yml
  2. +0
    -1
      Makefile
  3. +1
    -1
      VERSION
  4. +0
    -66
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java
  5. +4
    -3
      demo-athenaopt_backend/pom.xml
  6. +1
    -1
      version_control/APP_VERSION
  7. +1
    -1
      version_control/BUILD

+ 8
- 8
.drone.yml View File

@ -9,7 +9,7 @@ steps:
# 应用专案名称(需手动修改) # 应用专案名称(需手动修改)
backendName: demo-athenaopt_backend backendName: demo-athenaopt_backend
# 平台API版本号(需手动修改) # 平台API版本号(需手动修改)
apiVersion: 5.2.0.1029
apiVersion: 5.2.0.1086
commands: commands:
# 在开发根目录下执行 maven package 指令以构建运行包 # 在开发根目录下执行 maven package 指令以构建运行包
- mvn -f $backendName/pom.xml package -Dapi.version=$apiVersion -Dnexus.ip=https://repo.digiwincloud.com.cn/maven - mvn -f $backendName/pom.xml package -Dapi.version=$apiVersion -Dnexus.ip=https://repo.digiwincloud.com.cn/maven
@ -25,7 +25,7 @@ steps:
branch: branch:
# - develop # - develop
# - master # - master
- release/S3
- release/s4
event: event:
- push - push
### 应用版本控制:检查版本文件,若不存在则自动创建,并自动递增版本号 ### 应用版本控制:检查版本文件,若不存在则自动创建,并自动递增版本号
@ -38,14 +38,14 @@ steps:
- sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories - sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
- apk add tree --no-cache - apk add tree --no-cache
- tree ./$backendName - tree ./$backendName
- make branch=release/S3 vc
- make branch=release/s4 vc
# - make branch=master vc # - make branch=master vc
when: when:
status: [ success ] status: [ success ]
branch: branch:
# - develop # - develop
# - master # - master
- release/S3
- release/s4
event: event:
- push - push
### 打包镜像并推送到镜像仓库 ### 打包镜像并推送到镜像仓库
@ -76,27 +76,27 @@ steps:
branch: branch:
# - develop # - develop
# - master # - master
- release/S3
- release/s4
### 应用版本控制:提交版本文件的修改记录,并为代码分支创建版本号标签 ### 应用版本控制:提交版本文件的修改记录,并为代码分支创建版本号标签
- name: Upload Version - name: Upload Version
image: registry.digiwincloud.com.cn/base/base_vc image: registry.digiwincloud.com.cn/base/base_vc
commands: commands:
# - make branch=develop to_git # - make branch=develop to_git
# - make branch=master to_git # - make branch=master to_git
- make branch=release/S3 to_git
- make branch=release/s4 to_git
when: when:
status: [ success ] status: [ success ]
branch: branch:
# - develop # - develop
# - master # - master
- release/S3
- release/s4
event: event:
- push - push
trigger: trigger:
branch: branch:
# - develop # - develop
# - master # - master
- release/S3
- release/s4
event: event:
- push - push
volumes: volumes:


+ 0
- 1
Makefile View File

@ -53,4 +53,3 @@ vc:
@make -C version_control branch=$$branch @make -C version_control branch=$$branch
to_git: to_git:
@make -C version_control branch=$$branch commit_record @make -C version_control branch=$$branch commit_record
@make -C version_control branch=$$branch add_tag

+ 1
- 1
VERSION View File

@ -1 +1 @@
1.0.2
1.0.4

+ 0
- 66
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java View File

@ -1,66 +0,0 @@
package com.digiwin.athena.app.infra.common.utils;
import com.digiwin.app.container.exceptions.DWRuntimeException;
import net.sf.cglib.beans.BeanCopier;
import net.sf.cglib.beans.BeanMap;
import org.springframework.objenesis.ObjenesisStd;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public final class BeanCopyUtil {
private BeanCopyUtil() {
}
private static ThreadLocal<ObjenesisStd> objenesisStdThreadLocal = ThreadLocal.withInitial(ObjenesisStd::new);
private static ConcurrentHashMap<Class<?>, ConcurrentHashMap<Class<?>, BeanCopier>> cache = new ConcurrentHashMap<>();
public static <T> T copy(Object source, Class<T> target) {
return copy(source, objenesisStdThreadLocal.get().newInstance(target));
}
public static <T> T copy(Object source, T target) {
BeanCopier beanCopier = getCacheBeanCopier(source.getClass(), target.getClass());
beanCopier.copy(source, target, null);
return target;
}
public static <T> List<T> copyList(List<?> sources, Class<T> target) {
if (sources.isEmpty()) {
return Collections.emptyList();
}
ArrayList<T> list = new ArrayList<>(sources.size());
ObjenesisStd objenesisStd = objenesisStdThreadLocal.get();
for (Object source : sources) {
if (source == null) {
throw new DWRuntimeException("转换异常");
}
T newInstance = objenesisStd.newInstance(target);
BeanCopier beanCopier = getCacheBeanCopier(source.getClass(), target);
beanCopier.copy(source, newInstance, null);
list.add(newInstance);
}
return list;
}
public static <T> T mapToBean(Map<?, ?> source, Class<T> target) {
T bean = objenesisStdThreadLocal.get().newInstance(target);
BeanMap beanMap = BeanMap.create(bean);
beanMap.putAll(source);
return bean;
}
public static <T> Map<?, ?> beanToMap(T source) {
return BeanMap.create(source);
}
private static <S, T> BeanCopier getCacheBeanCopier(Class<S> source, Class<T> target) {
ConcurrentHashMap<Class<?>, BeanCopier> copierConcurrentHashMap = cache.computeIfAbsent(source, aClass -> new ConcurrentHashMap<>(16));
return copierConcurrentHashMap.computeIfAbsent(target, aClass -> BeanCopier.create(source, target, false));
}
}

+ 4
- 3
demo-athenaopt_backend/pom.xml View File

@ -32,16 +32,17 @@
<nexus.ip>https://repo.digiwincloud.com.cn/maven</nexus.ip> <nexus.ip>https://repo.digiwincloud.com.cn/maven</nexus.ip>
<revision>1.1.0.0</revision> <revision>1.1.0.0</revision>
<spring.version>5.0.5.RELEASE</spring.version> <spring.version>5.0.5.RELEASE</spring.version>
<api.version>5.2.0.1029</api.version>
<api.version>5.2.0.1086</api.version>
<dwgson.version>2.8.6</dwgson.version> <dwgson.version>2.8.6</dwgson.version>
<DWQueue.version>1.05</DWQueue.version> <DWQueue.version>1.05</DWQueue.version>
<netty.version>4.1.67.Final</netty.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.digiwin.athena</groupId> <groupId>com.digiwin.athena</groupId>
<artifactId>athena-opt-common</artifactId> <artifactId>athena-opt-common</artifactId>
<version>1.0.105-SNAPSHOT</version>
<version>1.0.107-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.digiwin</groupId> <groupId>com.digiwin</groupId>
@ -66,7 +67,7 @@
<dependency> <dependency>
<groupId>com.digiwin.lcdp</groupId> <groupId>com.digiwin.lcdp</groupId>
<artifactId>lcdp-modeldriven</artifactId> <artifactId>lcdp-modeldriven</artifactId>
<version>1.0.1.2</version>
<version>1.0.1.17</version>
</dependency> </dependency>
<dependency> <dependency>


+ 1
- 1
version_control/APP_VERSION View File

@ -1 +1 @@
1.0.2
1.0.4

+ 1
- 1
version_control/BUILD View File

@ -1 +1 @@
1049
999

Loading…
Cancel
Save