|
@@ -1,7 +1,9 @@
|
|
|
package com.futu.course.es.controller;
|
|
|
|
|
|
import com.futu.course.es.Service.impl.ESCourseService;
|
|
|
+import com.futu.course.es.dto.CourseDto;
|
|
|
import com.futu.course.es.domain.ESCourse;
|
|
|
+import com.futu.course.es.dto.SearchDto;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -20,20 +22,23 @@ public class ESCourseController {
|
|
|
@Autowired
|
|
|
ESCourseService esCourseService;
|
|
|
@PostMapping("/search")
|
|
|
- public ArrayList<String> search(@RequestParam("name") String name) throws IOException {
|
|
|
- return esCourseService.search(name);
|
|
|
+ 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(@RequestParam("categoryId") int categoryId) throws IOException {
|
|
|
- return esCourseService.CourseList(categoryId);
|
|
|
+ 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(@RequestParam("name") String name) throws IOException {
|
|
|
- return esCourseService.SelCourse(name);
|
|
|
+ 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 {
|