liwh преди 1 година
родител
ревизия
df442171c4
променени са 17 файла, в които са добавени 1533 реда и са изтрити 0 реда
  1. BIN
      transform-service/lib/apione-http-client-1.0.3-RELEASE.jar
  2. 76 0
      transform-service/pom.xml
  3. 15 0
      transform-service/src/main/java/cn/com/taiji/transform/TransformServiceApplication.java
  4. 17 0
      transform-service/src/main/java/cn/com/taiji/transform/config/CsbConfig.java
  5. 227 0
      transform-service/src/main/java/cn/com/taiji/transform/controller/TransformController.java
  6. 16 0
      transform-service/src/main/java/cn/com/taiji/transform/model/CodeEnum.java
  7. 40 0
      transform-service/src/main/java/cn/com/taiji/transform/model/CsbInvokeDto.java
  8. 52 0
      transform-service/src/main/java/cn/com/taiji/transform/model/Result.java
  9. 21 0
      transform-service/src/main/java/cn/com/taiji/transform/service/IApiOneCsbHttpService.java
  10. 11 0
      transform-service/src/main/java/cn/com/taiji/transform/service/ITransformService.java
  11. 108 0
      transform-service/src/main/java/cn/com/taiji/transform/service/impl/ApiOneCsbHttpServiceImpl.java
  12. 77 0
      transform-service/src/main/java/cn/com/taiji/transform/service/impl/TransformServiceImpl.java
  13. 652 0
      transform-service/src/main/java/cn/com/taiji/transform/util/RestTemplateUtils.java
  14. 4 0
      transform-service/src/main/resources/application-test.properties
  15. 9 0
      transform-service/src/main/resources/application.yml
  16. 100 0
      transform-service/src/main/resources/logback.xml
  17. 108 0
      transform-service/transform-service.iml

BIN
transform-service/lib/apione-http-client-1.0.3-RELEASE.jar


+ 76 - 0
transform-service/pom.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>data-service</artifactId>
+        <groupId>cn.com.taiji</groupId>
+        <version>1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>transform-service</artifactId>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.60</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.20</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.19</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.com.digitalhainan</groupId>
+            <artifactId>apione-http-client</artifactId>
+            <version>1.0.3-RELEASE</version>
+            <scope>system</scope>
+            <systemPath>${pom.basedir}/lib/apione-http-client-1.0.3-RELEASE.jar</systemPath>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <!--将scope 为 system的本地jar包也加入到打包jar中-->
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+
+</project>

+ 15 - 0
transform-service/src/main/java/cn/com/taiji/transform/TransformServiceApplication.java

@@ -0,0 +1,15 @@
+package cn.com.taiji.transform;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+public class TransformServiceApplication {
+
+    public static void main(String[] args) {
+
+        SpringApplication.run(TransformServiceApplication.class, args);
+    }
+
+}

+ 17 - 0
transform-service/src/main/java/cn/com/taiji/transform/config/CsbConfig.java

@@ -0,0 +1,17 @@
+package cn.com.taiji.transform.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Data
+public class CsbConfig {
+
+    @Value("${digital.csbUrl}")
+    private  String csbUrl;
+
+    @Value("${digital.region}")
+    private  String csbRegion;
+
+}

+ 227 - 0
transform-service/src/main/java/cn/com/taiji/transform/controller/TransformController.java

