package org.springblade.app.controller;

import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.estate.entity.ParkingSpace;
import org.springblade.estate.feign.IParkingSpaceClient;
import org.springblade.estate.vo.ParkingSpaceVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequiredArgsConstructor
@Api(value = "", tags = "接口")
@RequestMapping(value = "/app/parkingSpace")
@Slf4j
public class ParkingSpaceController {

	private final IParkingSpaceClient parkingSpaceClient;

	@GetMapping("list")
	public R list(ParkingSpace parkingSpace){
		List<ParkingSpaceVO> list = parkingSpaceClient.list(parkingSpace);
		return R.data(list);
	}

	@GetMapping("count")
	public R count(ParkingSpace parkingSpace){
		Integer count = parkingSpaceClient.count(parkingSpace);
		return R.data(count);
	}

}
