package com.ym.mec.web.controller.education;

import com.ym.mec.biz.service.CooperationOrganService;
import com.ym.mec.biz.service.OrganizationService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RequestMapping("eduOrganization")
@Api(tags = "分部服务")
@RestController
public class EduOrganizationController extends BaseController {

    @Autowired
    private OrganizationService organizationService;
    @Autowired
    private CooperationOrganService cooperationOrganService;

    @ApiOperation(value = "获取员工所在分部列表")
    @GetMapping("/queryEmployeeOrgan")
    public Object queryEmployeeOrgan() throws Exception {
        return succeed(organizationService.queryEmployeeOrgan());
    }

    @ApiOperation(value = "根据分部id获取合作单位(学校)列表")
    @GetMapping("/queryByOrganId")
    public Object queryByOrganId(String organId) {
        return succeed(cooperationOrganService.queryByOrganId(organId));
    }
}