@@ -0,0 +1,227 @@
+package cn.com.taiji.transform.controller;
+
+import cn.com.taiji.transform.model.CsbInvokeDto;
+import cn.com.taiji.transform.model.Result;
+import cn.com.taiji.transform.service.ITransformService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * csb服务代理控制器
+ *
+ * @author makejava
+ * @since 2021-04-22 16:53:35
+ */
+@Slf4j
+@RestController
+public class TransformController {
+
+    @Autowired
+    private ITransformService transformService;
+
+
+    /**
+     * csb服务代理调用
+     * @param csbInvokeObject
+     */
+    @PostMapping("/csbInvoke")
+    public Result csbInvoke(@RequestBody JSONObject csbInvokeObject) throws Exception {
+
+
+        CsbInvokeDto csbInvokeDto = new CsbInvokeDto();
+
+        Result result = Result.of(null,0,"操作成功!");
+
+        int resp_code =0;
+
+        Map<String, Object> params = new HashMap<String, Object>();
+
+        StringBuffer stringBuffer = new StringBuffer();
+
+
+        if(!csbInvokeObject.containsKey("csbAk")){
+
+            stringBuffer.append("没有找到accessKey凭证csbAk参数");
+            resp_code=2;
+
+        }else{
+
+            String csbAk = csbInvokeObject.getString("csbAk");
+
+            if("".equals(csbAk) || csbAk == null){
+
+                stringBuffer.append("accessKey凭证csbAk参数的值为空或者为null");
+                resp_code=2;
+
+            }else{
+
+                csbInvokeDto.setCsbAk(csbAk);
+
+            }
+
+        }
+
+        if(!csbInvokeObject.containsKey("csbSk")){
+
+            stringBuffer.append("没有找到secretKey凭证csbSk参数");
+            resp_code=2;
+
+        }else{
+
+            String csbSk = csbInvokeObject.getString("csbSk");
+
+            if("".equals(csbSk) || csbSk == null){
+
+                stringBuffer.append("secretKey凭证csbSk参数的值为空或者为null");
+                resp_code=2;
+
+            }else{
+
+                csbInvokeDto.setCsbSk(csbSk);
+
+            }
+
+        }
+
+        if(!csbInvokeObject.containsKey("csbApi")){
+
+            stringBuffer.append("没有找到接口名称csbApi参数");
+            resp_code=2;
+
+        }else{
+
+            String csbApi = csbInvokeObject.getString("csbApi");
+
+            if("".equals(csbApi) || csbApi == null){
+
+                stringBuffer.append("接口名称csbApi参数的值为空或者为null");
+                resp_code=2;
+
+            }else{
+
+                csbInvokeDto.setCsbApi(csbApi);
+
+            }
+
+        }
+
+        if(!csbInvokeObject.containsKey("csbMethod")){
+
+            stringBuffer.append("没有找到bjId参数");
+            resp_code=2;
+
+        }else{
+
+            String csbMethod = csbInvokeObject.getString("csbMethod");
+
+            if("".equals(csbMethod) || csbMethod == null){
+
+                stringBuffer.append("接口请求类型csbMethod参数的值为空或者为null");
+                resp_code=2;
+
+            }else{
+
+                if(!"get".equals(csbMethod.toLowerCase()) && !"post".equals(csbMethod.toLowerCase())){
+
+                    stringBuffer.append("接口请求类型参数的值为get、post的一种");
+                    resp_code=2;
+
+                }else{
+
+                    csbInvokeDto.setCsbMethod(csbMethod);
+
+                }
+
+            }
+
+        }
+
+        if(!csbInvokeObject.containsKey("reqJsonStr")){
+
+            stringBuffer.append("没有找到请求体reqJsonStr参数数据json字符串参数");
+            resp_code=2;
+
+        }else{
+
+            JSONObject reqJsonObject = csbInvokeObject.getJSONObject("reqJsonStr");
+
+            if(reqJsonObject.isEmpty() || reqJsonObject == null){
+
+                stringBuffer.append("请求体reqJsonStr参数数据json字符串数据为空或者为null");
+                resp_code=2;
+
+            }else{
+
+                csbInvokeDto.setReqJsonStr(reqJsonObject.toJSONString());
+
+            }
+
+        }
+
+        if(csbInvokeObject.containsKey("headerJson")){
+
+            JSONObject headerJsonObject = csbInvokeObject.getJSONObject("headerJson");
+
+            if(!headerJsonObject.isEmpty() && headerJsonObject != null){
+
+                csbInvokeDto.setHeaderJson(headerJsonObject.toJSONString());
+
+            }
+
+
+
+        }
+
+
+        StringBuffer errResult = new StringBuffer();
+
+        StringBuffer sucessResult = new StringBuffer();
+
+
+        if(resp_code ==0){
+
+            result = transformService.csbInvoke(csbInvokeDto);
+
+        }else{
+
+            result = Result.of(null,-2,errResult.toString());
+
+        }
+
+
+        StringBuffer resultStr = new StringBuffer();
+
+        if(sucessResult.length() >0){
+
+            resultStr.append(sucessResult.toString());
+
+        }
+
+        if(errResult.length() >0){
+
+            resultStr.append(errResult.toString());
+
+        }
+
+        if(resultStr.length()>0){
+
+            result = Result.of(null,0,resultStr.toString());
+
+        }
+
+
+        return result;
+
+    }
+
+
+
+}

