Authored by linlong

update

... ... @@ -15,12 +15,22 @@ public class UnionClickLogs {
private String clientType;
public String getUserAgent() {
return userAgent;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
private String td;
private String appKey;
private String clientIp;
private String userAgent;
public Integer getId() {
return id;
}
... ...
... ... @@ -21,12 +21,23 @@ public class UnionLogs {
private Integer createTime;
private Integer updateTime;
private String clientType;
private String td;
private String appKey;
public String getInterfaceType() {
return interfaceType;
}
public void setInterfaceType(String interfaceType) {
this.interfaceType = interfaceType;
}
private String interfaceType;
public Integer getId() {
return id;
}
... ...
... ... @@ -12,9 +12,10 @@
<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" />
</resultMap>
<sql id="Base_Column_List" >
id, app_id, idfa, imei, union_type, create_time, client_type, td, app_key, client_ip
id, app_id, idfa, imei, union_type, create_time, client_type, td, app_key, client_ip,user_agent
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
... ... @@ -30,11 +31,11 @@
insert into union_click_logs (id, app_id, idfa,
imei, union_type, create_time,
client_type, td, app_key,
client_ip)
client_ip,user_agent)
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})
#{clientIp,jdbcType=VARCHAR},#{userAgent,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.yoho.unions.dal.model.UnionClickLogs" >
insert into union_click_logs
... ... @@ -69,6 +70,9 @@
<if test="clientIp != null" >
client_ip,
</if>
<if test="userAgent != null" >
user_agent,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
... ... @@ -101,6 +105,9 @@
<if test="clientIp != null" >
#{clientIp,jdbcType=VARCHAR},
</if>
<if test="userAgent != null" >
#{userAgent,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="selectByIdfa" resultMap="BaseResultMap">
... ... @@ -129,7 +136,8 @@
client_type = #{clientType,jdbcType=VARCHAR},
td = #{td,jdbcType=VARCHAR},
app_key = #{appKey,jdbcType=VARCHAR},
client_ip = #{clientIp,jdbcType=VARCHAR}
client_ip = #{clientIp,jdbcType=VARCHAR},
user_agent = #{userAgent,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -17,11 +17,12 @@
<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="interface_type" property="interfaceType" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id, app_id, udid, idfa, imei, is_activate, union_type, add_params,
activate_params,
create_time, update_time, client_type, td, app_key
create_time, update_time, client_type, td, app_key,interface_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
... ... @@ -38,13 +39,13 @@
insert into union_logs (id, app_id, udid,
idfa, imei, is_activate,
union_type, add_params, activate_params,
create_time, update_time, client_type, td, app_key)
create_time, update_time, client_type, td, app_key,interface_type)
values (#{id,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR},
#{udid,jdbcType=VARCHAR},
#{idfa,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{isActivate,jdbcType=TINYINT},
#{unionType,jdbcType=INTEGER}, #{addParams,jdbcType=VARCHAR},
#{activateParams,jdbcType=VARCHAR},
#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{clientType}, #{td}, #{appKey})
#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{clientType}, #{td}, #{appKey}, #{interfaceType})
</insert>
<update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionLogs">
update union_logs
... ... @@ -58,7 +59,8 @@
activate_params = #{activateParams,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=INTEGER},
client_type=#{clientType},
app_key=#{appKey}
app_key=#{appKey},
interface_type=#{interfaceType}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateUnionLogs">
... ...
... ... @@ -333,6 +333,7 @@ public class ClickUnionRest {
bo.setAppid("com.yoho");
String agent = request.getHeader("user-agent");
agent = agent.toLowerCase();
bo.setUserAgent(agent);
log.info("addUnion4Stream user-agent={}", agent);
String url = "http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk";
try {
... ...
... ... @@ -425,6 +425,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
logs.setAddParams(value);
logs.setTd(request.getTd());
logs.setAppKey(request.getAppkey());
logs.setInterfaceType(click.getInterfaceType());
unionLogsDAO.insert(logs);
log.info("activateUnion add db success with request is {}, and dbData={}", request, logs);
... ... @@ -540,6 +541,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
unionClickLogs.setAppKey(request.getAppkey());
unionClickLogs.setAppId(request.getAppid());
unionClickLogs.setCreateTime(DateUtil.getCurrentTimeSecond());
unionClickLogs.setUserAgent(request.getUserAgent());
unionClickLogsDAO.insertSelective(unionClickLogs);
}
});
... ...