推送列表缓存key修改

This commit is contained in:
谢洪龙 2017-08-01 18:22:27 +08:00
parent af6ac0c002
commit 539ebf0be9
3 changed files with 147 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import com.ifish.bean.Tbl_Device_Statistics;
import com.ifish.bean.Tbl_Device_User; import com.ifish.bean.Tbl_Device_User;
import com.ifish.bean.Tbl_Live_Message; import com.ifish.bean.Tbl_Live_Message;
import com.ifish.bean.Tbl_Live_Room; import com.ifish.bean.Tbl_Live_Room;
import com.ifish.bean.Tbl_Push_List;
import com.ifish.bean.Tbl_User; import com.ifish.bean.Tbl_User;
import com.ifish.util.RedisKey; import com.ifish.util.RedisKey;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -379,7 +380,7 @@ public class RedisKeyHelper implements RedisKeyHelperI {
deleteTbl_DeviceInfo(device); deleteTbl_DeviceInfo(device);
try { try {
Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(device.getDeviceId()); Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(device.getDeviceId());
deleteRedisByTbl_Device_Statistics(device_Statistics); deleteTbl_Device_StatisticsInfo(device_Statistics);
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -407,7 +408,7 @@ public class RedisKeyHelper implements RedisKeyHelperI {
deleteTbl_Device_StatisticsInfo(device); deleteTbl_Device_StatisticsInfo(device);
try { try {
Tbl_Device device1 = deviceHelper.getDeviceById(device.getDeviceId()); Tbl_Device device1 = deviceHelper.getDeviceById(device.getDeviceId());
deleteRedisByTbl_Device(device1); deleteTbl_DeviceInfo(device1);
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -432,9 +433,9 @@ public class RedisKeyHelper implements RedisKeyHelperI {
deleteTbl_Device_UserInfo(tbl_Device_User); deleteTbl_Device_UserInfo(tbl_Device_User);
try { try {
Tbl_Device device1 = deviceHelper.getDeviceById(tbl_Device_User.getDeviceId()); Tbl_Device device1 = deviceHelper.getDeviceById(tbl_Device_User.getDeviceId());
deleteRedisByTbl_Device(device1); deleteTbl_DeviceInfo(device1);
Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(tbl_Device_User.getDeviceId()); Tbl_Device_Statistics device_Statistics = deviceHelper.getDeviceStatisticsByDeviceId(tbl_Device_User.getDeviceId());
deleteRedisByTbl_Device_Statistics(device_Statistics); deleteTbl_Device_StatisticsInfo(device_Statistics);
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -513,4 +514,80 @@ public class RedisKeyHelper implements RedisKeyHelperI {
redisHelperI.delRedisByTagKey(RedisKey.LIVEMESSAGE_ROOMID + tbl_Live_Message.getRoomId()); redisHelperI.delRedisByTagKey(RedisKey.LIVEMESSAGE_ROOMID + tbl_Live_Message.getRoomId());
redisHelperI.deleteRedis(RedisKey.LIVEMESSAGE_COUNT + tbl_Live_Message.getRoomId()); redisHelperI.deleteRedis(RedisKey.LIVEMESSAGE_COUNT + tbl_Live_Message.getRoomId());
} }
/**
* 后台推送消息列表缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
@Override
public String getAdmin_Tbl_Push_List_BySelect(Integer start, Integer length, String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode) {
return RedisKey.PUSHLIST_SELECT + start + "_" + length + "_" + sdkVersion + "_" + phoneNumber + "_" + mac + "_" + phoneType + "_" + pushType + "_" + sortField + "_" + sortMode;
}
/**
* 后台推送消息列表查询数量缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
@Override
public String getAdmin_Tbl_Push_List_Count_BySelect(String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode) {
return RedisKey.PUSHLIST_SELECT + "count_" + sdkVersion + "_" + phoneNumber + "_" + mac + "_" + phoneType + "_" + pushType + "_" + sortField + "_" + sortMode;
}
/**
* 后台推送消息列表总数缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
@Override
public String getAdmin_Tbl_Push_List_AllCount() {
return RedisKey.PUSHLIST_SELECT;
}
/**
* 根据条件删除推送列表缓存
*
* @param pushId
*/
public void deleteRedisByTbl_Push_List(Tbl_Push_List tbl_Push_List) {
if (tbl_Push_List.getPushId() != null) {
redisHelperI.deleteRedis(getTbl_Push_List_RedisByPushId(tbl_Push_List.getPushId()));
}
deleteRedisByTbl_Push_ListToAllRedisList();
}
/**
* 删除推送列表类缓存
*/
public void deleteRedisByTbl_Push_ListToAllRedisList() {
redisHelperI.delRedisByTagKey(RedisKey.PUSHLIST_SELECT);
}
} }

View File

@ -10,6 +10,7 @@ import com.ifish.bean.Tbl_Device_Statistics;
import com.ifish.bean.Tbl_Device_User; import com.ifish.bean.Tbl_Device_User;
import com.ifish.bean.Tbl_Live_Message; import com.ifish.bean.Tbl_Live_Message;
import com.ifish.bean.Tbl_Live_Room; import com.ifish.bean.Tbl_Live_Room;
import com.ifish.bean.Tbl_Push_List;
import com.ifish.bean.Tbl_User; import com.ifish.bean.Tbl_User;
/** /**
@ -257,6 +258,54 @@ public interface RedisKeyHelperI {
*/ */
public String getTbl_Push_List_RedisByPushId(Integer pushId); public String getTbl_Push_List_RedisByPushId(Integer pushId);
/**
* 后台推送消息列表缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
public String getAdmin_Tbl_Push_List_BySelect(Integer start, Integer length, String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode);
/**
* 后台推送消息列表查询数量缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
public String getAdmin_Tbl_Push_List_Count_BySelect(String sdkVersion, String phoneNumber, String mac, String phoneType, String pushType, String sortField, String sortMode);
/**
* 后台推送消息列表总数缓存
*
* @param start
* @param length
* @param sdkVersion
* @param phoneNumber
* @param mac
* @param phoneType
* @param pushType
* @param sortField
* @param sortMode
* @return
*/
public String getAdmin_Tbl_Push_List_AllCount();
/** /**
* 根据MD5值获取redis缓存key键值注册账号用 * 根据MD5值获取redis缓存key键值注册账号用
* *
@ -321,4 +370,16 @@ public interface RedisKeyHelperI {
* @param tbl_Live_Message * @param tbl_Live_Message
*/ */
public void deleteRedisByTbl_Live_Message(Tbl_Live_Message tbl_Live_Message); public void deleteRedisByTbl_Live_Message(Tbl_Live_Message tbl_Live_Message);
/**
* 根据条件删除推送列表缓存
*
* @param pushId
*/
public void deleteRedisByTbl_Push_List(Tbl_Push_List tbl_Push_List);
/**
* 删除推送列表类缓存
*/
public void deleteRedisByTbl_Push_ListToAllRedisList();
} }

View File

@ -134,6 +134,11 @@ public class RedisKey {
*/ */
public static final String PUSHLIST_PUSHID = "pushlistE:id_"; public static final String PUSHLIST_PUSHID = "pushlistE:id_";
/**
* 后台推送列表缓存条件
*/
public static final String PUSHLIST_SELECT = "pushlistE:se_";
/** /**
* 邮箱验证有效缓存key * 邮箱验证有效缓存key
*/ */