...
|
...
|
@@ -6,6 +6,10 @@ package com.yoho.unions.server.restapi; |
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
...
|
...
|
@@ -44,11 +48,22 @@ public class ActivateUnionRest { |
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/activateUnion")
|
|
|
@ResponseBody public ActiveUnionResponseBO activateUnion(ActivateUnionRequestVO vo) {
|
|
|
@ResponseBody public ActiveUnionResponseBO activateUnion(ActivateUnionRequestVO vo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
log.info("activateUnion with param is {}", vo);
|
|
|
if ("iphone".equals(vo.getClient_type())) {
|
|
|
vo.setClient_type(ClientTypeEnum.IOS.getName());
|
|
|
}
|
|
|
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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
ActivateUnionRequestBO bo = new ActivateUnionRequestBO();
|
|
|
BeanUtils.copyProperties(vo, bo);
|
|
|
String clientType = vo.getClient_type();
|
...
|
...
|
|