数据上报
parent
1c5f015c33
commit
db63d5f3ae
|
|
@ -1,7 +1,6 @@
|
|||
package com.ljsd.jieling.ktbeans;
|
||||
|
||||
import com.ljsd.jieling.ktbeans.reportEvent.CommonEventHandler;
|
||||
import com.ljsd.jieling.ktbeans.reportEvent.LoginEventHandler;
|
||||
import com.ljsd.jieling.ktbeans.reportEvent.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -13,17 +12,17 @@ import java.util.Map;
|
|||
*/
|
||||
public enum ReportEventEnum {
|
||||
|
||||
CREATE_ACCOUNT(1,"create_account", new CommonEventHandler(),new String[]{""}),
|
||||
CREATE_ACCOUNT(1,"create_account", new CreateRoleEventHanlder(),new String[]{""}),
|
||||
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
|
||||
CREATE_ROLE(3,"create_role ", new CommonEventHandler(),new String[]{"role_name"}),
|
||||
GUILD(4,"guild", new CommonEventHandler(),new String[]{"step_id","step_name","rewards_list","guild_start_time"}),
|
||||
LEVEL_UP(5,"level_up", new CommonEventHandler(),new String[]{"promotion_level","improved_level"}),
|
||||
LEVEL_UP(5,"level_up", new UserLevelUpEventHandler(),new String[]{"promotion_level","improved_level"}),
|
||||
MISSION_START(6,"mission_start", new CommonEventHandler(),new String[]{"mission_id","mission_name"}),
|
||||
MISSION_COMPLETE(7,"mission_complete", new CommonEventHandler(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
|
||||
JOIN_ACTIVITY(8,"join_activity", new CommonEventHandler(),new String[]{"activity_id","activity_name"}),
|
||||
COMPLETE_ACTIVITY(9,"complete_activity", new CommonEventHandler(),new String[]{"activity_id","activity_name","reward_list"}),
|
||||
ENTER_STAGE(10,"enter_stage", new CommonEventHandler(),new String[]{"stage_id","stage_name"}),
|
||||
PASS_STAGE(11,"pass_stage", new CommonEventHandler(),new String[]{"stage_id","stage_name"}),
|
||||
PASS_STAGE(11,"pass_stage", new PassStageEventHandler(),new String[]{"stage_id","stage_name"}),
|
||||
GET_HERO(12,"get_hero", new CommonEventHandler(),new String[]{"hero_id","quality","get_type"}),
|
||||
HERO_STRENGTHEN(13,"hero_strengthen", new CommonEventHandler(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list"}),
|
||||
GET_EQUIP(14,"get_equip", new CommonEventHandler(),new String[]{"equip_id","quality","get_type"}),
|
||||
|
|
@ -40,12 +39,14 @@ public enum ReportEventEnum {
|
|||
JOIN_GUILD(25,"join_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
||||
QUIT_GUILD(26,"quit_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
||||
CREATE_ORDER(27,"create_order", new CommonEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
|
||||
ORDER_COMPLETE(28,"order_complete", new CommonEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
|
||||
ORDER_COMPLETE(28,"order_complete", new ChargeAmountEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
|
||||
CHECK_RANKING(29,"check_ranking", new CommonEventHandler(),new String[]{"ranking_type"}),
|
||||
ASK_FOR_BEING_FRIENDS(30,"ask_for_being_friends", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content"}),
|
||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""});
|
||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
||||
|
||||
private int type;
|
||||
|
|
|
|||
|
|
@ -79,17 +79,22 @@ public class ReportUtil {
|
|||
try {
|
||||
//todo 访客id
|
||||
ta.setSuperProperties(reportUserEvent.getBaseInfo());
|
||||
ta.track("1000001","1000001",reportUserEvent.getEventName(),reportUserEvent.getEventInfo());
|
||||
// for(int type:reportUserEvent.getUserProperties().keySet()){
|
||||
// if(type==1){
|
||||
// ta.user_set("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
// }else{
|
||||
// ta.user_setOnce("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
// }
|
||||
// }
|
||||
if(reportUserEvent.getUserProperties()!=null){
|
||||
for(int type:reportUserEvent.getUserProperties().keySet()){
|
||||
if(type==1){
|
||||
ta.user_set("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
}else{
|
||||
ta.user_setOnce("1000001","1000001",reportUserEvent.getUserProperties().get(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!reportUserEvent.getEventName().isEmpty()){
|
||||
ta.track("1000001","1000001",reportUserEvent.getEventName(),reportUserEvent.getEventInfo());
|
||||
}
|
||||
ta.flush();
|
||||
} catch (Exception e) {
|
||||
//异常处理
|
||||
e.printStackTrace();
|
||||
System.out.println("except:"+e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/9
|
||||
* @discribe
|
||||
*/
|
||||
public class ChargeAmountEventHandler extends CommonEventHandler {
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
Map<String, Object> setOnceProperties = new HashMap<>();
|
||||
|
||||
|
||||
setProperties.put("charge_amount",user.getPlayerInfoManager().getRechargeInfo().getSaveAmt());
|
||||
setProperties.put("last_recharge_time",new Date());
|
||||
setOnceProperties.put("first_charge_time",new Date());
|
||||
setOnceProperties.put("first_charge_amount",user.getPlayerInfoManager().getRechargeInfo().getSaveAmt());
|
||||
userProperties.put(1,setProperties);
|
||||
userProperties.put(2,setOnceProperties);
|
||||
return userProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/9
|
||||
* @discribe
|
||||
*/
|
||||
public class CreateRoleEventHanlder extends CommonEventHandler{
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
Map<String, Object> setOnceProperties = new HashMap<>();
|
||||
|
||||
setProperties.put("role_name",user.getPlayerInfoManager().getNickName());
|
||||
setOnceProperties.put("role_create_time",new Date());
|
||||
userProperties.put(1,setProperties);
|
||||
userProperties.put(2,setOnceProperties);
|
||||
return userProperties;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,8 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
|
|||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -25,7 +27,8 @@ public class LoginEventHandler extends CommonEventHandler {
|
|||
setProperties.put("coins_amount",itemMap.get(ReportUtil.COIN_ID)==null?0:itemMap.get(ReportUtil.COIN_ID).getItemNum());
|
||||
setProperties.put("amulet_amount",itemMap.get(ReportUtil.AMULET_ID)==null?0:itemMap.get(ReportUtil.AMULET_ID).getItemNum());
|
||||
setProperties.put("diamond_amount",itemMap.get(ReportUtil.DIAMOND_ID)==null?0:itemMap.get(ReportUtil.DIAMOND_ID).getItemNum());
|
||||
setProperties.put("items_list_now",itemMap.keySet());
|
||||
setProperties.put("items_list_now", new ArrayList<>(itemMap.keySet()));
|
||||
setProperties.put("last_login_time",new Date());
|
||||
// setProperties.put("level",user.getPlayerInfoManager().getLevel());
|
||||
// setProperties.put("vip_level",user.getPlayerInfoManager().getVipLevel());
|
||||
userProperties.put(1,setProperties);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/9
|
||||
* @discribe
|
||||
*/
|
||||
public class PassStageEventHandler extends CommonEventHandler {
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
setProperties.put("max_stage_level",user.getMainLevelManager().getFightId());
|
||||
userProperties.put(1,setProperties);
|
||||
return userProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/9
|
||||
* @discribe
|
||||
*/
|
||||
public class UserLevelUpEventHandler extends CommonEventHandler {
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
setProperties.put("level",user.getPlayerInfoManager().getLevel());
|
||||
userProperties.put(1,setProperties);
|
||||
return userProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.ljsd.jieling.ktbeans.reportEvent;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/7/9
|
||||
* @discribe
|
||||
*/
|
||||
public class VipLevelUpEventHandler extends CommonEventHandler {
|
||||
@Override
|
||||
public Map<Integer, Map<String, Object>> getUserProperties(User user) {
|
||||
Map<Integer,Map<String, Object>> userProperties = new HashMap<>();
|
||||
Map<String, Object> setProperties = new HashMap<>();
|
||||
Map<String, Object> setOnceProperties = new HashMap<>();
|
||||
|
||||
setProperties.put("vip_level",user.getPlayerInfoManager().getVipLevel());
|
||||
if(user.getPlayerInfoManager().getVipLevel()==1){
|
||||
setOnceProperties.put("first_vip_level_up",new Date());
|
||||
}
|
||||
userProperties.put(1,setProperties);
|
||||
userProperties.put(2,setOnceProperties);
|
||||
return userProperties;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +49,8 @@ public interface ActivityType {
|
|||
|
||||
int NEW_WELFARE = 42;//萌新福利
|
||||
int LIMIT_RANDOM_CARD = 43;//限时抽卡
|
||||
|
||||
|
||||
int BEAUTY_BAG = 44;//乾坤包囊
|
||||
int MISSIONSEARCH_EXPERT = 46;//寻宝达人
|
||||
int LUCKWHEEL_EXPERT = 47;//探宝达人
|
||||
int HERORANDOM_EXPERT = 48;//征募达人
|
||||
|
|
@ -66,5 +67,4 @@ public interface ActivityType {
|
|||
|
||||
int NEW_EIGHT_LOGIN = 56;//新的八日登录
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ public enum ActivityTypeEnum {
|
|||
BUY_GOLD(ActivityType.BUY_GOLD,BuyGoldActivity::new),
|
||||
ECPEDITION_ACTIVITY(ActivityType.ECPEDITION_ACTIVITY,DefaultEmptyActivity::new),
|
||||
COPY_PASS(ActivityType.COPY_PASS,ChapterRewardActivity::new),
|
||||
NEW_EIGHT_LOGIN(ActivityType.NEW_EIGHT_LOGIN,NewEightActivity::new)
|
||||
|
||||
NEW_EIGHT_LOGIN(ActivityType.NEW_EIGHT_LOGIN,NewEightActivity::new),
|
||||
BEAUTY_BAG(ActivityType.BEAUTY_BAG,DefaultEmptyActivity::new)
|
||||
|
||||
;
|
||||
private int type;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.event.GuildForceChangeEvent;
|
||||
|
|
@ -257,6 +259,7 @@ public class PlayerLogic {
|
|||
builder.setVipBaseInfo(vipInfoProto);
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.VIP_LEVELUP_RESPONSE_VALUE,builder.build(),true);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.VIP_LEVEL_UP.getType());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue