1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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<String> 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<ESCourse> CourseList(@RequestBody CourseDto courseDto) throws IOException {
- System.out.println("categoryId:"+courseDto.getCategoryId());
- return esCourseService.CourseList(courseDto.getCategoryId());
- }
- @PostMapping("/SelCourse")
- public HashSet<ESCourse> 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<MongoDBCourse> searchLogs(){
- return esCourseService.searchLogs();
- }
- }
|