package com.dk.mdm.controller.mst;

import com.dk.common.response.ResponseResultVO;
import com.dk.common.model.pojo.mst.StaffRight;
import com.dk.common.service.BaseService;
import com.dk.common.model.vo.mst.StaffVO;
import com.dk.mdm.service.mst.StaffService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.mst.StaffRightService;

import java.util.Map;

/**
 * @desc   : 员工权限API接口
 * @author : 姜永辉
 * @date   : 2023/1/4 9:25
 */
@Api(tags = "员工权限API接口")
@RestController
@RequestMapping("/mst/staff_right")
public class StaffRightController{

    public BaseService<StaffRight> getService() {
        return staffRightService;
    }

    @Autowired
    private StaffRightService staffRightService;

    @Autowired
    private StaffService staffService;

    /**
     * @desc : 获取员工权限
     * @author : 姜永辉
     * @date : 2024/2/26 10:36
     */
    @ApiOperation(
            value = "获取员工权限",
            notes = "获取员工权限"
    )
    @PostMapping("get_staff_right")
    public ResponseResultVO<Map<String, Object>> getStaffRight(@RequestBody Map<String, Object> param) {
        return staffRightService.getStaffRight(param);
    }

    /**
     * @desc : 新建员工--权限
     * @author : 姜永辉
     * @date : 2023/1/9 10:48
     */
    @ApiOperation(value = "新建员工--权限", notes = "新建员工--权限")
    @PostMapping({"save_staff_right"})
    public ResponseResultVO<?> saveStaffRight(@RequestBody StaffVO staffVO) {
        return staffService.saveStaffRight(staffVO);
    }

    /**
     * @desc   : WEB获取员工权限
     * @author : 常皓宁
     * @date   : 2024/3/6 13:15
     */
    @ApiOperation(
            value = "WEB获取员工权限",
            notes = "WEB获取员工权限"
    )
    @PostMapping("get_staff_right_web")
    public ResponseResultVO<Map<String, Object>> getStaffRightWeb(@RequestBody Map<String, Object> param) {
        return staffRightService.getStaffRightWeb(param);
    }


}
