package com.usky.oa.controller.web;


import com.usky.common.log.annotation.Log;
import com.usky.common.log.enums.BusinessType;
import com.usky.oa.domain.OaJbdDocument;
import com.usky.oa.service.OaJbdDocumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 加班单据表 前端控制器
 * </p>
 *
 * @author fu
 * @since 2025-01-02
 */
@RestController
@RequestMapping("/oaJbDocument")
public class OaJbdDocumentController {

    @Autowired
    private OaJbdDocumentService oaJbdDocumentService;

    @Log(title = "新增加班单", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public void addJbDocument(@RequestBody OaJbdDocument oaJbdDocument) {
        oaJbdDocumentService.add(oaJbdDocument);
    }

    @Log(title = "更新加班单", businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    public void updateJbDocument(OaJbdDocument oaJbdDocument) {
        oaJbdDocumentService.update(oaJbdDocument);
    }

    @Log(title = "删除加班单", businessType = BusinessType.DELETE)
    @DeleteMapping("/del/{docNo}")
    public void delJbDocument(@PathVariable String docNo) {
        oaJbdDocumentService.delByDocNo(docNo);
    }

}
