加入post代码。

This commit is contained in:
2025-03-12 01:09:23 +08:00
parent a823e3f963
commit 95047193eb
11 changed files with 162 additions and 53 deletions

View File

@@ -1,11 +1,15 @@
/*
* @Author: Kane
* @Date: 2025-03-11 09:27:40
* @LastEditors: Kane
* @FilePath: /cpicxim-XMNHSA-repeater/src/test/java/com/cpic/xim/huixiabao/AppTest.java
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
* @Date: 2025-03-11 09:27:40
*
* @LastEditors: Kane
*
* @FilePath: /cpicxim-XMNHSA-repeater/src/test/java/com/cpic/xim/huixiabao/AppTest.java
*
* @Description:
*
* Copyright (c) ${2023} by Kane, All Rights Reserved.
*/
package com.cpic.xim.huixiabao;
@@ -42,7 +46,9 @@ public class AppTest
@Test
public void testLog()
{
for ( int i = 0; i < 10000; i++ )
for (
int i = 0; i < 10000; i++
)
{
// System.out.print("test!");
logger.error( "test!!!!" );
@@ -52,23 +58,30 @@ public class AppTest
@Test
public void nhsTest()
{
String url = "172.18.1.150:9040";
String appId = "待定";
String url = "172.18.1.150:9040";
String appId = "待定";
String appSecret = "待定";
String funId = "xxx";
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
String signKey = "待定";
String funId = "xxx";
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
String signKey = "待定";
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
SignTypeEnum signType = SignTypeEnum.SM3;
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
try
{
DefaultZephyrClient client = new DefaultZephyrClient( url, funId, appId, appSecret,
signType, signKey, encType, encKey );
DefaultZephyrRequest req = new DefaultZephyrRequest();
JSONObject jsonObject1 = new JSONObject();
DefaultZephyrResponse resp = null;
DefaultZephyrClient client = new DefaultZephyrClient( url,
funId,
appId,
appSecret,
signType,
signKey,
encType,
encKey );
DefaultZephyrRequest req = new DefaultZephyrRequest();
JSONObject jsonObject1 = new JSONObject();
DefaultZephyrResponse resp = null;
jsonObject1.put( "code", "XXXXXXXXXXXXXXXXXX" );
jsonObject1.put( "scene_code", "XXX" );
@@ -88,18 +101,18 @@ public class AppTest
public void jsonTest()
{
JSONObject requestObject = new JSONObject();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
JSONObject item = new JSONObject();
JSONArray hmbList = new JSONArray();
requestObject.put( "topic", "hmbXyxInfo" );
requestObject.put("hmbList", hmbList );
requestObject.put( "hmbList", hmbList );
item.put( "psnName", "王炜" );
item.put( "cerno", "350402198106130016" );
item.put( "serviceId", "100007" );
item.put( "status", "1" );
item.put( "xyxNo", "1234567" );
hmbList.add( item );
String json = requestObject.toJSONString();