package com.sptg.device.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.PageBean;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.entity.InstructPublishLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

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

    /**
     * 指令消费回调接口
     * @param publishLog log
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/instruct/callback")
    ResultBean<Boolean> instructCallback(@RequestBody InstructPublishLog publishLog);

    /**
     * 设备业务阶段性状态回调接口
     * @param publishLog log
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/instruct/biz/callback")
    ResultBean<Boolean> instructBizCallback(@RequestBody InstructPublishLog publishLog);

    /**
     * 设备处理状态回调接口
     * @param publishLog log
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/instruct/handle/callback")
    ResultBean<Boolean> instructHandleCallback(@RequestBody InstructPublishLog publishLog);

    /**
     * 大豪指令回调接口
     * @param publishLog log
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "dh/instruct/callback")
    ResultBean<Boolean> dhInstructCallback(@RequestBody InstructPublishLog publishLog);

    /**
     * 分页查询指令推送记录
     * @param pageBean 分页信息
     * @return ResultBean<Page>
     */
    @PostMapping(value = "/instruct/pagingQuery")
    ResultBean<Page> pagingQuery(@RequestBody PageBean<InstructPublishLog,InstructPublishLog> pageBean);

    @PostMapping(value = "/instruct/pageFace")
    public ResultBean<Page> pageFace(@RequestBody PageBean<InstructPublishLog, InstructPublishLog> pageBean);

    @PostMapping(value = "/instruct/pageCard")
    public ResultBean<Page> pageCard( @RequestBody PageBean<InstructPublishLog, InstructPublishLog> pageBean);

    @PostMapping(value = "/instruct/pageAppPackage")
    public ResultBean<Page> pageAppPackage( @RequestBody PageBean<InstructPublishLog, InstructPublishLog> pageBean);

    /**
     * 指令获取接口
     * @param id 指令id
     * @return ResultBean<Boolean>
     */
    @GetMapping(value = "/instruct/get/{id}")
    InstructPublishLog getById(@PathVariable(value = "id") Long id);

    @PostMapping(value = "/instruct/getListPutBin")
    List<InstructPublishLog> getListPutBin(@RequestBody InstructPublishLog instructPublishLog);

    @PostMapping(value = "/instruct/deletePutBinList")
    ResultBean<Boolean> deletePutBinList(List<InstructPublishLog> logList);

    @PostMapping(value = "/instruct/findInstructPublishLogByCondition")
    List<InstructPublishLog> findInstructPublishLogByCondition(@RequestBody InstructPublishLog instructPublishLog);

    @PostMapping(value = "/instruct/create")
    ResultBean<Boolean> create(@RequestBody InstructPublishLog instructPublishLog);
//    /**
//     * 指令重发
//     * @param instructPublishLog 需要重发的指令
//     */
//    @PostMapping(value = "/instruct/resend")
//    ResultBean<Boolean> resendInstrcut(@RequestBody InstructPublishLog instructPublishLog);
//
//    /**
//     * 大豪指令重发
//     * @param instructPublishLog 需要重发的指令
//     */
//    @PostMapping(value = "/instruct/dh/resend")
//    ResultBean<Boolean> resendInstrcutDH(@RequestBody InstructPublishLog instructPublishLog);
}
