package com.tzld.piaoquan.recommend.server.framework.recaller;

import com.tzld.piaoquan.recommend.server.framework.candidiate.Candidate;
import com.tzld.piaoquan.recommend.server.framework.common.User;
import com.tzld.piaoquan.recommend.server.gen.recommend.RecommendRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public abstract class AbstractFilter<T> {
    protected final static Logger LOGGER = LoggerFactory.getLogger(AbstractFilter.class);
    protected final FilterConfigInfo filterConfigInfo;
    protected final RecommendRequest requestContext;
    protected final User user;

    public AbstractFilter(FilterConfigInfo filterConfigInfo,
                          RecommendRequest requestContext,
                          User user) {

        this.filterConfigInfo = filterConfigInfo;
        this.requestContext = requestContext;
        this.user = user;
    }

    public FilterConfigInfo getFilterConfigInfo() {
        return filterConfigInfo;
    }

    public abstract void doFilter(Candidate candidate, List<T> t);
}
