Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
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
pseer
gxpt_ht
Commits
d40ba4de
Commit
d40ba4de
authored
Jan 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验券接口
parent
c8e3be05
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
4 deletions
+50
-4
VerifyResultsEnum.java
...n/src/main/java/share/common/enums/VerifyResultsEnum.java
+47
-0
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+3
-4
No files found.
share-common/src/main/java/share/common/enums/VerifyResultsEnum.java
0 → 100644
View file @
d40ba4de
package
share
.
common
.
enums
;
public
enum
VerifyResultsEnum
{
//0 验卷成功
SUCCESS
(
0
,
"验卷成功"
),
//2 券码已核销
COOKED
(
2
,
"券码已核销"
),
//3 券码正在退款中(用户主动退款)
REFUNDING
(
3
,
"券码正在退款中(用户主动退款)"
),
//4 券码已退款
REFUNDED
(
4
,
"券码已退款"
),
//5 团购有效期尚未开始
GROUP_NOT_START
(
5
,
"团购有效期尚未开始"
),
//6 券码已过期,系统将自动发起退款
EXPIRED
(
6
,
"券码已过期,系统将自动发起退款"
),
//31 券码退款中(用户申请)
REFUNDING_31
(
31
,
"券码退款中(用户申请)"
),
//32 券码退款中(过期自动退)
REFUNDING_32
(
32
,
"券码退款中(过期自动退)"
),
;
private
Integer
code
;
private
String
value
;
VerifyResultsEnum
()
{
}
VerifyResultsEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
d40ba4de
...
...
@@ -5,15 +5,14 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
com.google.gson.JsonObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.ErrorCodeEnum
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.common.enums.VerifyResultsEnum
;
import
share.system.service.TiktokService
;
import
java.util.Date
;
...
...
@@ -98,10 +97,10 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject
extra
=
entries
.
getJSONObject
(
"extra"
);
if
(
data
.
getStr
(
"error_code"
).
equals
(
ErrorCodeEnum
.
SUCCESS
.
getCode
())
&&
data
.
getJSONObject
(
"verify_results"
).
getStr
(
"result"
).
equals
(
ErrorCodeEnum
.
SUCCESS
.
getCode
()))
{
return
"验卷成功"
;
}
else
if
(
data
.
getStr
(
"error_code"
).
equals
(
"1208"
)
||
data
.
getJSONObject
(
"verify_results"
).
getStr
(
"result"
).
equals
(
"2"
))
{
}
else
if
(
data
.
getStr
(
"error_code"
).
equals
(
"1208"
)
||
data
.
getJSONObject
(
"verify_results"
).
getStr
(
"result"
).
equals
(
VerifyResultsEnum
.
COOKED
.
getCode
()
))
{
return
"验卷成功"
;
}
else
if
(!
data
.
getStr
(
"error_code"
).
equals
(
ErrorCodeEnum
.
SUCCESS
.
getCode
()))
{
return
"验卷失败"
;
compensate
(
verifyToken
,
poiId
,
encryptedCodes
)
;
}
return
"验卷失败"
;
}
...
...
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