Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hubin
long-tern-care-service
Commits
27a46684
Commit
27a46684
authored
Sep 09, 2024
by
18310373984@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
腾讯云接口增加调用记录
parent
0728cad8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
FaceAuthUtil.java
...java/com/hungraim/ltc/facelocation/util/FaceAuthUtil.java
+22
-11
No files found.
apply/apply-service/src/main/java/com/hungraim/ltc/facelocation/util/FaceAuthUtil.java
View file @
27a46684
...
...
@@ -86,10 +86,17 @@ public class FaceAuthUtil {
log
.
error
(
"增加CreatePerson接口调用记录失败:"
+
e
.
toString
());
}
return
Result
.
success
(
resp
.
getFaceId
());
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
toString
());
return
Result
.
failed
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
log
.
error
(
"调用腾讯云创建人员接口返回失败:"
+
e
.
toString
());
log
.
error
(
e
.
toString
());
try
{
//增加接口调用记录
addCallFaceInterfaceLog
(
userId
,
JSON
.
toJSONString
(
faceAuthParam
.
getFaceId
()),
"CreatePerson"
,
"创建人员"
,
e
.
getMessage
(),
null
,
null
,
null
);
}
catch
(
Exception
e1
){
log
.
error
(
"增加CreatePerson接口调用记录失败2:"
+
e1
.
toString
());
}
return
Result
.
failed
(
e
.
getMessage
());
}
}
...
...
@@ -127,19 +134,16 @@ public class FaceAuthUtil {
// 实例化要请求产品的client对象,clientProfile是可选的
IaiClient
client
=
new
IaiClient
(
cred
,
faceAuthProperties
.
getRegion
(),
clientProfile
);
// 实例化一个请求对象,每个接口都会对应一个request对象
Delete
FaceRequest
req
=
new
DeleteFaceRequest
();
Delete
PersonRequest
req
=
new
DeletePersonRequest
();
req
.
setPersonId
(
faceAuthParam
.
getCertifNum
());
String
[]
faceIds1
=
{
faceAuthParam
.
getFaceId
()};
//人脸
req
.
setFaceIds
(
faceIds1
);
// 返回的resp是一个DeleteFaceResponse的实例,与请求对象对应
Delete
FaceResponse
resp
=
client
.
DeleteFace
(
req
);
Delete
PersonResponse
resp
=
client
.
DeletePerson
(
req
);
// 输出json格式的字符串回包
System
.
out
.
println
(
AbstractModel
.
toJsonString
(
resp
));
try
{
//增加接口调用记录
addCallFaceInterfaceLog
(
userId
,
JSON
.
toJSONString
(
req
.
getFaceIds
()
),
"DeleteFace"
,
"删除人脸"
,
addCallFaceInterfaceLog
(
userId
,
req
.
getPersonId
(
),
"DeleteFace"
,
"删除人脸"
,
AbstractModel
.
toJsonString
(
resp
),
null
,
null
,
null
);
}
catch
(
Exception
e
){
log
.
error
(
"增加DeleteFace接口调用记录失败:"
+
e
.
toString
());
...
...
@@ -148,7 +152,14 @@ public class FaceAuthUtil {
return
Result
.
success
(
resp
.
getRequestId
());
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
toString
());
try
{
//增加接口调用记录
addCallFaceInterfaceLog
(
userId
,
faceAuthParam
.
getCertifNum
(),
"DeleteFace"
,
"删除人脸"
,
e
.
getMessage
(),
null
,
null
,
null
);
}
catch
(
Exception
e1
){
log
.
error
(
"增加DeleteFace接口调用记录失败2:"
+
e1
.
toString
());
}
log
.
error
(
"调用腾讯云删除人脸接口返回失败:"
+
e
.
toString
());
return
Result
.
failed
(
e
.
getMessage
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment