package com.ym.mec.teacher.controller;

import com.ym.mec.biz.service.OrganizationService;
import com.ym.mec.biz.service.SysEmployeePositionService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.tenant.TenantContextHolder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("employeePosition")
@Api(tags = "员工职位管理")
@RestController
public class SysEmployeePositionController extends BaseController {

    @Autowired
    private SysEmployeePositionService employeePositionService;
    @Autowired
    private OrganizationService organizationService;

    @ApiOperation(value = "获取分部下员工职位列表")
    @GetMapping("/findOrganPosition")
    public Object findAll(){
        Integer tenantId = TenantContextHolder.getTenantId();
        return succeed(employeePositionService.findOrganPosition(organizationService.getTeacherOrgan(), tenantId));
    }
}
