package com.yida.data.school.leave.controller.in;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.dto.leave.ListStudentRequestDetailDTO;
import com.yida.data.school.leave.service.EduLeaveRequestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "请假管理-内部调用-不鉴权")
@RequiredArgsConstructor
@RestController
@RequestMapping("/in/request/leaveRequest")
public class InEduLeaveRequestController {

    private final EduLeaveRequestService eduLeaveRequestService;

    @ApiOperation("查询学生该时段是否有请假条")
    @PostMapping("/existRequest")
    public ResultBean<Boolean> existRequest(@RequestBody ListStudentRequestDetailDTO dto) {
        return ResultBean.buildSuccess(eduLeaveRequestService.existRequest(dto));
    }

}
