package com.malk.lemeng.controller;

/**
 * 错误抛出与拦截详见 CatchException
 */

import com.malk.lemeng.service.LMService;
import com.malk.server.common.McR;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping
public class LMController {

    @Autowired
    private LMService lmService;

    /**
     * 同步花名册信息
     */
    @PostMapping("sync")
    McR syncRoster() {

        lmService.syncRoster();
        return McR.success();
    }

    /**
     * 同步部门信息
     */
    @PostMapping("dept")
    McR syncDepartment() {

        lmService.syncDepartment();
        return McR.success();
    }

    /**
     * 部门预算统计
     */
    @PostMapping("calc")
    McR calcBudget() {

        lmService.calcBudget();
        return McR.success();
    }
    
    /**
     * test
     */
    @PostMapping("test")
    McR test() {

        return McR.success();
    }
}
