package com.futu.course.es.controller; import com.futu.course.es.Service.impl.ESCourseService; import com.futu.course.es.domain.ESCourse; import com.futu.course.es.domain.MongoDBCourse; 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; import java.util.List; /** * @author "杨旭朋" * @ClassName: ESCourseController * @date 2025年05月06日 15:54 */ @RestController @RequestMapping("/EsCourse") public class ESCourseController { @Autowired ESCourseService esCourseService; @PostMapping("/search") public ArrayList search(@RequestParam("name") String name) throws IOException { return esCourseService.search(name); } @GetMapping("/MysqlInterES") public void MysqlInterES() throws IOException { esCourseService.MysqlInterES(); } @PostMapping("/CourseList") public HashSet CourseList(@RequestParam("categoryId") int categoryId) throws IOException { return esCourseService.CourseList(categoryId); } @PostMapping("/SelCourse") public HashSet SelCourse(@RequestParam("name") String name) throws IOException { return esCourseService.SelCourse(name); } @GetMapping("checkAndCreateIndex") public boolean checkAndCreateIndex() throws IOException { return esCourseService.checkAndCreateIndex(); } @GetMapping("/searchLogs") public List searchLogs(){ return esCourseService.searchLogs(); } }