SknBaseInfoRequest.java
1.23 KB
package com.yoho.search.models.recall;
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.cache.CacheTimeConstants;
import com.yoho.search.cache.model.ICacheRequest;
import java.util.Arrays;
import java.util.List;
public class SknBaseInfoRequest implements ICacheRequest{
public static final List<String> includeFields = Arrays.asList(ProductIndexEsField.productId,ProductIndexEsField.productSkn,ProductIndexEsField.brandId,ProductIndexEsField.middleSortId,ProductIndexEsField.priceArea,ProductIndexEsField.productFeatureFactor,ProductIndexEsField.heatValue);
private Integer productSkn;
public SknBaseInfoRequest(Integer productSkn){
this.productSkn = productSkn;
}
@Override
public RedisKeyBuilder redisKeyBuilder() {
return RedisKeyBuilder.newInstance().appendFixed("YOHOSEARCH:").appendFixed("SKN_BASE_INFO:").appendVar(cacheTimeInMinute()).appendFixed(":").appendVar(productSkn);
}
@Override
public int cacheTimeInMinute() {
return CacheTimeConstants.SKN_BASE_INFO;
}
public Integer getProductSkn() {
return productSkn;
}
}