package com.futu.course.es.controller; import com.futu.course.es.Service.impl.ESCourseService; import com.futu.course.es.domain.ESCourse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; /** * @author "杨旭朋" * @ClassName: ESCourseController * @date 2025年05月06日 15:54 */ @RestController @RequestMapping("/EsCourse") public class ESCourseController { @Autowired ESCourseService esCourseService; @PostMapping("/search") public ArrayList search(@RequestBody SearchDto dto) throws IOException { System.out.println(dto.getName()); return esCourseService.search(dto.getName()); } @GetMapping("/MysqlInterES") public void MysqlInterES() throws IOException { esCourseService.MysqlInterES(); } @PostMapping("/CourseList") public HashSet CourseList(@RequestBody CourseDto courseDto) throws IOException { System.out.println("categoryId:"+courseDto.getCategoryId()); return esCourseService.CourseList(courseDto.getCategoryId()); } @PostMapping("/SelCourse") public HashSet SelCourse(@RequestBody SearchDto dto) throws IOException { System.out.println(dto.getName()); return esCourseService.SelCourse(dto.getName()); } @GetMapping("checkAndCreateIndex") public boolean checkAndCreateIndex() throws IOException { return esCourseService.checkAndCreateIndex(); } @GetMapping("/searchLogs") public List searchLogs(){ return esCourseService.searchLogs(); } }