package com.boman.web.core.controller;

import com.boman.domain.dto.AjaxResult;
import com.boman.web.core.service.leave.LeaveService;
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;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description 销假
 * @author shiqian
 * @date 2021年07月26日 13:46
 **/
@RestController
@RequestMapping("cancel/leave")
public class CancelLeaveController {

    @Resource
    private LeaveService leaveService;

    /**
     * 功能描述: 销假 (自己销自己的)
     *
     * @param idList idList
     * @return com.boman.domain.dto.AjaxResult
     */
    @PostMapping
    public AjaxResult cancelLeave(@RequestBody List<Long> idList) {
        boolean leave = leaveService.cancelLeave(idList);
        return leave ? AjaxResult.success() : AjaxResult.error();
    }


}
