package com.sptg.estate.biz.controller;


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.MemberDeviceFeign;
import com.sptg.estate.biz.service.MemberDeviceServiceInterface;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class MemberDeviceController implements MemberDeviceFeign {
    private final MemberDeviceServiceInterface memberDeviceServiceInterface;

    @Override
    @PostMapping(value = "/memberDevice/pagingQuery")
    public ResultBean<Page<MemberDevice>> pagingQuery(@RequestBody MemberDevice memberDevice) {
        return this.memberDeviceServiceInterface.pagingQuery(memberDevice);
    }

    @Override
    @PostMapping(value = "/memberDevice/enable")
    public ResultBean<Boolean> enable(@RequestBody MemberDevice memberDevice) {
        return this.memberDeviceServiceInterface.enable(memberDevice);
    }

    @Override
    @PostMapping(value = "/memberDevice/add")
    public ResultBean<Boolean> add(@RequestBody MemberDevice memberDevice) {
        return this.memberDeviceServiceInterface.add(memberDevice);
    }

    @Override
    @PostMapping(value = "/memberDevice/getListByMemberId")
    public List<MemberDevice> getListByMemberId(@RequestBody MemberDevice memberDevice) {
        return this.memberDeviceServiceInterface.getListByMemberId(memberDevice);
    }

    @Override
    @PostMapping(value = "/memberDevice/addBatch")
    public ResultBean<Boolean> addBatch(@RequestBody List<MemberDevice> memberDeviceList) {
        return this.memberDeviceServiceInterface.addBatch(memberDeviceList);
    }

    @Override
    @PostMapping(value = "/memberDevice/deleteBatch")
    public ResultBean<Boolean> deleteBatch(@RequestBody List<Long> ids) {
        return this.memberDeviceServiceInterface.deleteBatch(ids);
    }
}
