Commit dc801efc by 段启岩

去掉博客封面图片的限制

parent d9ae6b6c
......@@ -23,6 +23,7 @@ import cn.meteor.beyondclouds.util.AccessInfoUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
......@@ -55,6 +56,10 @@ public class BlogApi {
return Response.fieldError(result.getFieldError());
}
if (null != blogForm.getCover() && StringUtils.isBlank(blogForm.getCover())) {
blogForm.setCover(null);
}
Blog blog = new Blog();
BeanUtils.copyProperties(blogForm, blog);
blog.setUserId((String) subject.getId());
......@@ -155,6 +160,10 @@ public class BlogApi {
return Response.fieldError(result.getFieldError());
}
if (null != blogForm.getCover() && StringUtils.isBlank(blogForm.getCover())) {
blogForm.setCover(null);
}
Blog blog = new Blog();
BeanUtils.copyProperties(blogForm, blog);
blog.setUserId((String) subject.getId());
......
......@@ -62,6 +62,6 @@ public class BlogForm {
// @NotNull(message = "封面图不能为空", groups = InsertGroup.class)
// @NotEmpty(message = "封面图不能为空", groups = InsertGroup.class)
@NullOrNotBlank(message = "请传入有效的封面图链接", groups = UpdateGroup.class)
// @NullOrNotBlank(message = "请传入有效的封面图链接", groups = UpdateGroup.class)
private String cover;
}
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