package com.njcn.csharmonic.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
import com.njcn.csharmonic.api.fallback.EventFeignClientFallbackFactory;
import com.njcn.csharmonic.param.CsEventUserQueryPage;
import com.njcn.csharmonic.param.CsEventUserQueryParam;
import com.njcn.csharmonic.pojo.po.CsEventPO;
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 gfh
 */
@FeignClient(value = ServerInfo.CS_HARMONIC_BOOT, path = "/event", fallbackFactory = EventFeignClientFallbackFactory.class,contextId = "event")
public interface EventFeignClient {

    @PostMapping("/saveBatchEventList")
    HttpResult<String> saveBatchEventList(@RequestBody List<CsEventPO> csEventPOS);

    @PostMapping("/pageQueryByLineId")
    HttpResult<Page<DataGroupEventVO>> pageQueryByLineId(@RequestBody CsEventUserQueryPage csEventUserQueryPage);
    @PostMapping("/queryByIndex")
    HttpResult<CsEventPO> queryByIndex(@RequestBody CsEventPO csEventPO);

    @PostMapping("/queryById")
    HttpResult<CsEventPO> queryById(@RequestParam("eventId") String eventId);

    @PostMapping("/getEventByTime")
    HttpResult<List<CsEventPO>> getEventByTime(@RequestParam(name = "lineList", required = false) List<String> lineList,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime);

    @PostMapping("/getDevAlarmList")
    HttpResult<List<CsEventPO>> getDevAlarmList(@RequestBody CsEventUserQueryParam param);

    @PostMapping("/getEventByIdList")
    HttpResult<List<CsEventPO>> getEventByIdList(@RequestBody List<String> list);

}
