Commit 178b7146 authored by liuyang's avatar liuyang

课程添加用户标签

parent 7711dc6c
......@@ -29,6 +29,7 @@ import com.qkdata.common.base.exception.BusinessException;
import com.qkdata.common.base.model.PageResult;
import com.qkdata.common.oauth.AuthorizedUser;
import com.qkdata.common.util.UserContext;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -448,14 +449,10 @@ public class CourseService extends ServiceImpl<CourseMapper, CoursePO> {
po.setSeriesId(model.getSeriesId());
po.setAllow(model.getAllow());
if (po.getAllow() == CourseAllowEnum.USER_TAG){
if (CollUtil.isEmpty(model.getUserTagIds())){
if (Strings.isBlank(model.getUserTagIds())){
throw new BusinessException("请选择用户标签");
}
List<String> ids = Lists.newArrayList();
for (Long userTagId : model.getUserTagIds()){
ids.add(String.valueOf(userTagId));
}
po.setUserTagIds(String.join(",",ids));
po.setUserTagIds(model.getUserTagIds());
}else {
po.setUserTagIds("");
}
......
......@@ -88,5 +88,5 @@ public class SaveCourseModel {
/**
* 指定的用户标签
*/
private List<Long> userTagIds;
private String userTagIds;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment