Authored by Ge

update

package com.yoho.unions.dal;
import com.yoho.unions.dal.model.MarsClickLogs;
public interface MarsClickLogsMapper {
int insert(MarsClickLogs record);
int insertSelective(MarsClickLogs record);
MarsClickLogs selectByPrimaryKey(Integer id);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal;
import com.yoho.unions.dal.model.NowClickLogs;
public interface NowClickLogsMapper {
int insert(NowClickLogs record);
int insertSelective(NowClickLogs record);
NowClickLogs selectByPrimaryKey(Integer id);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
public class MarsClickLogs {
private Integer id;
private String appId;
private String idfa;
private String imei;
private String unionType;
private Integer createTime;
private String clientType;
private String td;
private String appKey;
private String clientIp;
private String userAgent;
private String interfaceType;
private String unionName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId == null ? null : appId.trim();
}
public String getIdfa() {
return idfa;
}
public void setIdfa(String idfa) {
this.idfa = idfa == null ? null : idfa.trim();
}
public String getImei() {
return imei;
}
public void setImei(String imei) {
this.imei = imei == null ? null : imei.trim();
}
public String getUnionType() {
return unionType;
}
public void setUnionType(String unionType) {
this.unionType = unionType == null ? null : unionType.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType == null ? null : clientType.trim();
}
public String getTd() {
return td;
}
public void setTd(String td) {
this.td = td == null ? null : td.trim();
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey == null ? null : appKey.trim();
}
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp == null ? null : clientIp.trim();
}
public String getUserAgent() {
return userAgent;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent == null ? null : userAgent.trim();
}
public String getInterfaceType() {
return interfaceType;
}
public void setInterfaceType(String interfaceType) {
this.interfaceType = interfaceType == null ? null : interfaceType.trim();
}
public String getUnionName() {
return unionName;
}
public void setUnionName(String unionName) {
this.unionName = unionName == null ? null : unionName.trim();
}
}
\ No newline at end of file
... ...
package com.yoho.unions.dal.model;
public class NowClickLogs {
private Integer id;
private String appId;
private String idfa;
private String imei;
private String unionType;
private Integer createTime;
private String clientType;
private String td;
private String appKey;
private String clientIp;
private String userAgent;
private String interfaceType;
private String unionName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId == null ? null : appId.trim();
}
public String getIdfa() {
return idfa;
}
public void setIdfa(String idfa) {
this.idfa = idfa == null ? null : idfa.trim();
}
public String getImei() {
return imei;
}
public void setImei(String imei) {
this.imei = imei == null ? null : imei.trim();
}
public String getUnionType() {
return unionType;
}
public void setUnionType(String unionType) {
this.unionType = unionType == null ? null : unionType.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType == null ? null : clientType.trim();
}
public String getTd() {
return td;
}
public void setTd(String td) {
this.td = td == null ? null : td.trim();
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey == null ? null : appKey.trim();
}
public String getClientIp() {
return clientIp;
}
public void setClientIp(String clientIp) {
this.clientIp = clientIp == null ? null : clientIp.trim();
}
public String getUserAgent() {
return userAgent;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent == null ? null : userAgent.trim();
}
public String getInterfaceType() {
return interfaceType;
}
public void setInterfaceType(String interfaceType) {
this.interfaceType = interfaceType == null ? null : interfaceType.trim();
}
public String getUnionName() {
return unionName;
}
public void setUnionName(String unionName) {
this.unionName = unionName == null ? null : unionName.trim();
}
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.MarsClickLogsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.MarsClickLogs" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="app_id" property="appId" jdbcType="VARCHAR" />
<result column="idfa" property="idfa" jdbcType="VARCHAR" />
<result column="imei" property="imei" jdbcType="VARCHAR" />
<result column="union_type" property="unionType" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="client_type" property="clientType" jdbcType="VARCHAR" />
<result column="td" property="td" jdbcType="VARCHAR" />
<result column="app_key" property="appKey" jdbcType="VARCHAR" />
<result column="client_ip" property="clientIp" jdbcType="VARCHAR" />
<result column="user_agent" property="userAgent" jdbcType="VARCHAR" />
<result column="interface_type" property="interfaceType" jdbcType="VARCHAR" />
<result column="union_name" property="unionName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, app_id, idfa, imei, union_type, create_time, client_type, td, app_key, client_ip,
user_agent, interface_type, union_name
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from mars_click_logs
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.yoho.unions.dal.model.MarsClickLogs" >
insert into mars_click_logs (id, app_id, idfa,
imei, union_type, create_time,
client_type, td, app_key,
client_ip, user_agent, interface_type,
union_name)
values (#{id,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR}, #{idfa,jdbcType=VARCHAR},
#{imei,jdbcType=VARCHAR}, #{unionType,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER},
#{clientType,jdbcType=VARCHAR}, #{td,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR},
#{clientIp,jdbcType=VARCHAR}, #{userAgent,jdbcType=VARCHAR}, #{interfaceType,jdbcType=VARCHAR},
#{unionName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.MarsClickLogs" >
insert into mars_click_logs
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="appId != null" >
app_id,
</if>
<if test="idfa != null" >
idfa,
</if>
<if test="imei != null" >
imei,
</if>
<if test="unionType != null" >
union_type,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="clientType != null" >
client_type,
</if>
<if test="td != null" >
td,
</if>
<if test="appKey != null" >
app_key,
</if>
<if test="clientIp != null" >
client_ip,
</if>
<if test="userAgent != null" >
user_agent,
</if>
<if test="interfaceType != null" >
interface_type,
</if>
<if test="unionName != null" >
union_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="appId != null" >
#{appId,jdbcType=VARCHAR},
</if>
<if test="idfa != null" >
#{idfa,jdbcType=VARCHAR},
</if>
<if test="imei != null" >
#{imei,jdbcType=VARCHAR},
</if>
<if test="unionType != null" >
#{unionType,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="clientType != null" >
#{clientType,jdbcType=VARCHAR},
</if>
<if test="td != null" >
#{td,jdbcType=VARCHAR},
</if>
<if test="appKey != null" >
#{appKey,jdbcType=VARCHAR},
</if>
<if test="clientIp != null" >
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="userAgent != null" >
#{userAgent,jdbcType=VARCHAR},
</if>
<if test="interfaceType != null" >
#{interfaceType,jdbcType=VARCHAR},
</if>
<if test="unionName != null" >
#{unionName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.NowClickLogsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.NowClickLogs" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="app_id" property="appId" jdbcType="VARCHAR" />
<result column="idfa" property="idfa" jdbcType="VARCHAR" />
<result column="imei" property="imei" jdbcType="VARCHAR" />
<result column="union_type" property="unionType" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="client_type" property="clientType" jdbcType="VARCHAR" />
<result column="td" property="td" jdbcType="VARCHAR" />
<result column="app_key" property="appKey" jdbcType="VARCHAR" />
<result column="client_ip" property="clientIp" jdbcType="VARCHAR" />
<result column="user_agent" property="userAgent" jdbcType="VARCHAR" />
<result column="interface_type" property="interfaceType" jdbcType="VARCHAR" />
<result column="union_name" property="unionName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, app_id, idfa, imei, union_type, create_time, client_type, td, app_key, client_ip,
user_agent, interface_type, union_name
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from now_click_logs
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from now_click_logs
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.NowClickLogs" >
insert into now_click_logs (id, app_id, idfa,
imei, union_type, create_time,
client_type, td, app_key,
client_ip, user_agent, interface_type,
union_name)
values (#{id,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR}, #{idfa,jdbcType=VARCHAR},
#{imei,jdbcType=VARCHAR}, #{unionType,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER},
#{clientType,jdbcType=VARCHAR}, #{td,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR},
#{clientIp,jdbcType=VARCHAR}, #{userAgent,jdbcType=VARCHAR}, #{interfaceType,jdbcType=VARCHAR},
#{unionName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.NowClickLogs" >
insert into now_click_logs
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="appId != null" >
app_id,
</if>
<if test="idfa != null" >
idfa,
</if>
<if test="imei != null" >
imei,
</if>
<if test="unionType != null" >
union_type,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="clientType != null" >
client_type,
</if>
<if test="td != null" >
td,
</if>
<if test="appKey != null" >
app_key,
</if>
<if test="clientIp != null" >
client_ip,
</if>
<if test="userAgent != null" >
user_agent,
</if>
<if test="interfaceType != null" >
interface_type,
</if>
<if test="unionName != null" >
union_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="appId != null" >
#{appId,jdbcType=VARCHAR},
</if>
<if test="idfa != null" >
#{idfa,jdbcType=VARCHAR},
</if>
<if test="imei != null" >
#{imei,jdbcType=VARCHAR},
</if>
<if test="unionType != null" >
#{unionType,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="clientType != null" >
#{clientType,jdbcType=VARCHAR},
</if>
<if test="td != null" >
#{td,jdbcType=VARCHAR},
</if>
<if test="appKey != null" >
#{appKey,jdbcType=VARCHAR},
</if>
<if test="clientIp != null" >
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="userAgent != null" >
#{userAgent,jdbcType=VARCHAR},
</if>
<if test="interfaceType != null" >
#{interfaceType,jdbcType=VARCHAR},
</if>
<if test="unionName != null" >
#{unionName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...
... ... @@ -135,6 +135,12 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
@Resource
EventUvMapper eventUvMapper;
@Resource
MarsClickLogsMapper marsClickLogsMapper;
@Resource
NowClickLogsMapper nowClickLogsMapper;
@Resource(name="unionServiceImpl")
IUnionService unionService;
... ... @@ -762,6 +768,37 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
unionClickLogs.setInterfaceType(request.getInterfaceType());
unionClickLogs.setUnionName(unionName);
unionClickLogsDAO.insertSelective(unionClickLogs);
if(StringUtils.isNotEmpty(request.getAppkey())&&"mars".equals(request.getAppkey())){
MarsClickLogs marsClickLogs = new MarsClickLogs();
marsClickLogs.setUnionType(request.getUnion_type());
marsClickLogs.setTd(request.getTd());
marsClickLogs.setIdfa(request.getIdfa());
marsClickLogs.setImei(request.getImei());
marsClickLogs.setClientIp(request.getClientIp());
marsClickLogs.setAppKey(request.getAppkey());
marsClickLogs.setAppId(request.getAppid());
marsClickLogs.setCreateTime(DateUtil.getCurrentTimeSecond());
marsClickLogs.setUserAgent(request.getUserAgent());
marsClickLogs.setInterfaceType(request.getInterfaceType());
marsClickLogs.setUnionName(unionName);
marsClickLogsMapper.insertSelective(marsClickLogs);
}
//YOHO!NOW
if(StringUtils.isNotEmpty(request.getAppkey())&&"yoho".equals(request.getAppkey())){
NowClickLogs nowClickLogs = new NowClickLogs();
nowClickLogs.setUnionType(request.getUnion_type());
nowClickLogs.setTd(request.getTd());
nowClickLogs.setIdfa(request.getIdfa());
nowClickLogs.setImei(request.getImei());
nowClickLogs.setClientIp(request.getClientIp());
nowClickLogs.setAppKey(request.getAppkey());
nowClickLogs.setAppId(request.getAppid());
nowClickLogs.setCreateTime(DateUtil.getCurrentTimeSecond());
nowClickLogs.setUserAgent(request.getUserAgent());
nowClickLogs.setInterfaceType(request.getInterfaceType());
nowClickLogs.setUnionName(unionName);
nowClickLogsMapper.insertSelective(nowClickLogs);
}
}
});
}
... ...
... ... @@ -21,6 +21,8 @@ datasources:
- com.yoho.unions.dal.IUnionClickLogsDAO
- com.yoho.unions.dal.IUnionActivityLogsDAO
- com.yoho.unions.dal.IUnionCallbackLogsDAO
- com.yoho.unions.dal.NowClickLogsMapper
- com.yoho.unions.dal.MarsClickLogsMapper
app:
servers:
... ...
... ... @@ -18,6 +18,8 @@ datasources:
- com.yoho.unions.dal.IUnionClickLogsDAO
- com.yoho.unions.dal.IUnionActivityLogsDAO
- com.yoho.unions.dal.IUnionCallbackLogsDAO
- com.yoho.unions.dal.NowClickLogsMapper
- com.yoho.unions.dal.MarsClickLogsMapper
app:
servers:
... ...
... ... @@ -39,14 +39,15 @@
//downUrl = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
var appkey = queryString.appkey;
if (appkey == "yoho") {
//yohonow
downUrl = "http://a.app.qq.com/o/simple.jsp?pkgname=cn.yoho.magazine#opened";
} else if (appkey == "mars") {
//mars
downUrl = "https://itunes.apple.com/cn/app/mars-xin-xian-hao-qu-chu-yu/id1056487123?l=en&mt=8";
//downUrl = "http://yoho-apps.qiniudn.com/YohoMars.apk";
}
// if (appkey == "yoho") {
// //yohonow
// downUrl = "http://a.app.qq.com/o/simple.jsp?pkgname=cn.yoho.magazine#opened";
// } else if (appkey == "mars") {
// //mars
// downUrl = "https://itunes.apple.com/cn/app/mars-xin-xian-hao-qu-chu-yu/id1056487123?l=en&mt=8";
// //downUrl = "http://yoho-apps.qiniudn.com/YohoMars.apk";
// }
if (agent.indexOf("like mac os x") > 0) {
var regStr_saf = /os [\d._]*/gi ;
... ... @@ -99,7 +100,7 @@
$.ajax({
method: 'POST',
url: 'http://union.yoho.cn/union/ClickUnionRest/addUnion',
// url: 'http://192.168.102.205:8088/union/ClickUnionRest/addUnion',
// url: 'http://127.0.0.1:8088/union/ClickUnionRest/addUnion',
data: {
union_type: queryString.union_type,
identify_id: queryString.identify_id,
... ... @@ -107,7 +108,7 @@
client_type: type,
td: queryString.td ? queryString.td : td,
appid: queryString.appid ? queryString.appid : appid,
appkey: queryString.appkey,
appkey: "mars",
idfa : queryString.idfa ? queryString.idfa : queryString.IDFA,
imei:queryString.imei?queryString.imei:queryString.IMEI
},
... ...
... ... @@ -90,7 +90,7 @@
$.ajax({
method: 'POST',
url: 'http://union.yoho.cn/union/ClickUnionRest/addUnion',
// url: 'http://192.168.102.205:8088/union/ClickUnionRest/addUnion',
// url: 'http://127.0.0.1:8088/union/ClickUnionRest/addUnion',
data: {
union_type: queryString.union_type,
identify_id: queryString.identify_id,
... ... @@ -98,7 +98,7 @@
client_type: type,
td: queryString.td ? queryString.td : td,
appid: queryString.appid ? queryString.appid : appid,
appkey: queryString.appkey,
appkey: "yoho",
idfa : queryString.idfa ? queryString.idfa : queryString.IDFA,
imei:queryString.imei?queryString.imei:queryString.IMEI
},
... ...