1、讲师接口概览
2、使用Swagger测试接口
3、控制层:TeacherController
package cn.org.xcore.edusys.controller.teacher;
import cn.org.xcore.edusys.db.ext.model.Teacher;
import cn.org.xcore.edusys.db.ext.model.Position;
import cn.org.xcore.edusys.common.bean.ApiResponse;
import cn.org.xcore.edusys.common.EmailRunnable;
import cn.org.xcore.edusys.common.poi.PoiUtils;
import cn.org.xcore.edusys.service.TeacherService;
import cn.org.xcore.edusys.service.impl.DepartmentService;
import cn.org.xcore.edusys.service.impl.JobLevelService;
import cn.org.xcore.edusys.service.impl.PositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.TemplateEngine;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
/**
* @author 李海林 手机:13802780104|微信:lihailin9073|Email:767679879@qq.com
* @copyright 个人开发者李海林版权所有,产品详情及技术服务请登录官网查询[http://www.x-core.org.cn]
* @create 2019-08-20 18:42
*/
@Api(tags = "03-讲师模块")
@RestController
@RequestMapping("/teacher")
public class TeacherController {
@Autowired
private TeacherService teacherService;
@Autowired
private DepartmentService departmentService;
@Autowired
private PositionService positionService;
@Autowired
private JobLevelService jobLevelService;
@Autowired
private ExecutorService executorService;
@Autowired
private TemplateEngine templateEngine;
@Autowired
private JavaMailSender javaMailSender;
@ApiOperation("获取民族列表")
@GetMapping("/get_nation_list")
public Map<String, Object> getNationList() {
Map<String, Object> map = new HashMap<>();
map.put("nations", teacherService.getAllNationList());
map.put("politics", teacherService.getAllPolitics());
map.put("deps", departmentService.getDepByPid(-1L));
map.put("positions", positionService.getAllPos());
map.put("joblevels", jobLevelService.getAllJobLevels());
map.put("workID", String.format("%08d", teacherService.getMaxWorkID() + 1));
return map;
}
@ApiOperation("获取讲师工号ID")
@GetMapping("/get_max_work_