package com.ytpm.feign;

import com.ytpm.advertise.param.AddAppParam;
import com.ytpm.advertise.param.AddPlacementParam;
import com.ytpm.advertise.param.ComprehensiveReportParam;
import com.ytpm.advertise.param.ConcurrentHourReportsParams;
import com.ytpm.advertise.param.HourReportParam;
import com.ytpm.advertise.param.RelativeChannelParam;
import com.ytpm.advertise.param.UnitsParam;
import com.ytpm.advertise.view.AddAppResponse;
import com.ytpm.advertise.view.AddPlacementResponse;
import com.ytpm.advertise.view.ComprehensiveAppReport;
import com.ytpm.advertise.view.ComprehensiveReportView;
import com.ytpm.advertise.view.HourReportRes;
import com.ytpm.advertise.view.HourReportView;
import com.ytpm.general.Result;
import com.ytpm.general.ResultTable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "advertise-service")
public interface AdvertiseFeign {
    @PostMapping("/advertise/saveApp")
    Result<AddAppResponse> saveApp(@RequestBody AddAppParam param);
    @GetMapping("/advertise/delApp")
    Result<?> delApp(@RequestParam("appId") String appId,@RequestParam("takuPublicKey") String takuPublicKey);
    @PostMapping("/advertise/relativePlatform")
    Result<?> relativePlatform(@RequestBody RelativeChannelParam channelParam);
    @PostMapping("/advertise/savePlacement")
    ResultTable<AddPlacementResponse> savePlacement(@RequestBody AddPlacementParam param);
    @GetMapping("/advertise/delPlacement")
    Result<?> delPlacement(@RequestParam("placementId")String placementId,@RequestParam("takuPublicKey") String takuPublicKey);
    @PostMapping("/advertise/getAppReport")
    List<ComprehensiveAppReport> getAppReport(@RequestBody ComprehensiveReportParam param);
    @PostMapping("/advertise/comprehensive")
    Result<ComprehensiveReportView> comprehensive(@RequestBody ComprehensiveReportParam param);

    @PostMapping("/advertise/hourReport")
    ResultTable<HourReportView> hourReport(@RequestBody HourReportParam param);

    @PostMapping("/advertise/concurrentHourReports")
    Result<List<HourReportRes>> concurrentHourReports(@RequestBody ConcurrentHourReportsParams param);

    @GetMapping("/advertise/delAdSource")
    Result<?> delAdSource(@RequestParam("adSourceId") Integer adSourceId,@RequestParam("takuPublicKey") String takuPublicKey);
    @PostMapping("/advertise/saveAdSource")
    Result<?> saveAdSource(@RequestBody UnitsParam param);

    @PostMapping("/advertise/updateAdSource")
    Result<?> updateAdSource(@RequestBody UnitsParam param);
}
