mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
查询标签修改
This commit is contained in:
@@ -158,7 +158,7 @@ public class CourseManageApi extends ApiBaseController{
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||
List<CourseCrowd> crowds=courseService.findCrowdByCourseId(id);
|
||||
if (StringUtils.isNotBlank(course.getTags())){
|
||||
if (StringUtils.isNotBlank(course.getTags()) && course.getTags().matches("[0-9,]+")){
|
||||
List<CourseTag> tagList = tagService.getTagsByIds(course.getTags());
|
||||
rs.put("tagList", tagList);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @ClassName:CourseTagApi
|
||||
@@ -167,6 +168,9 @@ public class CourseTagApi extends ApiBaseController {
|
||||
*/
|
||||
@RequestMapping(value="/createTag",method= RequestMethod.POST)
|
||||
public JsonResponse<CourseTag> createTag(CourseTagRelationDto courseTagRelationDto){
|
||||
if (StringUtils.isNotBlank(courseTagRelationDto.getTagName()) && !Pattern.matches("^[\\u4e00-\\u9fa5a-zA-Z0-9_-]+$", courseTagRelationDto.getTagName())) {
|
||||
return error("标签名称只能包含中文、英文、数字、下划线和中横线");
|
||||
}
|
||||
if (courseTagRelationDto!=null){
|
||||
CourseTag courseTag = courseTagService.createTag(courseTagRelationDto);
|
||||
return success(courseTag);
|
||||
|
||||
Reference in New Issue
Block a user