package com.njcn.event.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.event.api.fallback.EventDetailFeignClientFallbackFactory;
import com.njcn.event.pojo.po.EventDetail;
import org.springframework.cloud.openfeign.FeignClient;
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;

/**
 * @author denghuajun
 * @version 1.0.0
 * @date 2022/3/16
 */
@FeignClient(value = ServerInfo.EVENT,path = "/event",fallbackFactory = EventDetailFeignClientFallbackFactory.class)
public interface EventDetailFeignClient {

    /**
     * 根据监测点id获取暂降事件
     * @param id 监测点id
     * @return 暂降事件信息
     */
    @PostMapping("/getEventDetailData")
    HttpResult<List<EventDetail>> getEventDetailData(@RequestParam("id")String id, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime);

    /**
     * 根据监测点集合获取暂降事件
     * @return 暂降事件信息
     */
    @PostMapping("/getEventDetail")
    HttpResult<List<EventDetail>> getEventDetail(@RequestBody List<String> lineIndexes, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime);

    /**
     * 根据监测点集合分页获取暂降事件
     * @return 暂降事件信息
     */
    @PostMapping("/getEventDetailLimit")
    HttpResult<List<EventDetail>> getEventDetailLimit(@RequestBody List<String> lineIndexes, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime,@RequestParam("pageSize") Integer pageSize,@RequestParam("pageNum") Integer pageNum);

}
