...
|
...
|
@@ -56,10 +56,14 @@ public class ActivateUnionRest { |
|
|
String agent = request.getHeader("user-agent");
|
|
|
log.info("addMonitor user-agent={}", agent);
|
|
|
if (StringUtils.isEmpty(vo.getTd()) && StringUtils.isNotEmpty(agent)) {
|
|
|
if (agent.toLowerCase().indexOf("mac os x") >= 0 || agent.toLowerCase().indexOf("iphone") >= 0) {
|
|
|
String version = agent.substring(agent.indexOf(" OS ") + 4, agent.indexOf(" like"));
|
|
|
vo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
log.info("activateUnion request={}", vo);
|
|
|
String[] arr = agent.split(";");
|
|
|
for (String str : arr) {
|
|
|
if (str.indexOf("OS/iOS") >= 0) {
|
|
|
String version = str.substring(str.indexOf("OS/iOS") + 6);
|
|
|
vo.setTd("ios_" + version);
|
|
|
log.info("activateUnion request={}", vo);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -73,7 +77,7 @@ public class ActivateUnionRest { |
|
|
}
|
|
|
bo.setClientIp(RemoteIPInterceptor.getRemoteIP());
|
|
|
//多线程处理
|
|
|
exe.execute(new RunActivate(bo));
|
|
|
exe.execute(new RunActivate(bo, agent));
|
|
|
return new ActiveUnionResponseBO(200, "success");
|
|
|
}
|
|
|
|
...
|
...
|
@@ -85,11 +89,13 @@ public class ActivateUnionRest { |
|
|
|
|
|
public static class RunActivate implements Runnable {
|
|
|
|
|
|
public RunActivate(ActivateUnionRequestBO bo) {
|
|
|
public RunActivate(ActivateUnionRequestBO bo, String agent) {
|
|
|
this.bo = bo;
|
|
|
this.agent = agent;
|
|
|
}
|
|
|
|
|
|
private ActivateUnionRequestBO bo;
|
|
|
private String agent;
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
...
|
...
|
@@ -131,6 +137,14 @@ public class ActivateUnionRest { |
|
|
public void setBo(ActivateUnionRequestBO bo) {
|
|
|
this.bo = bo;
|
|
|
}
|
|
|
|
|
|
public String getAgent() {
|
|
|
return agent;
|
|
|
}
|
|
|
|
|
|
public void setAgent(String agent) {
|
|
|
this.agent = agent;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} |
...
|
...
|
|