Commit 77724859 authored by 宋新宇's avatar 宋新宇

修改缓存key

parent 79d7114e
......@@ -80,7 +80,7 @@ public class AttributeController extends BaseHelper {
//匹配设备ID
for(DeviceType type:DeviceType.values()){
deviceIdKey = type.getDeviceId(clientInfo);
if(null != deviceIdKey && null != (deliveryDeviceInfo = getForRedis(assembleKey(deviceIdKey,platformId)))){
if(null != deviceIdKey && null != (deliveryDeviceInfo = getForRedis(assembleKey(deviceIdKey,platformId,type)))){
deviceType = type;
clientInfo.setOaid(deliveryDeviceInfo.getOaid()); //回补OAID
break;
......
package com.lwby.aas.handle;
import cn.hutool.crypto.SecureUtil;
import com.lwby.aas.DeviceType;
import com.lwby.aas.po.AppChannel;
import com.lwby.aas.vo.DeliveryDeviceInfo;
import org.apache.commons.lang3.time.FastDateFormat;
......@@ -19,8 +20,11 @@ public class BaseHelper {
public static final FastDateFormat DATE_BOTTOM_FORMAT = FastDateFormat.getInstance("yyyy_MM_dd", TimeZone.getTimeZone(ZoneId.of("Asia/Shanghai")));
public String assembleKey(String deviceId, int platformId) {
return String.format("getClickByIdfaAndPlatformId:%s:%d", SecureUtil.md5(deviceId), platformId);
public String assembleKey(String deviceId, int platformId, DeviceType type) {
if (DeviceType.IP == type) {
return String.format("mck:%s:%d", SecureUtil.md5(deviceId), platformId);
}
return String.format("getClickByIdfaAndPlatformId_%s_%d", SecureUtil.md5(deviceId), platformId);
}
/**
......
......@@ -63,7 +63,7 @@ public class TestHandle extends BaseHelper{
//匹配设备ID
for(DeviceType type:DeviceType.values()){
deviceIdKey = type.getDeviceId(clientInfo);
if(null != deviceIdKey && null != (deliveryDeviceInfo = getForRedis(assembleKey(deviceIdKey,platformId)))){
if(null != deviceIdKey && null != (deliveryDeviceInfo = getForRedis(assembleKey(deviceIdKey,platformId,type)))){
deviceType = type;
clientInfo.setOaid(deliveryDeviceInfo.getOaid()); //回补OAID
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment