Commit 45cbcaed authored by 以墨为白's avatar 以墨为白 🎧

Merge branch 'master' of http://192.168.168.218/wcyuee/szpt

parents 4b5d7de7 b83d0584
......@@ -34,10 +34,12 @@ public class SwaggerConfig {
Parameter param2 = new ParameterBuilder().name(SignatureUtil.NONCE).description("nonce").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
Parameter param3 = new ParameterBuilder().name(SignatureUtil.TIMESTAMP).description("timestamp").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
Parameter param4 = new ParameterBuilder().name(SignatureUtil.SIGNATURE).description("signature").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
Parameter param5 = new ParameterBuilder().name(SignatureUtil.DEPT_CODE).description("deptCode").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(param1);
pars.add(param2);
pars.add(param3);
pars.add(param4);
pars.add(param5);
ApiInfo apiInfo = new ApiInfoBuilder()
.title("模块服务接口文档")
.description("服务接口文档,遵循RESTful API设计规范")
......
......@@ -15,14 +15,22 @@ public class TestAppStore {
@Test
@DisplayName("新增AppId")
public void addAppId() {
for (int i = 0; i < 10000; i++) {
AppStoreDTO appStoreDTO = new AppStoreDTO();
appStoreDTO.setAppKey("scale");
appStoreDTO.setAppSecret(DigestUtil.md5Hex("scale"));
appStoreDTO.setDeptCode("330102");
// for (int i = 0; i < 10000; i++) {
// AppStoreDTO appStoreDTO = new AppStoreDTO();
// appStoreDTO.setAppKey("scale");
// appStoreDTO.setAppSecret(DigestUtil.md5Hex("scale"));
// appStoreDTO.setDeptCode("330102");
//
// TestHttpUtil.signatureAndRequest("/rest/appStore/insertAppStore", appStoreDTO, AppStoreDTO.class);
// }
TestHttpUtil.signatureAndRequest("/rest/appStore/insertAppStore", appStoreDTO, AppStoreDTO.class);
}
AppStoreDTO appStoreDTO = new AppStoreDTO();
appStoreDTO.setAppKey("scale");
appStoreDTO.setAppSecret(DigestUtil.md5Hex("scale"));
appStoreDTO.setDeptCode("330103");
TestHttpUtil.signatureAndRequest("/rest/appStore/insertAppStore", appStoreDTO, AppStoreDTO.class);
// TestHttpUtil.signatureAndRequest("/rest/appStore/insertAppStore", appStoreDTO, AppStoreDTO.class);
// TestHttpUtil.signatureAndRequest("/rest/appStore/insertAppStore", appStoreDTO);
......
......@@ -32,11 +32,15 @@ public class TestHttpUtil {
} catch (JsonProcessingException e) {
Assertions.fail("json序列化失败");
}
log.info("原始body:{}", json);
//请求体加密
json = EncryptUtil.getInstance().AESEncode(json, appSecret);
log.info("加密后body:{}", json);
//签名appId+nonce+timestampStr+aes(body)+deptCode
String data = String.format("%s%s%s%s%S", appId, nonce, timestampStr, json, deptCode);
log.info("待签名:{}", data);
String generatedSignature = DigestUtil.md5Hex(data);
log.info("已签名:{}", generatedSignature);
//请求
WebClient webClient = WebClient.builder()
.baseUrl("http://localhost:8086")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment