package com.atguigu.eduservice.controller;import com.atguigu.eduservice.entity.EduTeacher;import com.atguigu.eduservice.service.EduTeacherService;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;import java.util.List;/** *
* * @author testjava * @since 2022-06-23 */@RestController@RequestMapping(“/eduservice/teacher”)public class EduTeacherController { //把service注入 @Autowired private EduTeacherService teacherService;// 1 查询讲师表所有数据 //rest风格 @GetMapping(“findAll”) public List findAllTeacher(){ //调用service方法实现查询所有的讲师 List list = teacherService.list(null); return list; }}