保存进度!
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-11 09:27:40
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/AppMain.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao;
|
||||
|
||||
import com.cpic.xim.huixiabao.data.config.HuixiabaoConfig;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
|
||||
|
||||
public class AppMain
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
EncryptionModeEnum encType = EncryptionModeEnum.SM4;
|
||||
SignTypeEnum signType = SignTypeEnum.SM3;
|
||||
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-11 09:30:38
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/config/HuixiabaoConfig.java
|
||||
* @Description: 存放惠厦保相关的配置文件,以后要改成json文件存放。
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.cpic.xim.huixiabao.data.config;
|
||||
|
||||
public class HuixiabaoConfig
|
||||
{
|
||||
|
||||
public String getAppid()
|
||||
{
|
||||
return appid;
|
||||
}
|
||||
public String getAppSecret()
|
||||
{
|
||||
return appSecret;
|
||||
}
|
||||
public String getSignKey()
|
||||
{
|
||||
return signKey;
|
||||
}
|
||||
public String getEncKey()
|
||||
{
|
||||
return encKey;
|
||||
}
|
||||
|
||||
private String url = "https://172.18.1.150:9040";
|
||||
private String appid = "hxb-tb";
|
||||
private String appSecret = "60F468FB46170DD4CF6CBECE215DBFC0";
|
||||
private String signKey = "1A2F447BD0F930798D8031B137EC6E25";
|
||||
private String encKey = "08307695B1668EB9FD6210250FED874F";
|
||||
}
|
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-06 14:33:27
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/data/pojo/HmbListItem.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao.data.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
@JsonInclude( JsonInclude.Include.NON_EMPTY )
|
||||
@JsonPropertyOrder( alphabetic = true )
|
||||
public class HmbListItem
|
||||
{
|
||||
|
||||
public String getPsnName()
|
||||
{
|
||||
return psnName;
|
||||
}
|
||||
|
||||
public void setPsnName( String psnName )
|
||||
{
|
||||
this.psnName = psnName;
|
||||
}
|
||||
|
||||
public String getCertNo()
|
||||
{
|
||||
return certNo;
|
||||
}
|
||||
|
||||
public void setCertNo( String certNo )
|
||||
{
|
||||
this.certNo = certNo;
|
||||
}
|
||||
|
||||
public String getServiceId()
|
||||
{
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
public void setServiceId( String serviceId )
|
||||
{
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus( String status )
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getXyxNo()
|
||||
{
|
||||
return xyxNo;
|
||||
}
|
||||
|
||||
public void setXyxNo( String xyxNo )
|
||||
{
|
||||
this.xyxNo = xyxNo;
|
||||
}
|
||||
|
||||
@JsonProperty("psnName")
|
||||
private String psnName;
|
||||
|
||||
@JsonProperty("certno")
|
||||
private String certNo;
|
||||
|
||||
@JsonProperty("serviceId")
|
||||
private String serviceId;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
@JsonProperty("xyxNo")
|
||||
private String xyxNo;
|
||||
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-06 14:27:05
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /Cpicxim-XMNHSA-Repeater/src/main/java/com/cpicxim/huixiabao/data/pojo/HmbXyxInfoRequest.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao.data.pojo;
|
||||
|
||||
import java.util.Vector;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
@JsonInclude( JsonInclude.Include.NON_EMPTY )
|
||||
@JsonPropertyOrder( alphabetic = true )
|
||||
public class HmbXyxInfoRequest
|
||||
{
|
||||
public HmbXyxInfoRequest()
|
||||
{
|
||||
this.topic = "hmbXyxInfo";
|
||||
this.hmbList = new Vector<>();
|
||||
}
|
||||
|
||||
public HmbXyxInfoRequest( String topic, Vector<HmbListItem> hmbList )
|
||||
{
|
||||
this.topic = topic;
|
||||
this.topic = "hmbXyxInfo";
|
||||
this.hmbList = hmbList;
|
||||
}
|
||||
|
||||
public String getTopic()
|
||||
{
|
||||
return topic;
|
||||
}
|
||||
|
||||
public void setTopic( String topic )
|
||||
{
|
||||
this.topic = topic;
|
||||
}
|
||||
|
||||
public Vector<HmbListItem> getHmbList()
|
||||
{
|
||||
return hmbList;
|
||||
}
|
||||
|
||||
public void setHmbList( Vector<HmbListItem> hmbList )
|
||||
{
|
||||
this.hmbList = hmbList;
|
||||
}
|
||||
|
||||
@JsonProperty("topic")
|
||||
private String topic; // 业务类型
|
||||
|
||||
@JsonProperty("hmbList")
|
||||
private Vector<HmbListItem> hmbList;
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-06 14:17:24
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/data/pojo/NHACommenRequestBody.java
|
||||
* @Description: 易联众请求共通报文结构
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao.data.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class NHACommenRequestBody
|
||||
{
|
||||
|
||||
public String getChs_fjs_appid()
|
||||
{
|
||||
return chs_fjs_appid;
|
||||
}
|
||||
public void setChs_fjs_appid( String chs_fjs_appid )
|
||||
{
|
||||
this.chs_fjs_appid = chs_fjs_appid;
|
||||
}
|
||||
public String getChs_fjs_appsecret()
|
||||
{
|
||||
return chs_fjs_appsecret;
|
||||
}
|
||||
public void setChs_fjs_appsecret( String chs_fjs_appsecret )
|
||||
{
|
||||
this.chs_fjs_appsecret = chs_fjs_appsecret;
|
||||
}
|
||||
public String getChs_fjs_token()
|
||||
{
|
||||
return chs_fjs_token;
|
||||
}
|
||||
public void setChs_fjs_token( String chs_fjs_token )
|
||||
{
|
||||
this.chs_fjs_token = chs_fjs_token;
|
||||
}
|
||||
public String getChs_fjs_funid()
|
||||
{
|
||||
return chs_fjs_funid;
|
||||
}
|
||||
public void setChs_fjs_funid( String chs_fjs_funid )
|
||||
{
|
||||
this.chs_fjs_funid = chs_fjs_funid;
|
||||
}
|
||||
public String getChs_fjs_encdata()
|
||||
{
|
||||
return chs_fjs_encdata;
|
||||
}
|
||||
public void setChs_fjs_encdata( String chs_fjs_encdata )
|
||||
{
|
||||
this.chs_fjs_encdata = chs_fjs_encdata;
|
||||
}
|
||||
public String getChs_fjs_sign()
|
||||
{
|
||||
return chs_fjs_sign;
|
||||
}
|
||||
public void setChs_fjs_sign( String chs_fjs_sign )
|
||||
{
|
||||
this.chs_fjs_sign = chs_fjs_sign;
|
||||
}
|
||||
public int getChs_fjs_timestamp()
|
||||
{
|
||||
return chs_fjs_timestamp;
|
||||
}
|
||||
public void setChs_fjs_timestamp( int chs_fjs_timestamp )
|
||||
{
|
||||
this.chs_fjs_timestamp = chs_fjs_timestamp;
|
||||
}
|
||||
|
||||
private String chs_fjs_appid; // 渠道id
|
||||
private String chs_fjs_appsecret; // 渠道私钥
|
||||
private String chs_fjs_token; // 请求时携带的动态令牌
|
||||
private String chs_fjs_funid; // 服务编号
|
||||
private String chs_fjs_encdata; // 加密后的数据
|
||||
private String chs_fjs_sign; // 签名数据串
|
||||
private String data; // 未加密的数据
|
||||
private int chs_fjs_timestamp; // 时间戳
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2025-03-11 11:10:09
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /cpicxim-XMNHSA-repeater/src/main/java/com/cpic/xim/huixiabao/nhs/CpicximToXMNHS.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2023} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao.nhs;
|
||||
|
||||
import java.util.Vector;
|
||||
import com.cpic.xim.huixiabao.data.pojo.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CpicximToXMNHS
|
||||
{
|
||||
private static Logger logger = LoggerFactory.getLogger( CpicximToXMNHS.class );
|
||||
|
||||
public Vector<HmbListItem> getNeverTransHmbList()
|
||||
{
|
||||
|
||||
Vector<HmbListItem> items = new Vector<HmbListItem>();
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
40
code/cpicxim-XMNHSA-repeater/src/main/resources/log4j2.xml
Normal file
40
code/cpicxim-XMNHSA-repeater/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<Configuration status="WARN" monitorInterval="300">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} ### %msg%n" />
|
||||
<ThresholdFilter level="trace" onMatch="ACCEPT" onMismatch="DENY" />
|
||||
</Console>
|
||||
<RollingFile name="rolling_file_win"
|
||||
filePattern="./logs/huixiabao/$${date:yyyy-MM}/huixiabao-%d{MM-dd-yyyy}-%i.log.gz">
|
||||
<PatternLayout>
|
||||
<Pattern>[%t][%level][%d{HH:mm:ss.SSS}][%logger.%M{36}#%L] %msg%n</Pattern>
|
||||
</PatternLayout>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" />
|
||||
<SizeBasedTriggeringPolicy size="20MB" />
|
||||
<DefaultRolloverStrategy max="20" />
|
||||
</Policies>
|
||||
</RollingFile>
|
||||
<RollingFile name="rolling_file_linux"
|
||||
filePattern="/logs/huixiabao/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
|
||||
<PatternLayout>
|
||||
<Pattern>[%t][%level][%d{HH:mm:ss.SSS}][%logger.%M{36}#%L] %msg%n</Pattern>
|
||||
</PatternLayout>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" />
|
||||
<SizeBasedTriggeringPolicy size="20MB" />
|
||||
<DefaultRolloverStrategy max="20" />
|
||||
</Policies>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<!-- <Logger name="mylog" level="info">
|
||||
<AppenderRef ref="rolling_file" />
|
||||
</Logger> -->
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="rolling_file_linux" />
|
||||
<AppenderRef ref="rolling_file_win" />
|
||||
<AppenderRef ref="Console" />
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* @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.
|
||||
*/
|
||||
package com.cpic.xim.huixiabao;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.hsa.zephyr.apisdk.DefaultZephyrClient;
|
||||
import cn.hsa.zephyr.apisdk.internal.exception.ZephyrApiException;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.EncryptionModeEnum;
|
||||
import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum;
|
||||
import cn.hsa.zephyr.apisdk.request.DefaultZephyrRequest;
|
||||
import cn.hsa.zephyr.apisdk.response.DefaultZephyrResponse;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
{
|
||||
private Logger logger = LoggerFactory.getLogger( AppTest.class );
|
||||
|
||||
/**
|
||||
* Rigorous Test :-)
|
||||
*/
|
||||
@Test
|
||||
public void shouldAnswerWithTrue()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLog()
|
||||
{
|
||||
for ( int i = 0; i < 10000; i++ )
|
||||
{
|
||||
// System.out.print("test!");
|
||||
logger.error( "test!!!!" );
|
||||
}
|
||||
}
|
||||
|
||||
public void nhsTest()
|
||||
{
|
||||
String url = "";
|
||||
String appId = "待定";
|
||||
String appSecret = "待定";
|
||||
String funId = "xxx";
|
||||
String encKey = "A5B6E00DA599G56C41ABFE23A74E6E60";
|
||||
String signKey = "待定";
|
||||
|
||||
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;
|
||||
|
||||
jsonObject1.put( "code", "XXXXXXXXXXXXXXXXXX" );
|
||||
jsonObject1.put( "scene_code", "XXX" );
|
||||
|
||||
req.setData( jsonObject1 );
|
||||
resp = client.execute( req );
|
||||
|
||||
System.out.println( resp.getData() );
|
||||
}
|
||||
catch ( ZephyrApiException e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user