Merge branch 'dev' into test
This commit is contained in:
@@ -422,3 +422,77 @@ spec:
|
|||||||
port: 48100
|
port: 48100
|
||||||
targetPort: 48100
|
targetPort: 48100
|
||||||
nodePort: 30090
|
nodePort: 30090
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
# zt-module-template
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
namespace: ns-d6a0e78ebd674c279614498e4c57b133
|
||||||
|
name: zt-module-template
|
||||||
|
labels:
|
||||||
|
app: zt-module-template
|
||||||
|
annotations:
|
||||||
|
version: "VERSION_PLACEHOLDER"
|
||||||
|
description: DESC_PLACEHOLDER
|
||||||
|
rollout.kubernetes.io/change-cause: "DESC_PLACEHOLDER:VERSION_PLACEHOLDER"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: zt-module-template
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: zt-module-template
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: zt-module-template
|
||||||
|
image: 172.16.46.66:10043/zt/zt-module-template:VERSION_PLACEHOLDER
|
||||||
|
imagePullPolicy: Always
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /actuator/health
|
||||||
|
port: 48100
|
||||||
|
initialDelaySeconds: 50
|
||||||
|
periodSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /actuator/health
|
||||||
|
port: 48100
|
||||||
|
initialDelaySeconds: 50
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 5
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "1024Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "700m"
|
||||||
|
memory: "1024Mi"
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 1
|
||||||
|
maxUnavailable: 0
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
namespace: ns-d6a0e78ebd674c279614498e4c57b133
|
||||||
|
name: zt-module-template
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: zt-module-template
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 48100
|
||||||
|
targetPort: 48100
|
||||||
|
nodePort: 30889
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class DesensitizeTest {
|
|||||||
DesensitizeDemo d = JsonUtils.parseObject(JsonUtils.toJsonString(desensitizeDemo), DesensitizeDemo.class);
|
DesensitizeDemo d = JsonUtils.parseObject(JsonUtils.toJsonString(desensitizeDemo), DesensitizeDemo.class);
|
||||||
// 断言
|
// 断言
|
||||||
assertNotNull(d);
|
assertNotNull(d);
|
||||||
assertEquals("芋***", d.getNickname());
|
assertEquals("Z***", d.getNickname());
|
||||||
assertEquals("998800********31", d.getBankCard());
|
assertEquals("998800********31", d.getBankCard());
|
||||||
assertEquals("粤A6***6", d.getCarLicense());
|
assertEquals("粤A6***6", d.getCarLicense());
|
||||||
assertEquals("0108*****22", d.getFixedPhone());
|
assertEquals("0108*****22", d.getFixedPhone());
|
||||||
|
|||||||
@@ -273,10 +273,10 @@ public class GatewaySecurityFilter extends OncePerRequestFilter {
|
|||||||
|
|
||||||
String signatureType = resolveSignatureType(credential, security);
|
String signatureType = resolveSignatureType(credential, security);
|
||||||
try {
|
try {
|
||||||
// boolean valid = CryptoSignatureUtils.verifySignature(signaturePayload, signatureType);
|
boolean valid = CryptoSignatureUtils.verifySignature(signaturePayload, signatureType);
|
||||||
// if (!valid) {
|
if (!valid) {
|
||||||
// throw new SecurityValidationException(HttpStatus.UNAUTHORIZED, "签名校验失败");
|
throw new SecurityValidationException(HttpStatus.UNAUTHORIZED, "签名校验失败");
|
||||||
// }
|
}
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
throw new SecurityValidationException(HttpStatus.INTERNAL_SERVER_ERROR, "签名算法配置异常");
|
throw new SecurityValidationException(HttpStatus.INTERNAL_SERVER_ERROR, "签名算法配置异常");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,8 +393,13 @@ public class HttpStepHandler implements ApiStepHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean supportsRequestBody(HttpMethod method) {
|
private boolean supportsRequestBody(HttpMethod method) {
|
||||||
// 所有请求都要传递请求体
|
if (method == null) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
return !(HttpMethod.GET.equals(method)
|
||||||
|
|| HttpMethod.HEAD.equals(method)
|
||||||
|
|| HttpMethod.OPTIONS.equals(method)
|
||||||
|
|| HttpMethod.TRACE.equals(method));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Mono<Object> applyResilientRetry(Mono<Object> responseMono, ApiStepDefinition stepDefinition) {
|
private Mono<Object> applyResilientRetry(Mono<Object> responseMono, ApiStepDefinition stepDefinition) {
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ package com.zt.plat.module.databus.controller.admin.gateway;
|
|||||||
|
|
||||||
import com.zt.plat.module.databus.controller.admin.gateway.vo.ApiGatewayInvokeReqVO;
|
import com.zt.plat.module.databus.controller.admin.gateway.vo.ApiGatewayInvokeReqVO;
|
||||||
import com.zt.plat.module.databus.framework.integration.gateway.core.ApiGatewayExecutionService;
|
import com.zt.plat.module.databus.framework.integration.gateway.core.ApiGatewayExecutionService;
|
||||||
|
import com.zt.plat.module.databus.framework.integration.gateway.core.IntegrationFlowManager;
|
||||||
import com.zt.plat.module.databus.framework.integration.gateway.model.ApiGatewayResponse;
|
import com.zt.plat.module.databus.framework.integration.gateway.model.ApiGatewayResponse;
|
||||||
import com.zt.plat.module.databus.framework.integration.config.ApiGatewayProperties;
|
import com.zt.plat.module.databus.framework.integration.config.ApiGatewayProperties;
|
||||||
|
import com.zt.plat.module.databus.framework.integration.gateway.core.ApiGatewayAccessLogger;
|
||||||
|
import com.zt.plat.module.databus.service.gateway.ApiAnonymousUserService;
|
||||||
import com.zt.plat.module.databus.service.gateway.ApiClientCredentialService;
|
import com.zt.plat.module.databus.service.gateway.ApiClientCredentialService;
|
||||||
import com.zt.plat.module.databus.service.gateway.ApiDefinitionService;
|
import com.zt.plat.module.databus.service.gateway.ApiDefinitionService;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -48,8 +51,17 @@ class ApiGatewayControllerTest {
|
|||||||
@MockBean
|
@MockBean
|
||||||
private StringRedisTemplate stringRedisTemplate;
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
|
||||||
@MockBean
|
@MockBean
|
||||||
private ApiClientCredentialService apiClientCredentialService;
|
private IntegrationFlowManager integrationFlowManager;
|
||||||
|
|
||||||
|
@MockBean
|
||||||
|
private ApiClientCredentialService apiClientCredentialService;
|
||||||
|
|
||||||
|
@MockBean
|
||||||
|
private ApiAnonymousUserService apiAnonymousUserService;
|
||||||
|
|
||||||
|
@MockBean
|
||||||
|
private ApiGatewayAccessLogger apiGatewayAccessLogger;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void invokeShouldReturnGatewayEnvelope() throws Exception {
|
void invokeShouldReturnGatewayEnvelope() throws Exception {
|
||||||
|
|||||||
@@ -28,16 +28,10 @@ import java.util.UUID;
|
|||||||
public final class DatabusApiInvocationExample {
|
public final class DatabusApiInvocationExample {
|
||||||
|
|
||||||
public static final String TIMESTAMP = Long.toString(System.currentTimeMillis());
|
public static final String TIMESTAMP = Long.toString(System.currentTimeMillis());
|
||||||
// private static final String APP_ID = "ztmy";
|
private static final String APP_ID = "ztmy";
|
||||||
// private static final String APP_SECRET = "zFre/nTRGi7LpoFjN7oQkKeOT09x1fWTyIswrc702QQ=";
|
private static final String APP_SECRET = "zFre/nTRGi7LpoFjN7oQkKeOT09x1fWTyIswrc702QQ=";
|
||||||
// private static final String APP_ID = "test";
|
|
||||||
// private static final String APP_SECRET = "RSYtKXrXPLMy3oeh0cOro6QCioRUgqfnKCkDkNq78sI=";
|
|
||||||
private static final String APP_ID = "testAnnoy";
|
|
||||||
private static final String APP_SECRET = "jyGCymUjCFL2i3a4Tm3qBIkUrUl4ZgKPYvOU/47ZWcM=";
|
|
||||||
private static final String ENCRYPTION_TYPE = CryptoSignatureUtils.ENCRYPT_TYPE_AES;
|
private static final String ENCRYPTION_TYPE = CryptoSignatureUtils.ENCRYPT_TYPE_AES;
|
||||||
// private static final String TARGET_API = "http://172.16.46.63:30081/admin-api/databus/api/portal/lgstOpenApi/v1";
|
private static final String TARGET_API = "http://172.16.46.63:30081/admin-api/databus/api/portal/callback/v1";
|
||||||
private static final String TARGET_API = "http://127.0.0.1:48080/admin-api/databus/api/portal/test/1";
|
|
||||||
// private static final String TARGET_API = "http://127.0.0.1:48080/admin-api/databus/api/portal/lgstOpenApi/v1";
|
|
||||||
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder()
|
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder()
|
||||||
.connectTimeout(Duration.ofSeconds(5))
|
.connectTimeout(Duration.ofSeconds(5))
|
||||||
.build();
|
.build();
|
||||||
@@ -88,8 +82,11 @@ public final class DatabusApiInvocationExample {
|
|||||||
Map<String, Object> queryParams = new LinkedHashMap<>();
|
Map<String, Object> queryParams = new LinkedHashMap<>();
|
||||||
|
|
||||||
long extraTimestamp = 1761556157185L;
|
long extraTimestamp = 1761556157185L;
|
||||||
|
// String bodyJson = String.format("""
|
||||||
|
// {"operateFlag":"I","__interfaceType__":"R_MY_JY_03","data":{"endAddressName":"1","customerCompanyName":"中铜国贸","endAddressDetail":"测试地址","remark":" ","custSuppType":"1","shipperCompanyName":"中铜国贸","consigneeCorpCode":" ","consignerContactPhone":" 11","importFlag":"10","businessSupplierCode":" ","entrustMainCode":"WT3162251027027","endAddressCode":" ","specifyCarrierCorpCode":"10086689","materDetail":[{"detailStatus":"10","batchNo":"ZLTD2510ZTGM0017001","measureCodeMdm":"CU032110001","packType":" ","quantityPlanDetail":1,"deliveryOrderNo":"ZLTD2510ZTGM0017001","measureCode":"CU032110001","goodsSpecification":" ","measureUnitCode":"PAC","entrustDetailCode":"WT3162251027027001","brand":" ","soNumber":"68ecf0055502d565d22b378a"}],"operateFlag":1,"custSuppName":"上海锦生金属有限公司","startAddressCode":" ","planStartTime":1761556166000,"customerCompanyCode":0,"importMethod":"EXW","startAddressType":"10","shipperCompanyCode":"3162","deliverCondition":"20","businessSupplierName":" ","startAddressDetail":" 111","transType":"30","endAddressType":"20","planEndTime":1761556166000,"specifyCarrierCorpName":null,"custSuppFlag":"0101","businessType":"20","consigneeCorpName":" ","custSuppCode":"10086689","startAddressName":" 111","consignerContactName":" 11"},"datetime":"20251027170929","busiBillCode":"WT3162251027027","system":"BRMS","__requestId__":"f918841c-14fb-49eb-9640-c5d1b3d46bd1"}
|
||||||
|
// """, extraTimestamp);
|
||||||
String bodyJson = String.format("""
|
String bodyJson = String.format("""
|
||||||
{"operateFlag":"I","__interfaceType__":"R_MY_JY_03","data":{"endAddressName":"1","customerCompanyName":"中铜国贸","endAddressDetail":"测试地址","remark":" ","custSuppType":"1","shipperCompanyName":"中铜国贸","consigneeCorpCode":" ","consignerContactPhone":" 11","importFlag":"10","businessSupplierCode":" ","entrustMainCode":"WT3162251027027","endAddressCode":" ","specifyCarrierCorpCode":"10086689","materDetail":[{"detailStatus":"10","batchNo":"ZLTD2510ZTGM0017001","measureCodeMdm":"CU032110001","packType":" ","quantityPlanDetail":1,"deliveryOrderNo":"ZLTD2510ZTGM0017001","measureCode":"CU032110001","goodsSpecification":" ","measureUnitCode":"PAC","entrustDetailCode":"WT3162251027027001","brand":" ","soNumber":"68ecf0055502d565d22b378a"}],"operateFlag":1,"custSuppName":"上海锦生金属有限公司","startAddressCode":" ","planStartTime":1761556166000,"customerCompanyCode":0,"importMethod":"EXW","startAddressType":"10","shipperCompanyCode":"3162","deliverCondition":"20","businessSupplierName":" ","startAddressDetail":" 111","transType":"30","endAddressType":"20","planEndTime":1761556166000,"specifyCarrierCorpName":null,"custSuppFlag":"0101","businessType":"20","consigneeCorpName":" ","custSuppCode":"10086689","startAddressName":" 111","consignerContactName":" 11"},"datetime":"20251027170929","busiBillCode":"WT3162251027027","system":"BRMS","__requestId__":"f918841c-14fb-49eb-9640-c5d1b3d46bd1"}
|
{}
|
||||||
""", extraTimestamp);
|
""", extraTimestamp);
|
||||||
|
|
||||||
Map<String, Object> bodyParams = parseBodyJson(bodyJson);
|
Map<String, Object> bodyParams = parseBodyJson(bodyJson);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ import com.zt.plat.module.databus.dal.mysql.gateway.ApiPolicyRateLimitMapper;
|
|||||||
import com.zt.plat.module.databus.dal.mysql.gateway.ApiStepMapper;
|
import com.zt.plat.module.databus.dal.mysql.gateway.ApiStepMapper;
|
||||||
import com.zt.plat.module.databus.dal.mysql.gateway.ApiTransformMapper;
|
import com.zt.plat.module.databus.dal.mysql.gateway.ApiTransformMapper;
|
||||||
import com.zt.plat.module.databus.enums.gateway.ApiStatusEnum;
|
import com.zt.plat.module.databus.enums.gateway.ApiStatusEnum;
|
||||||
|
import com.zt.plat.module.databus.service.gateway.ApiVersionService;
|
||||||
import com.zt.plat.module.databus.service.gateway.impl.ApiDefinitionServiceImpl;
|
import com.zt.plat.module.databus.service.gateway.impl.ApiDefinitionServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
@@ -63,6 +64,9 @@ class ApiDefinitionServiceImplTest extends BaseDbUnitTest {
|
|||||||
@MockBean
|
@MockBean
|
||||||
private StringRedisTemplate stringRedisTemplate;
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
|
||||||
|
@MockBean
|
||||||
|
private ApiVersionService apiVersionService;
|
||||||
|
|
||||||
@TestConfiguration
|
@TestConfiguration
|
||||||
static class JacksonTestConfiguration {
|
static class JacksonTestConfiguration {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import com.zt.plat.module.infra.api.businessfile.dto.BusinessFilePageReqDTO;
|
|||||||
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileRespDTO;
|
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileRespDTO;
|
||||||
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
|
||||||
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
|
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
|
||||||
import com.zt.plat.module.infra.enums.ApiConstants;
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@@ -19,11 +19,11 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* @author chenbowen
|
* @author chenbowen
|
||||||
*/
|
*/
|
||||||
@FeignClient(name = ApiConstants.NAME)
|
@FeignClient(name = RpcConstants.INFRA_NAME)
|
||||||
@Tag(name = "RPC 服务 - 业务附件关联")
|
@Tag(name = "RPC 服务 - 业务附件关联")
|
||||||
public interface BusinessFileApi {
|
public interface BusinessFileApi {
|
||||||
|
|
||||||
String PREFIX = ApiConstants.PREFIX + "/business-file";
|
String PREFIX = RpcConstants.INFRA_PREFIX + "/business-file";
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/create")
|
@PostMapping(PREFIX + "/create")
|
||||||
@Operation(summary = "创建业务附件关联")
|
@Operation(summary = "创建业务附件关联")
|
||||||
@@ -52,6 +52,11 @@ public interface BusinessFileApi {
|
|||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
CommonResult<BusinessFileRespDTO> getBusinessFile(@RequestParam("id") Long id);
|
CommonResult<BusinessFileRespDTO> getBusinessFile(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/get-by-code")
|
||||||
|
@Operation(summary = "根据业务编码获得业务附件关联")
|
||||||
|
@Parameter(name = "businessCode", description = "业务编码", required = true)
|
||||||
|
CommonResult<BusinessFileRespDTO> getBusinessFileByBusinessCode(@RequestParam("businessCode") String businessCode);
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/page")
|
@PostMapping(PREFIX + "/page")
|
||||||
@Operation(summary = "获得业务附件关联分页")
|
@Operation(summary = "获得业务附件关联分页")
|
||||||
CommonResult<PageResult<BusinessFileRespDTO>> getBusinessFilePage(@RequestBody BusinessFilePageReqDTO pageReqDTO);
|
CommonResult<PageResult<BusinessFileRespDTO>> getBusinessFilePage(@RequestBody BusinessFilePageReqDTO pageReqDTO);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user