package com.njcn.device.pq.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.device.pq.api.fallback.DeviceFeignClientFallbackFactory;
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
import com.njcn.device.pq.pojo.dto.DeviceDTO;
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;

/**
 * @author xy
 */
@FeignClient(
        value = ServerInfo.DEVICE,
        path = "/dev",
        fallbackFactory = DeviceFeignClientFallbackFactory.class,
        contextId = "dev")
public interface DeviceFeignClient {

    /**
     * 技术监督修改装置定检时间
     *
     * @param devId              监测点id
     * @param thisTimeCheck     起始时间
     * @param nextTimeCheck     结束时间
     * @return 终端状态信息
     */
    @PostMapping("/updateDevCheckTime")
    @ApiOperation("技术监督修改装置定检时间")
    HttpResult<String> updateDevCheckTime(@RequestParam("devId") String devId,
                                                 @RequestParam("thisTimeCheck") String thisTimeCheck,
                                                 @RequestParam("nextTimeCheck") String nextTimeCheck);

    @PostMapping("/updateDevComFlag")
    @ApiOperation("修改装置通讯状态及时间")
    HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO);


    @PostMapping("/getDeviceInfo")
    @ApiOperation("查询设备详情")
    HttpResult<DeviceDTO> getDeviceInfo(@RequestParam("devId") String devId);

}
