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
linlong
8 years ago
Commit
03dc3dca736b6c3a62f120a78e2b5212d539f9a4
1 parent
748b4477
update
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
common/src/main/java/com/yoho/unions/vo/UnionReqVO.java
server/src/main/java/com/yoho/unions/server/service/impl/RedirectServiceImpl.java
common/src/main/java/com/yoho/unions/vo/UnionReqVO.java
View file @
03dc3dc
...
...
@@ -15,6 +15,14 @@ public class UnionReqVO{
private
String
u_id
;
private
String
union_type
;
private
String
utm_source
;
private
String
utm_medium
;
private
String
utm_campaign
;
public
String
getChannel_id
()
{
return
channel_id
;
}
...
...
@@ -46,5 +54,37 @@ public class UnionReqVO{
public
void
setU_id
(
String
u_id
)
{
this
.
u_id
=
u_id
;
}
public
String
getUnion_type
()
{
return
union_type
==
null
?
""
:
union_type
;
}
public
void
setUnion_type
(
String
union_type
)
{
this
.
union_type
=
union_type
;
}
public
String
getUtm_source
()
{
return
utm_source
==
null
?
""
:
utm_source
;
}
public
void
setUtm_source
(
String
utm_source
)
{
this
.
utm_source
=
utm_source
;
}
public
String
getUtm_medium
()
{
return
utm_medium
==
null
?
""
:
utm_medium
;
}
public
void
setUtm_medium
(
String
utm_medium
)
{
this
.
utm_medium
=
utm_medium
;
}
public
String
getUtm_campaign
()
{
return
utm_campaign
==
null
?
""
:
utm_campaign
;
}
public
void
setUtm_campaign
(
String
utm_campaign
)
{
this
.
utm_campaign
=
utm_campaign
;
}
}
...
...
server/src/main/java/com/yoho/unions/server/service/impl/RedirectServiceImpl.java
View file @
03dc3dc
...
...
@@ -60,10 +60,17 @@ public class RedirectServiceImpl implements IRedirectService{
private
String
builderUrlForPanshi
(
UnionReqVO
uionReqVO
){
String
param
=
this
.
generateReqParam
(
uionReqVO
);
String
targetUrl
=
uionReqVO
.
getTarget_url
();
StringBuffer
targetUrl
=
new
StringBuffer
(
uionReqVO
.
getTarget_url
());
targetUrl
=
StringUtils
.
isEmpty
(
targetUrl
)
?
new
StringBuffer
(
WAP_URL
)
:
targetUrl
;
if
(
targetUrl
.
toString
().
contains
(
"?"
)){
targetUrl
.
append
(
"&utm_source="
).
append
(
uionReqVO
.
getUtm_source
()).
append
(
"&utm_medium="
).
append
(
uionReqVO
.
getUtm_medium
()).
append
(
"&utm_campaign="
).
append
(
uionReqVO
.
getUtm_campaign
());
}
else
{
targetUrl
.
append
(
"?utm_source="
).
append
(
uionReqVO
.
getUtm_source
()).
append
(
"&utm_medium="
).
append
(
uionReqVO
.
getUtm_medium
()).
append
(
"&utm_campaign="
).
append
(
uionReqVO
.
getUtm_campaign
());
}
try
{
param
=
URLEncoder
.
encode
(
param
,
"UTF-8"
);
targetUrl
=
URLEncoder
.
encode
(
targetUrl
,
"UTF-8"
);
targetUrl
=
new
StringBuffer
(
URLEncoder
.
encode
(
targetUrl
.
toString
(),
"UTF-8"
)
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
warn
(
"builderUrlForPanshi: urlEncode failed: request param is {}"
,
uionReqVO
);
}
...
...
Please
register
or
login
to post a comment