+ 16 - 0
transform-service/src/main/java/cn/com/taiji/transform/model/CodeEnum.java

@@ -0,0 +1,16 @@
+package cn.com.taiji.transform.model;
+
+public enum CodeEnum {
+
+    SUCCESS(1),
+    ERROR(-1);
+
+    private Integer code;
+    CodeEnum(Integer code){
+        this.code = code;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+}

+ 40 - 0
transform-service/src/main/java/cn/com/taiji/transform/model/CsbInvokeDto.java

@@ -0,0 +1,40 @@
+package cn.com.taiji.transform.model;
+
+import lombok.Data;
+
+
+@Data
+public class CsbInvokeDto {
+
+    /**
+     * accessKey凭证
+     */
+    private  String csbAk;
+
+    /**
+     * secretKey凭证
+     */
+    private  String csbSk;
+
+    /**
+     * 接口名称
+     */
+    private  String csbApi;
+
+    /**
+     * 接口请求类型get、post
+     */
+    private  String csbMethod;
+
+    /**
+     * 请求体参数数据json字符串
+     */
+    private String reqJsonStr;
+
+    /**
+     * 请求头参数数据json字符串
+     */
+    private String headerJson;
+
+
+}

+ 52 - 0
transform-service/src/main/java/cn/com/taiji/transform/model/Result.java

@@ -0,0 +1,52 @@
+package cn.com.taiji.transform.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Result<T> implements Serializable {
+
+    private T datas;
+
+    //1成功 2成功,但没有找到数据 -1失败 -2 接口参数校验不通过
+    private Integer resp_code;
+
+    private String resp_msg;
+
+    public static <T> Result<T> succeed(String msg) {
+        return of(null, CodeEnum.SUCCESS.getCode(), msg);
+    }
+
+    public static <T> Result<T> succeed(T model, String msg) {
+        return of(model, CodeEnum.SUCCESS.getCode(), msg);
+    }
+
+    public static <T> Result<T> succeed(T model) {
+        return of(model, CodeEnum.SUCCESS.getCode(), "");
+    }
+
+    public static <T> Result<T> of(T datas, Integer code, String msg) {
+        return new Result<>(datas, code, msg);
+    }
+
+    public static <T> Result<T> of(T datas, Integer code) {
+        return new Result<>(datas, code, "");
+    }
+
+    public static <T> Result<T> failed(String msg) {
+        return of(null, CodeEnum.ERROR.getCode(), msg);
+    }
+
+    public static <T> Result<T> failed(T model) {
+        return of(model, CodeEnum.ERROR.getCode(), "");
+    }
+
+    public static <T> Result<T> failed(T model, String msg) {
+        return of(model, CodeEnum.ERROR.getCode(), msg);
+    }
+}

+ 21 - 0
transform-service/src/main/java/cn/com/taiji/transform/service/IApiOneCsbHttpService.java

@@ -0,0 +1,21 @@
+package cn.com.taiji.transform.service;
+
+import cn.com.digitalhainan.apione.sdk.HttpReturn;
+import cn.com.taiji.transform.config.CsbConfig;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IApiOneCsbHttpService {
+
+    /**
+     * ApiOne csb调用服务接口
+     * @param
+     * @return
+     */
+    HttpReturn csbCall(String csbUrl, String csbAk,String csbSk,String csbRegion,
+                       String apiName, String method,
+                       String paramsJson, String headerJson);
+
+
+}

+ 11 - 0
transform-service/src/main/java/cn/com/taiji/transform/service/ITransformService.java

@@ -0,0 +1,11 @@
+package cn.com.taiji.transform.service;
+
+import cn.com.taiji.transform.model.CsbInvokeDto;
+import cn.com.taiji.transform.model.Result;
+
+public interface ITransformService {
+
+    Result csbInvoke(CsbInvokeDto csbInvokeDto);
+
+
+}

+ 108 - 0
transform-service/src/main/java/cn/com/taiji/transform/service/impl/ApiOneCsbHttpServiceImpl.java

@@ -0,0 +1,108 @@
+package cn.com.taiji.transform.service.impl;
+
+import cn.com.digitalhainan.apione.sdk.ContentBody;
+import cn.com.digitalhainan.apione.sdk.HttpCaller;
+import cn.com.digitalhainan.apione.sdk.HttpParameters;
+import cn.com.digitalhainan.apione.sdk.HttpReturn;
+import cn.com.taiji.transform.service.IApiOneCsbHttpService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class ApiOneCsbHttpServiceImpl implements IApiOneCsbHttpService {
+
+    public HttpReturn csbCall(String csbUrl, String csbAk,String csbSk,String csbRegion,
+                              String apiName, String method,
+                              String reqJson, String headerJson)  {
+
+
+        HttpReturn result = null;
+
+
+        ContentBody contentBody = new ContentBody(reqJson);
+
+
+        Map<String, String> query = new HashMap<String, String>();
+
+        if ("get".equals(method.toLowerCase()) && !"".equals(reqJson) && reqJson != null) {
+
+            JSONObject jsonObject = JSONObject.parseObject(reqJson);
+
+            for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
+
+                query.put(entry.getKey(), String.valueOf(entry.getValue()));
+
+            }
+        }
+
+        Map<String, String> headerMap = new HashMap<String, String>();
+
+        if (!"".equals(headerJson) && headerJson != null) {
+
+            JSONObject headerObject = JSONObject.parseObject(headerJson);
+
+            for (Map.Entry<String, Object> entry : headerObject.entrySet()) {
+
+                query.put(entry.getKey(), String.valueOf(entry.getValue()));
+
+            }
+        }
+
+        log.info("[url:" + csbUrl + ","
+                + "ak:" + csbAk + ","
+                + "sk:" + csbSk + ","
+                + "api:" + apiName + ","
+                + "region:" + csbRegion + ","
+                + "headers:" + headerJson + ","
+                + "queryParamsMap:" + query + ","
+                + "contentBody:" + reqJson + "]");
+        //拼装业务信息
+        HttpParameters parameters =null;
+
+        if(headerMap.keySet().size() >0){
+
+            parameters = HttpParameters.builder()
+                                       .api(apiName)
+                                       .region(csbRegion)
+                                       .headerParamsMap(headerMap)
+                                       .queryParamsMap(query)
+                                       .accessKey(csbAk)
+                                       .secretKey(csbSk)
+                                       .contentBody(contentBody)
+                                       .requestUrl(csbUrl)
+                                       .build();
+        }else {
+            parameters = HttpParameters.builder()
+                                       .api(apiName)
+                                       .region(csbRegion)
+                                       .queryParamsMap(query)
+                                       .accessKey(csbAk)
+                                       .secretKey(csbSk)
+                                       .contentBody(contentBody)
+                                       .requestUrl(csbUrl)
+                                       .build();
+        }
+
+
+        try {
+
+            //请求开发服务,获取response
+            result = HttpCaller.getInstance().call(parameters);
+
+        } catch (Exception  exception) {
+
+            exception.printStackTrace();
+
+            log.error(exception.getMessage(),exception.getCause());
+
+        }
+
+        return result;
+    }
+
+}

