package com.sptg.device.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.entity.PublishTask;
import com.sptg.device.api.entity.InstructPublishLog;
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.Map;

/**
 */
@FeignClient(value = "smart-house-device")
public interface MsgPublishFeign {

    /**
     * 任务推送
     * @param task 任务详情
     */
    @PostMapping(value = "/device/msg/publishTask")
    void publishTask(@RequestBody PublishTask task, @RequestParam Map<String,String> map);

    /**
     * 指令重发
     * @param instructPublishLog 需要重发的指令
     */
    @PostMapping(value = "/device/instruct/resend")
    ResultBean<Boolean> resendInstruct(@RequestBody InstructPublishLog instructPublishLog);

}
