Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YOHOBUY
/
yohobuy-union
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhengwen.ge
9 years ago
Commit
ac638dda1da4a9e624ff6fa8a31288d118434dfb
1 parent
2a07ce65
广点通需求
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
server/src/main/java/com/yoho/unions/server/service/impl/GDTServiceImpl.java
server/src/main/java/com/yoho/unions/server/service/impl/GDTServiceImpl.java
View file @
ac638dd
...
...
@@ -90,36 +90,42 @@ public class GDTServiceImpl implements MainUnionService {
MainUnionResponseBO
response
=
null
;
String
msg
=
null
;
String
ret
=
null
;
Pair
<
Integer
,
String
>
pair
=
HttpUtils
.
httpGet
(
url
);
// Pair<Integer, String> pair = Pair.of(200, "{\"ret\":0,\"msg\":\"success\"}");
// Pair<Integer, String> pair = Pair.of(400, "{\"ret\":-1,\"msg\":\"请求非法参数\"}");
// Pair<Integer, String> pair = Pair.of(789, "adsfasdfasd");
UnionLogs
unionLogs
=
new
UnionLogs
();
unionLogs
.
setAppId
(
String
.
valueOf
(
requestBO
.
getAppid
()));
unionLogs
.
setUdid
(
requestBO
.
getMuid
());
unionLogs
.
setUnionType
((
byte
)
requestBO
.
getUnionType
());
unionLogs
.
setActivateParams
(
JSON
.
toJSONString
(
requestBO
));
//如果status是200,证明发送成功
if
(
pair
.
getLeft
()
==
HttpStatus
.
SC_OK
){
log
.
debug
(
"url return message is {}"
,
pair
.
getRight
());
//激活成功
unionLogs
.
setIsActivate
((
byte
)
1
);
unionLogs
.
setCreateTime
(
DateUtil
.
getCurrentTimeSecond
());
unionLogs
.
setUpdateTime
(
DateUtil
.
getCurrentTimeSecond
());
log
.
debug
(
"add to unionLogs db with param is {}"
,
unionLogs
);
response
=
new
ActivateDingdangResponseBO
(
true
,
"成功"
);
JSONObject
json
=
JSONObject
.
parseObject
(
pair
.
getRight
());
ret
=
json
.
getString
(
"ret"
);
msg
=
json
.
getString
(
"msg"
);
//广点通返回成功
if
(
StringUtils
.
isNotEmpty
(
ret
)&&
"0"
.
equals
(
ret
)){
unionLogs
.
setIsActivate
((
byte
)
1
);
unionLogs
.
setCreateTime
(
DateUtil
.
getCurrentTimeSecond
());
unionLogs
.
setUpdateTime
(
DateUtil
.
getCurrentTimeSecond
());
log
.
debug
(
"add to unionLogs db with param is {}"
,
unionLogs
);
response
=
new
ActivateDingdangResponseBO
(
true
,
msg
);
}
//广点通返回错误
else
{
unionLogs
.
setIsActivate
((
byte
)
0
);
unionLogs
.
setCreateTime
(
DateUtil
.
getCurrentTimeSecond
());
unionLogs
.
setUpdateTime
(
DateUtil
.
getCurrentTimeSecond
());
response
=
new
ActivateDingdangResponseBO
(
false
,
msg
);
}
}
else
{
//激活失败
unionLogs
.
setIsActivate
((
byte
)
0
);
unionLogs
.
setCreateTime
(
DateUtil
.
getCurrentTimeSecond
());
unionLogs
.
setUpdateTime
(
DateUtil
.
getCurrentTimeSecond
());
JSONObject
json
=
JSONObject
.
parseObject
(
pair
.
getRight
());
msg
=
json
.
getString
(
"msg"
);
response
=
new
ActivateDingdangResponseBO
(
false
,
msg
);
response
=
new
ActivateDingdangResponseBO
(
false
,
"激活失败"
);
}
unionLogsDAO
.
insert
(
unionLogs
);
return
response
;
...
...
Please
register
or
login
to post a comment