package com.sptg.estate.api.feigns;


import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.entity.MemberDevice;
import com.sptg.estate.api.feigns.fallback.MemberDeviceFeignFallbackFactory;
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;


@FeignClient(value = "smart-house-estate",fallbackFactory = MemberDeviceFeignFallbackFactory.class)
public interface MemberDeviceFeign {

    /**
     * 分页遍历
     * @param memberDevice 查询条件
     * @return ResultBean<Page<MemberDevice>>
     */
    @PostMapping(value = "/memberDevice/pagingQuery")
    ResultBean<Page<MemberDevice>> pagingQuery(@RequestBody MemberDevice memberDevice);

    /**
     * 禁用或启用
     * @param memberDevice
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/memberDevice/enable")
    ResultBean<Boolean> enable(@RequestBody MemberDevice memberDevice);

    /**
     * 添加
     * @param memberDevice
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/memberDevice/add")
    ResultBean<Boolean> add(@RequestBody MemberDevice memberDevice);

    /**
     * 根据app会员id获取记录
     * @param memberDevice 查询条件
     * @return List<MemberDevice>
     */
    @PostMapping(value = "/memberDevice/getListByMemberId")
    List<MemberDevice> getListByMemberId(@RequestBody MemberDevice memberDevice);

    /**
     * 批量添加
     * @param memberDeviceList
     * @return
     */
    @PostMapping(value = "/memberDevice/addBatch")
    ResultBean<Boolean> addBatch(@RequestBody List<MemberDevice> memberDeviceList);

    /**
     * 批量删除
     * @param memberDeviceList
     * @return
     */
    @PostMapping(value = "/memberDevice/deleteBatch")
    ResultBean<Boolean> deleteBatch(@RequestBody List<Long> ids);
}
