package com.usky.transfer;


import com.usky.common.core.bean.ApiResult;
import com.usky.transfer.domain.*;
import com.usky.transfer.factory.RemoteTransferFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "remoteTransferService", value = "service-transfer", fallbackFactory = RemoteTransferFallbackFactory.class)
public interface RemoteTransferService {

    /**
     * 单个设备数据写入
     * @return
     */
    @PostMapping("/sendDeviceData")
    ApiResult<Void> sendDeviceData(@RequestBody DeviceDataWriteVO writeVO);

    @PostMapping("/deleteProductCache")
    ApiResult<Void> deleteProductCache();
    @PostMapping("/deleteDeviceCache")
    ApiResult<Void> deleteDeviceCache(@RequestParam("productCode") String productCode);

    /**
     * 下发单个设备控制命令
     */
    @PostMapping("/deviceControl")
    Map<String,Object> deviceControl(@RequestParam("productCode") String productCode, @RequestParam(value = "deviceUuid",required = false) String deviceUuid, @RequestParam("commandStr") String commandStr,@RequestParam(value = "tenantId") Integer tenantId, @RequestParam(value = "userId") Long userId, @RequestParam(value = "userName") String userName);
}
