mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 09:26:48 +08:00
分割关键字返回
This commit is contained in:
@@ -2,6 +2,8 @@ package com.xboe.module.course.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课程的全文检索索引
|
||||
*
|
||||
@@ -117,5 +119,10 @@ public class CourseFullText {
|
||||
* 是否公开0表非公开报名,1表公开报名-字段需新增,按管理端需求增加
|
||||
*/
|
||||
private Integer openEnroll;
|
||||
|
||||
|
||||
/**
|
||||
* keywords字段分割
|
||||
*/
|
||||
private List<String> keywordsList;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xboe.module.course.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -263,7 +264,19 @@ public class CourseFullTextApi extends ApiBaseController{
|
||||
c.setTeacher(ct.getTeacherName());
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(c.getKeywords()) ){
|
||||
String[] keywords = c.getKeywords().split(",");
|
||||
if (keywords.length == 0){
|
||||
keywords = c.getKeywords().split(" ");
|
||||
}
|
||||
if (keywords.length > 0){
|
||||
List<String> keywordsList = Arrays.asList(keywords);
|
||||
c.setKeywordsList(keywordsList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
}catch(Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user