Merge branch 'qtz' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #28.
This commit is contained in:
qtz
2023-09-27 15:20:39 +08:00
committed by Gitea
9 changed files with 112 additions and 10 deletions
@@ -18,6 +18,16 @@ public class IdentityAuthenticationController extends BaseController {
@Autowired
private IdentityAuthenticationService identityAuthenticationService;
/**
* 查询身份认证EIDtoken
*/
@PostMapping("/selectIdentityAuthenticaEIDtoken")
public AjaxResult selectIdentityAuthenticaEIDtoken()
{
IdentityAuthentication ientityAuthentication = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
return success(ientityAuthentication);
}
@@ -148,4 +148,5 @@ elegent:
cycle: 10
identityAuthentication:
credentialSecretId: 123
credentialSecretKey: 367
credentialSecretKey: 367
merchantId: 356
+2 -2
View File
@@ -141,8 +141,8 @@
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java-ocr</artifactId>
<version>3.1.701</version>
<artifactId>tencentcloud-sdk-java-faceid</artifactId>
<version>3.1.871</version>
</dependency>
<!-- poi-tl-->
@@ -44,6 +44,27 @@ public class CaseAffiliate extends BaseEntity {
@Excel(name = "代理人联系地址")
private String contactAddressAgent;
/** 送达电子邮件 */
private String sendEmail;
/** 快递单号 */
private String trackNum;
public String getSendEmail() {
return sendEmail;
}
public void setSendEmail(String sendEmail) {
this.sendEmail = sendEmail;
}
public String getTrackNum() {
return trackNum;
}
public void setTrackNum(String trackNum) {
this.trackNum = trackNum;
}
public String getNameAgent() {
return nameAgent;
}
@@ -45,6 +45,38 @@ public class IdentityAuthentication extends BaseEntity {
/** 用户账号 */
private String userName;
/** EID商户id */
private String merchantId;
/** EidToken */
private String eidToken;
/** 请求 ID */
private String requestId;
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public String getEidToken() {
return eidToken;
}
public void setEidToken(String eidToken) {
this.eidToken = eidToken;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public Long getUserId() {
return userId;
}
@@ -1,6 +1,7 @@
package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
public interface IdentityAuthenticationService {
@@ -8,4 +9,5 @@ public interface IdentityAuthenticationService {
IdentityAuthentication selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
IdentityAuthentication selectIdentityAuthenticaEIDtoken();
}
@@ -109,7 +109,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
caseAttachselect.setAnnexId(caseAttach.getAnnexId());
caseAttachselect.setAnnexName(caseAttach.getAnnexName());
caseAttachselect.setAnnexType(caseAttach.getAnnexType());
return AjaxResult.success("上传成功",caseAttach);
return AjaxResult.success("上传成功",caseAttachselect);
}
} catch (IOException e) {
e.printStackTrace();
@@ -1,7 +1,9 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
@@ -11,9 +13,9 @@ import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.ocr.v20181119.OcrClient;
import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRRequest;
import com.tencentcloudapi.ocr.v20181119.models.RecognizeTableAccurateOCRResponse;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest;
import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +34,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
private String credentialSecretId;
@Value("${identityAuthentication.credentialSecretKey}")
private String credentialSecretKey;
@Value("${identityAuthentication.merchantId}")
private String merchantId;
// private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
// private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
@Autowired
private IdentityAuthenticationMapper identityAuthenticationMapper;
@@ -53,6 +60,35 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
}
@Override
public IdentityAuthentication selectIdentityAuthenticaEIDtoken() {
IdentityAuthentication identityAuthentication = new IdentityAuthentication();
try{
// Credential credIdenAuth = new Credential(SECRET_ID, SECRET_KEY);
Credential authenti = new Credential(credentialSecretId, credentialSecretKey);
HttpProfile httpProfileIdenAuth = new HttpProfile();
httpProfileIdenAuth.setEndpoint("faceid.tencentcloudapi.com");
ClientProfile clientInv= new ClientProfile();
clientInv.setHttpProfile(httpProfileIdenAuth);
FaceidClient clientIdenAuth = new FaceidClient(authenti, "", clientInv);
// 实例化一个请求对象
GetEidTokenRequest reqest = new GetEidTokenRequest();
//设置请求参数
reqest.setMerchantId(merchantId);
GetEidTokenResponse respIdenAuth = clientIdenAuth.GetEidToken(reqest);
String respJSON = GetEidTokenResponse.toJsonString(respIdenAuth);
JSONObject objJSON = JSON.parseObject(respJSON);
JSONObject objJSONRes = (JSONObject) objJSON.get("Response");
String eidToken = objJSONRes.getString("EidToken");
String requestId = objJSONRes.getString("RequestId");
identityAuthentication.setEidToken(eidToken);
}catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
return identityAuthentication;
}
}
@@ -46,7 +46,7 @@
update case_attach
set
case_appli_id= #{caseAppliId}
where annexId = #{annex_id}
where annex_id = #{annexId}
</update>