package com.ym.mec.web.controller;

import com.ym.mec.auth.api.client.SysUserFeignService;
import com.ym.mec.biz.service.TeacherService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
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("teacher")
@Api(tags = "教师服务")
@RestController
public class TeacherController extends BaseController {

    @Autowired
    private TeacherService teacherService;
    @Autowired
    private SysUserFeignService sysUserFeignService;

    @ApiOperation(value = "获取分部所有老师")
    @GetMapping("/findTeachers")
    public HttpResponseResult findTeachers() {
        Integer organId = sysUserFeignService.queryUserInfo().getOrganId();
        return succeed(teacherService.findTeachers(organId));
    }

}
