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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @author shiqian
 * @date 2021年06月03日 15:41
 **/
@RequestMapping("/leave")
@RestController
public class LeaveController {

    @Resource
    private LeaveService service;

    /**
     * 功能描述: 本月请假人数、本年请假人数
     *
     * @return com.boman.domain.dto.AjaxResult
     */
    @GetMapping("/statistic/count/{yyyy}")
    public AjaxResult statisticCount(@PathVariable String yyyy) {
        Map<String, Integer> result = service.statisticByType(yyyy);
        return AjaxResult.success(result);
    }
}
