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

import com.tzld.longarticle.recommend.server.model.Content;
import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService;
import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
import com.tzld.longarticle.recommend.server.service.filter.FilterResult;
import com.tzld.longarticle.recommend.server.service.filter.FilterService;
import com.tzld.longarticle.recommend.server.service.recall.FilterParamFactory;
import com.tzld.longarticle.recommend.server.service.recall.RecallParam;
import com.tzld.longarticle.recommend.server.service.recall.RecallStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

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

/**
 * @author sunxy
 */
@Component
public class DefaultRecallStrategy implements RecallStrategy {

    @Autowired
    private FilterService filterService;
    @Autowired
    private AIGCRemoteService aigcRemoteService;

    @Override
    public List<Content> recall(RecallParam param) {

        List<Content> content = aigcRemoteService.getAllContent();
        FilterParam filterParam = FilterParamFactory.create(param, content);
        FilterResult filterResult = filterService.filter(filterParam);
        List<Content> videosResult = new ArrayList<>();
        return videosResult;
    }

}
