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.dto.FlowCardDto;
import com.sptg.device.api.entity.FlowCard;
import com.sptg.device.api.feigns.fallback.FlowCardFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * title: DeviceFeign
 * package: com.sptg.device.api.feigns
 * description: 设备对外服务接口
 *
 *                  
 *                 
 */
@FeignClient(value = "smart-house-device",fallbackFactory = FlowCardFeignFallbackFactory.class)
public interface FlowCardFeign {
    /**
     * 功能描述: 分页查询流量卡信息
     * @param pageBean 流量卡数据传输对象
     * @return ResultBean<Page>
     *
     *
     */
    @PostMapping(value = "/flowCard/pagingQuery")
    ResultBean<Page<FlowCard>> pagingQuery(@RequestBody PageBean<FlowCard, FlowCardDto> pageBean);

    /**
     * 功能描述:添加卡信息
     * @param dto
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/flowCard/add")
    ResultBean<Boolean> add(@RequestBody FlowCardDto dto);

    /**
     * 功能描述:修改卡信息
     * @param dto
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/flowCard/edit")
    ResultBean<Boolean> edit(@RequestBody FlowCardDto dto);

    /**
     * 功能描述:获取流量卡
     * @param dto
     * @return com.sptg.device.api.entity.DevicePath
     *
     *
     */
    @PostMapping(value = "/flowCard/getById")
    FlowCard getById(@RequestBody FlowCardDto dto);

    /**
     * 功能描述: 根据Id获取流量卡
     * @param id
     * @return DevicePath
     *
     *
     */
    @GetMapping(value = "/flowCard/getById/{id}")
    FlowCard getById(@PathVariable(value = "id")Long id);

    /**
     * 功能描述: 删除流量卡
     * @param dto
     * @return
     */
    @PostMapping(value = "/flowCard/delete")
    ResultBean<Boolean> delete(@RequestBody  FlowCardDto dto);

    /**
     * 功能描述:流量卡绑定设备
     * @param dto
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/flowCard/bind")
    ResultBean<Boolean> bind(@RequestBody FlowCardDto dto);

    /**
     * 功能描述:流量卡取消绑定设备
     * @param dto
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/flowCard/reBind")
    ResultBean<Boolean> reBind(@RequestBody FlowCardDto dto);

    /**
     * 功能描述:流量卡更换绑定设备
     * @param dto
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/flowCard/updateBind")
    ResultBean<Boolean> updateBind(@RequestBody FlowCardDto dto);

    /**
     * 获取一个流量卡-用于验证
     * @param dto
     * @return
     */
    @PostMapping(value = "/flowCard/getOneFlowCard")
    FlowCard getOneFlowCard(@RequestBody FlowCardDto dto);

    @GetMapping(value = "/flowCard/getByOldId/{oldId}")
    FlowCard getByOldId(@PathVariable(value = "oldId") String oldId);


}
