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 查詢講師表所有數(shù)據(jù) //rest風(fēng)格 @GetMapping(“findAll”) public List findAllTeacher(){ //調(diào)用service方法實現(xiàn)查詢所有的講師 List list = teacherService.list(null); return list; }}