package com.tzld.piaoquan.recommend.server.service.recall.strategy;

import com.tzld.piaoquan.recommend.server.service.recall.RecallParam;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class PrioriPremiumRovnRecallStrategy extends AbstractRedisRecallStrategy {
    private static final int topN = 60;
    public static final String PUSH_FORM = "priori_premium_rovn";
    private static final String redisKeyPrefix = "priori_premium_rovn_recall";

    @Override
    public String pushFrom() {
        return PUSH_FORM;
    }

    @Override
    protected List<String> getRedisKeys(RecallParam param) {
        List<String> keys = new ArrayList<>();
        if (null != param) {
            String province = param.getProvince();
            if (null != province && !province.isEmpty()) {
                keys.add(String.format("%s:%s", redisKeyPrefix, province));
            }
        }
        return keys;
    }

    @Override
    protected int getTopN() {
        return topN;
    }
}