package com.njcn.csharmonic.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csharmonic.api.fallback.CsHarmonicFeignClientFallbackFactory;
import com.njcn.csharmonic.pojo.po.CsHarmonic;
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 = "/csHarmonic", fallbackFactory = CsHarmonicFeignClientFallbackFactory.class,contextId = "csHarmonic")
public interface CsHarmonicFeignClient {

    @PostMapping("/addList")
    @ApiOperation("批量写入数据")
    HttpResult<Boolean> addList(@RequestBody List<CsHarmonic> list);

    @PostMapping("/queryListByTime")
    @ApiOperation("按日期查询数据")
    HttpResult<List<CsHarmonic>> queryListByTime(@RequestParam(value = "time") String time);


    @PostMapping("/deleteListByTime")
    @ApiOperation("按日期删除数据")
    HttpResult<Boolean> deleteListByTime(@RequestParam(value = "time") String time);

}
