package com.njcn.csharmonic.api;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csharmonic.api.fallback.CsAlarmFeignClientFallbackFactory;
import com.njcn.csharmonic.pojo.po.CsAlarm;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
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 xy
 */
@FeignClient(value = ServerInfo.CS_HARMONIC_BOOT, path = "/csAlarm", fallbackFactory = CsAlarmFeignClientFallbackFactory.class,contextId = "csAlarm")
public interface CsAlarmFeignClient {

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/addList")
    @ApiOperation("批量写入数据")
    @ApiImplicitParam(name = "list", value = "参数", required = true)
    HttpResult<Boolean> addList(@RequestBody List<CsAlarm> list);

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/queryListByTime")
    @ApiOperation("按日期查询数据")
    @ApiImplicitParam(name = "time", value = "时间", required = true)
    HttpResult<List<CsAlarm>> queryListByTime(@RequestParam("time") String time);

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/deleteListByTime")
    @ApiOperation("按日期删除数据")
    @ApiImplicitParam(name = "time", value = "时间", required = true)
    HttpResult<Boolean> deleteListByTime(@RequestParam("time") String time);

}