+ 77 - 0
transform-service/src/main/java/cn/com/taiji/transform/service/impl/TransformServiceImpl.java

@@ -0,0 +1,77 @@
+package cn.com.taiji.transform.service.impl;
+
+import cn.com.digitalhainan.apione.sdk.HttpReturn;
+import cn.com.taiji.transform.config.CsbConfig;
+import cn.com.taiji.transform.model.CsbInvokeDto;
+import cn.com.taiji.transform.model.Result;
+import cn.com.taiji.transform.service.IApiOneCsbHttpService;
+import cn.com.taiji.transform.service.ITransformService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+
+@Slf4j
+@Service
+public class TransformServiceImpl implements ITransformService {
+
+    @Autowired
+    private IApiOneCsbHttpService apiOneCsbHttpService;
+
+    @Autowired
+    private CsbConfig csbConfig;
+
+    /**
+     * csb服务代理调用
+     * @param csbInvokeDto
+     * @return
+     */
+    @Override
+    public Result csbInvoke(CsbInvokeDto csbInvokeDto) {
+
+
+        HttpReturn remoteResult =  apiOneCsbHttpService.csbCall(csbConfig.getCsbUrl(), csbInvokeDto.getCsbAk(),csbInvokeDto.getCsbSk(),csbConfig.getCsbRegion(),
+                csbInvokeDto.getCsbApi(), csbInvokeDto.getCsbMethod(),
+                csbInvokeDto.getReqJsonStr(),csbInvokeDto.getHeaderJson());
+
+
+        Result result = Result.of(null,2,"成功,但没有找到数据!");
+
+
+        if(remoteResult !=null){
+
+
+            if(remoteResult.responseHttpStatus == 200){
+
+                result =  Result.of(remoteResult.getResponse(),1,"操作成功!");
+
+            }else{
+
+                String errStr = "远程服务调用失败,"+remoteResult.getResponse();
+
+                if(remoteResult !=null){
+
+                    errStr = errStr+",响应码为:"+remoteResult.responseHttpStatus;
+                }
+
+                result =  Result.of(null,-1,errStr);
+
+            }
+
+            log.info("************************csb服务调用响应码为:"+remoteResult.responseHttpStatus+",响应体:"+remoteResult.getResponse());
+
+
+
+        }else{
+
+            log.info("csb服务调用的HttpReturn为null");
+
+            result =  Result.of(null,-1,"sb服务调用的HttpReturn为null");
+        }
+
+
+
+        return result;
+    }
+}

