package com.tzld.piaoquan.ad.engine.server.controller;

import com.tzld.piaoquan.ad.engine.service.predict.PredictModelService;
import com.tzld.piaoquan.ad.engine.service.predict.container.AbTestConfigContainer;
import com.tzld.piaoquan.ad.engine.service.predict.param.request.RoiPredictModelRequestParam;
import com.tzld.piaoquan.ad.engine.service.predict.param.request.ThresholdPredictModelRequestParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

@RestController
@RequestMapping("/predict")
public class PredictController {

    private final static Logger log = LoggerFactory.getLogger(PredictController.class);

    @Autowired
    PredictModelService predictModelService;

    @Autowired
    AbTestConfigContainer adTestConfigContainer;

    /**
     * 没有统一封装response
     * @param param
     * @return
     */
    @RequestMapping("/ab/model")
    public Map<String,Object> adPredictByAbTestModel(@RequestBody ThresholdPredictModelRequestParam param){

        return predictModelService.adPredictWithDataFill(param);
    }


    @RequestMapping("/roi/model")
    public Map<String,Object> adPredictByRoiModel(@RequestBody RoiPredictModelRequestParam param){
        return predictModelService.adRecommendPredictByRoiModel(param);
    }

    @RequestMapping("/test")
    public void test(Integer appType,String typeValue){
//        adTestConfigContainer.initMap(appType,typeValue);
    }

}
