package com.ruoyi.zhushi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.zhushi.entity.NjBalanceManageDetailDTO;
import com.ruoyi.zhushi.service.NjBalanceManageDetailService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
 * 打卡控制台
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/nj/balance/manage/detail")
@Slf4j
public class NjBalanceManageDetailController extends BaseController {

    @Autowired
    private NjBalanceManageDetailService njBalanceManageDetailService;

    // 查询年假申请信息
    @GetMapping("/query")
    public TableDataInfo<NjBalanceManageDetailDTO> query(NjBalanceManageDetailDTO njBalanceManageDetailDTO, PageQuery pageQuery) {
        return njBalanceManageDetailService.queryPageList(njBalanceManageDetailDTO, pageQuery);
    }


    // 年假申请
    @PostMapping("/apply")
    public R<Void> insert(@Validated(AddGroup.class) @RequestBody NjBalanceManageDetailDTO njBalanceManageDetailDTO) {
        return toAjax(njBalanceManageDetailService.insert(njBalanceManageDetailDTO));
    }


}
