package com.yida.data.school.facility.controller;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.school.EduDormitory;
import com.yida.data.school.facility.service.EduDormitoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 宿舍楼 Controller(不鉴权)
 *
 * @author wjm
 * @date 2021-09-14 17:42:11
 */
@Api(tags = "宿舍-宿舍楼")
@Slf4j
@Validated
@RestController
@RequestMapping("/in/facility/dorm")
@RequiredArgsConstructor
public class InEduDormitoryController {

    private final EduDormitoryService eduDormitoryService;

    @ApiOperation("获取宿舍楼")
    @GetMapping("/getDorm")
    ResultBean<EduDormitory> getDorm(@RequestParam("id") Long id) {
        return ResultBean.buildSuccess(eduDormitoryService.getDorm(id));
    }
}