+ 652 - 0
transform-service/src/main/java/cn/com/taiji/transform/util/RestTemplateUtils.java

@@ -0,0 +1,652 @@
+package cn.com.taiji.transform.util;
+
+import org.springframework.http.*;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+/**
+ * @program: RestTemplateUtils
+ * @description: http调用工具类
+ * @author: liwh
+ * @date: 2020/06/09 17:26:00
+ */
+public class RestTemplateUtils {
+
+    private static final RestTemplate restTemplate = new RestTemplate();
+
+    // ----------------------------------GET-------------------------------------------------------
+
+    /**
+     * GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, Class<T> responseType) {
+        return restTemplate.getForEntity(url, responseType);
+    }
+
+    /**
+     * GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.getForEntity(url, responseType, uriVariables);
+    }
+
+    /**
+     * GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.getForEntity(url, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, Map<String, String> headers, Class<T> responseType, Object... uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return get(url, httpHeaders, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, HttpHeaders headers, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+        return exchange(url, HttpMethod.GET, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, Map<String, String> headers, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return get(url, httpHeaders, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的GET请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> get(String url, HttpHeaders headers, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+        return exchange(url, HttpMethod.GET, requestEntity, responseType, uriVariables);
+    }
+
+    // ----------------------------------POST-------------------------------------------------------
+
+    /**
+     * POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param formDatas form-data请求参数体
+     * @param responseType 返回对象类型
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> postFormData(String url, Map<String,String> formDatas, Class<T> responseType) {
+
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+
+        MultiValueMap<String, String> formDataMaps= new LinkedMultiValueMap<String, String>();
+
+        for (Map.Entry<String, String> entry : formDatas.entrySet()) {
+
+            String mapKey = entry.getKey();
+            String mapValue = entry.getValue();
+
+            formDataMaps.add(mapKey,mapValue);
+        }
+
+
+        HttpEntity<MultiValueMap<String, String>> requestParams = new HttpEntity<>(formDataMaps, headers);
+
+        return restTemplate.postForEntity(url, requestParams, responseType);
+    }
+
+    /**
+     * POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @return
+     */
+    public static <T> ResponseEntity<T> post(String url, Class<T> responseType) {
+        return restTemplate.postForEntity(url, HttpEntity.EMPTY, responseType);
+    }
+
+    /**
+     * POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType) {
+        return restTemplate.postForEntity(url, requestBody, responseType);
+    }
+
+    /**
+     * POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.postForEntity(url, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.postForEntity(url, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return post(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return post(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return post(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return post(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的POST请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> post(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
+    }
+
+    // ----------------------------------PUT-------------------------------------------------------
+
+    /**
+     * PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, Class<T> responseType, Object... uriVariables) {
+        return put(url, HttpEntity.EMPTY, responseType, uriVariables);
+    }
+
+    /**
+     * PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
+        return put(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
+        return put(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return put(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return put(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return put(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return put(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.PUT, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的PUT请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> put(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.PUT, requestEntity, responseType, uriVariables);
+    }
+
+    // ----------------------------------DELETE-------------------------------------------------------
+
+    /**
+     * DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Class<T> responseType, Object... uriVariables) {
+        return delete(url, HttpEntity.EMPTY, responseType, uriVariables);
+    }
+
+    /**
+     * DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Class<T> responseType, Map<String, ?> uriVariables) {
+        return delete(url, HttpEntity.EMPTY, responseType, uriVariables);
+    }
+
+    /**
+     * DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Class<T> responseType, Object... uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return delete(url, httpHeaders, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(headers);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return delete(url, httpHeaders, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(headers);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return delete(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, Map<String, String> headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAll(headers);
+        return delete(url, httpHeaders, requestBody, responseType, uriVariables);
+    }
+
+    /**
+     * 带请求头的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param headers 请求头参数
+     * @param requestBody 请求参数体
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String, ?> uriVariables) {
+        HttpEntity<Object> requestEntity = new HttpEntity<Object>(requestBody, headers);
+        return delete(url, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 自定义请求头和请求体的DELETE请求调用方式
+     *
+     * @param url 请求URL
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> delete(String url, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, responseType, uriVariables);
+    }
+
+    // ----------------------------------通用方法-------------------------------------------------------
+
+    /**
+     * 通用调用方式
+     *
+     * @param url 请求URL
+     * @param method 请求方法类型
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,按顺序依次对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) {
+        return restTemplate.exchange(url, method, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 通用调用方式
+     *
+     * @param url 请求URL
+     * @param method 请求方法类型
+     * @param requestEntity 请求头和请求体封装对象
+     * @param responseType 返回对象类型
+     * @param uriVariables URL中的变量,与Map中的key对应
+     * @return ResponseEntity 响应对象封装类
+     */
+    public static <T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) {
+        return restTemplate.exchange(url, method, requestEntity, responseType, uriVariables);
+    }
+
+    /**
+     * 获取RestTemplate实例对象,可自由调用其方法
+     *
+     * @return RestTemplate实例对象
+     */
+    public static RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+}

