package com.sptg.estate.biz.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.GuestAuthorizeDto;
import com.sptg.estate.api.entity.GuestAuthorize;
import com.sptg.estate.api.feigns.GuestAuthorizeFeign;
import com.sptg.estate.biz.service.GuestAuthorizeServiceInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * title: GuestAuthorizeController
 * package: com.sptg.estate.biz.controller
 * description: 访客授权记录 控制器
 *
 *
 *
 */
@RestController
public class GuestAuthorizeController implements GuestAuthorizeFeign {

    private final GuestAuthorizeServiceInterface guestAuthorizeInterface;

    @Autowired
    public GuestAuthorizeController(GuestAuthorizeServiceInterface guestAuthorizeInterface) {
        this.guestAuthorizeInterface = guestAuthorizeInterface;
    }

    @Override
    @PostMapping(value = "/guestAuthorize/showGuestAuthorizeList")
    public Page<GuestAuthorize> showGuestAuthorizeList(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.showGuestAuthorizeList(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/showEffectiveGuestAuthorizeList")
    public Page<GuestAuthorize> showEffectiveGuestAuthorizeList(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.showEffectiveGuestAuthorizeList(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/addGuestAuthorize")
    public ResultBean<GuestAuthorize> addGuestAuthorize(@RequestBody GuestAuthorize guestAuthorize) {
        return this.guestAuthorizeInterface.addGuestAuthorize(guestAuthorize);
    }

    @Override
    @GetMapping(value = "/guestAuthorize/findGuestAuthorizeById/{id}")
    public GuestAuthorize findGuestAuthorizeById(@PathVariable(value = "id") Long id) {
        return this.guestAuthorizeInterface.findGuestAuthorizeById(id);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/updateGuestAuthorize")
    public ResultBean<Boolean> updateGuestAuthorize(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.updateGuestAuthorize(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/deleteGuestAuthorize")
    public ResultBean<Boolean> deleteGuestAuthorize(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.deleteGuestAuthorize(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/updateGuestAuthorizeEnableType")
    public ResultBean<Boolean> updateGuestAuthorizeEnableType(@RequestBody GuestAuthorize guestAuthorize) {
        return this.guestAuthorizeInterface.updateGuestAuthorizeEnableType(guestAuthorize);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/getGuestCount")
    public long getGuestCount(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.getGuestCount(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/guestAuthorizeCountListForGroupType")
    public List<Map<String, Object>> guestAuthorizeCountListForGroupType(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.guestAuthorizeCountListForGroupType(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/getListByUserId")
    public ResultBean<GuestAuthorize> getListByUserId(@RequestBody List<Long> userIds) {
        return this.guestAuthorizeInterface.getListByUserId(userIds);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/getGuestAuthorizeCountByDay")
    public Integer getGuestAuthorizeCountByDay(@RequestBody GuestAuthorizeDto guestAuthorizeDto) {
        return this.guestAuthorizeInterface.getGuestAuthorizeCountByDay(guestAuthorizeDto);
    }

    @Override
    @PostMapping(value = "/guestAuthorize/getGuestAuthorizeByCondition")
    public GuestAuthorize getGuestAuthorizeByCondition(@RequestBody GuestAuthorize guestAuthorize){
        return this.guestAuthorizeInterface.getGuestAuthorizeByCondition(guestAuthorize);
    }
}
