12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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<String> search(@RequestParam("name") String name) throws IOException {
- return esCourseService.search(name);
- }
- @GetMapping("/MysqlInterES")
- public void MysqlInterES() throws IOException {
- esCourseService.MysqlInterES();
- }
- @PostMapping("/CourseList")
- public HashSet<ESCourse> CourseList(@RequestParam("categoryId") int categoryId) throws IOException {
- return esCourseService.CourseList(categoryId);
- }
- @PostMapping("/SelCourse")
- public HashSet<ESCourse> 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<MongoDBCourse> searchLogs(){
- return esCourseService.searchLogs();
- }
- }
|