package com.sptg.device.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.dto.TimeStrategyDto;
import com.sptg.device.api.entity.TimeStrategy;
import com.sptg.device.api.feigns.fallback.TimeStrategyFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * title: TimeStrategyFeign
 * package: com.sptg.device.api.feigns
 * description:时间策略-对外服务接口
 */
@FeignClient(value = "smart-house-device",fallbackFactory = TimeStrategyFeignFallbackFactory.class)
public interface TimeStrategyFeign {
    /**
     * 功能描述:分页查询时间策略记录
     * @param dto
     * @return ResultBean<Page<TimeStrategy>>
     */
    @PostMapping(value = "/time/strategy/pagingQuery")
    ResultBean<Page<TimeStrategy>> pagingQuery(@RequestBody TimeStrategyDto dto);

    @GetMapping(value = "/time/strategy/selectById")
    TimeStrategy selectById(@RequestBody Long id);

    /**
     * 功能描述:新增时间策略
     * @param entity 时间策略信息
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/time/strategy/addEntity")
    ResultBean<Boolean> addEntity(@RequestBody TimeStrategyDto entity);
    /**
     * 功能描述:根据id获取时间策略
     * @param dto
     * @return  ResultBean<TimeStrategy>
     */
    @PostMapping(value = "/time/strategy/getEntityById")
    public  ResultBean<TimeStrategy> getEntityById(@RequestBody TimeStrategyDto dto);
    /**
     * 功能描述:修改时间策略
     * @param dto 时间策略信息
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/time/strategy/editEntity")
    ResultBean<Boolean> editEntity(@RequestBody TimeStrategyDto dto);
    /**
     * 功能描述:删除时间策略
     * @param dto
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/time/strategy/deleteEntity")
    ResultBean<Boolean> deleteEntity(@RequestBody TimeStrategyDto dto);

    /**
     * 功能描述:查询时间策略列表
     * @param dto
     * @return List<TimeStrategy>
     */
    @PostMapping(value = "/time/strategy/getEntityList")
    List<TimeStrategy> getEntityList(@RequestBody TimeStrategyDto dto);
}