+ 4 - 0
transform-service/src/main/resources/application-test.properties

@@ -0,0 +1,4 @@
+#csb的配置信息
+digital.csbUrl=https://api-one.digitalhainan.com.cn/apione
+digital.region=INTRA
+

+ 9 - 0
transform-service/src/main/resources/application.yml

@@ -0,0 +1,9 @@
+server:
+  port: 8099
+  servlet:
+    encoding:
+      force: true
+      charset: UTF-8
+spring:
+  profiles:
+    active: test

+ 100 - 0
transform-service/src/main/resources/logback.xml

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
+<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
+<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
+<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
+<configuration scan="true" scanPeriod="10 seconds">
+
+    <contextName>logback</contextName>
+    <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
+    <!-- <springProperty scope="context" name="log.path" source="spring.application.name"/> -->
+    <property name="log.path" value="log" />
+
+    <!-- 彩色日志(IDE下载插件才可以生效) -->
+    <!-- 彩色日志依赖的渲染类 -->
+    <conversionRule conversionWord="clr"
+                    converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+    <conversionRule conversionWord="wex"
+                    converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+    <conversionRule conversionWord="wEx"
+                    converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+    <!-- 彩色日志格式 -->
+    <property name="CONSOLE_LOG_PATTERN"
+              value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
+
+    <!--输出到控制台 -->
+    <appender name="CONSOLE"
+              class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
+            <!-- 设置字符集 -->
+            <charset>UTF-8</charset>
+        </encoder>
+    </appender>
+
+    <!--输出到文件 -->
+
+    <!-- 时间滚动输出 level为 ERROR 日志 -->
+    <appender name="ERROR_FILE"
+              class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${log.path}/csbInvoke-error.log</file>
+        <!--日志文件输出格式 -->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} -
+                %msg%n</pattern>
+            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy
+                class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/error/csbInvoke-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>100MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文件保留天数 -->
+            <maxHistory>5</maxHistory>
+        </rollingPolicy>
+        <!-- 此日志文件只记录ERROR级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <appender name="TAIJI_FILE"
+              class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${log.path}/csbInvoke.log</file>
+        <!--日志文件输出格式 -->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} -
+                %msg%n</pattern>
+            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy
+                class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/taiji/log-push-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>100MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文件保留天数 -->
+            <maxHistory>2</maxHistory>
+        </rollingPolicy>
+    </appender>
+
+    <root level="info">
+        <appender-ref ref="CONSOLE" />
+        <appender-ref ref="ERROR_FILE" />
+    </root>
+
+    <logger name="cn.com.taiji" level="DEBUG">
+        <appender-ref ref="TAIJI_FILE"/>
+    </logger>
+</configuration>

+ 108 - 0
transform-service/transform-service.iml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="CheckStyle-IDEA-Module">
+    <option name="configuration">
+      <map />
+    </option>
+  </component>
+  <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
+    <facet type="web" name="Web">
+      <configuration>
+        <webroots />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
+    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.20" level="project" />
+    <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.19" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.5.5" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
+    <orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.1.3" level="project" />
+    <orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" />
+    <orderEntry type="library" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.5.5" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.16" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.16" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.16" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.5.RELEASE" level="project" />
+    <orderEntry type="module-library">
+      <library name="Maven: cn.com.digitalhainan:apione-http-client:1.0.3-RELEASE">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/apione-http-client-1.0.3-RELEASE.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.hikvision.ga:artemis-http-client:1.1.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.7" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.1.4.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-common:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.33.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.2.6.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.kafka:spring-kafka:2.2.4.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.4.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.kafka:kafka-clients:2.0.1" level="project" />
+    <orderEntry type="library" name="Maven: org.lz4:lz4-java:1.4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.7.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
+  </component>
+</module>