标题:合肥市务工人员实名制管理平台
接口调用成功,返回结果中的result部分做了压缩和加密处理。请使用对接申请通过后分配的密钥解密、然后再解压缩解析出原始数据。
参考如下代码
Stringcontent=JSON.toJSONString(body.getResult());logger.debug("原始内容:{}",content);//先压缩后加密byte[]zipData=ZipUtil.gzip(content,"utf-8");Stringdecrypt=CipherUtils.encryptBytesWithRsaAes( CipherUtils.getRSAPublicKey(apply.getRsaPublicKey()),zipData);logger.debug("加密后:{}",decrypt);body.setResult(decrypt);//先解密后解压缩StringrawContent=ZipUtil.unGzip(CipherUtils.decryptBytesWithRsaAes( CipherUtils.getRSAPrivateKey(apply.getRsaPrivateKey()),decrypt),"utf-8");logger.debug("解压缩内容:{}",rawContent); |
具体加密解密算法如下:
publicstaticStringencryptBytesWithRsaAes(RSAPublicKeyrsaPublicKey,byte[]bytes)throwsException{returnencryptBytesWithRsaAes(rsaPublicKey,bytes,"RSA/ECB/PKCS1Padding","AES/ECB/PKCS5Padding");}
publicstaticStringencryptBytesWithRsaAes(RSAPublicKeyrsaPublicKey,byte[]bytes,StringrasTransformation,StringaesTransformation)throwsException{byte[]key=randomAesKey();Stringvar10000=encodeBase64(encryptWithRSA(rsaPublicKey,key,rasTransformation));returnvar10000+"."+encodeBase64(encryptWithAes(key,bytes,aesTransformation));}
publicstaticbyte[]decryptBytesWithRsaAes(RSAPrivateKeyrsaPrivateKey,StringcipherText)throwsException{returndecryptBytesWithRsaAes(rsaPrivateKey,cipherText,"RSA/ECB/PKCS1Padding","AES/ECB/PKCS5Padding");}publicstaticbyte[]decryptBytesWithRsaAes(RSAPrivateKeyrsaPrivateKey,StringcipherText,StringrasTransformation,StringaesTransformation)throwsException{intindex=cipherText.indexOf(46);byte[]key=decryptWithRSA(rsaPrivateKey,decodeBase64(cipherText.substring(0,index)),rasTransformation);returndecryptWithAes(key,decodeBase64(cipherText.substring(index+1)),aesTransformation);}
publicstaticStringencodeBase64(byte[]data){returnBase64.getEncoder().encodeToString(data);}
publicstaticbyte[]decodeBase64(Stringdata){returnBase64.getDecoder().decode(data.replaceAll("\\s+",""));}
publicstaticbyte[]decryptWithAes(byte[]key,byte[]data,Stringtransformation)throwsException{SecretKeydeskey=newSecretKeySpec(key,"AES");Cipherc1=Cipher.getInstance(transformation);c1.init(2,deskey);returnc1.doFinal(data);}publicstaticbyte[]encryptWithAes(byte[]key,byte[]data,Stringtransformation)throwsException{SecretKeydeskey=newSecretKeySpec(key,"AES");Cipherc1=Cipher.getInstance(transformation);c1.init(1,deskey);returnc1.doFinal(data);}
接口描述
当前appId有数据下载权限的项目列表
请求参数
参数名称 | 参数说明 | 必须 | 数据类型 |
updateTime | 更新时间,首次不传,根据此条件可以实现增量同步 | true | string(date-time) |
pg | 页码 | false | |
pgsz | 分页大小 | false |
响应状态
状态码 | 说明 | schema |
200 | OK | ResultVo<pagevo |
403 | Forbidden | ResultVoObject |
响应状态码-200
响应参数
参数名称 | 参数说明 | 类型 | schema |
success | boolean | ||
status | integer(int) | integer(int) | |
msg | string | ||
exSeq | string | ||
result | PageVo | PageVo | |
data | array | SmzDataProjectVo | |
projectId | 项目id | string | |
projectName | 项目名称 | string | |
projectType | 项目类别 | string | |
scale | 建设规模 | string | |
regionCode | 项目区划 | string | |
longitude | 经度 | string | |
latitude | 纬度 | string | |
planStartDate | 计划开工日期 | string | |
planEndDate | 计划竣工日期 | string | |
investment | 总投资额(万元) | number | |
status | 项目状态 | string | |
investor | 主要投资 | string | |
lastModifiedTime | 最后更新时间 | string | |
total | integer(int64) | ||
pageNo | integer(int64) | ||
pageSize | integer(int64) | ||
orderBy | string | ||
data | object |
响应示例
{
"success":true,
"status":0,
"msg":"",
"exSeq":"",
"result":{
"data":[
{
"projectId":"",
"projectName":"",
"projectType":"",
"scale":"",
"regionCode":"",
"longitude":"",
"latitude":"",
"planStartDate":"",
"planEndDate":"",
"investment":0,
"status":"",
"investor":"",
"lastModifiedTime":""
}
],
"total":0,
"pageNo":0,
"pageSize":0,
"orderBy":""
},
"data":{}
}
响应状态码-403
响应参数
参数名称 | 参数说明 | 类型 | schema |
success | boolean | ||
status | integer | integer | |
msg | string | ||
exSeq | string | ||
result | object | ||
data | object |
响应示例
{
"success":true,
"status":0,
"msg":"",
"exSeq":"",
"result":{},
"data":{}
}
部分内容由用户投稿或者来源于网络,如有侵权,请联系底部邮箱进行删除!非常感谢您的支持!