|
|
|
@ -2,6 +2,7 @@ package ru.ulstu.paper.model;
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.hibernate.validator.constraints.NotEmpty;
|
|
|
|
|
import ru.ulstu.deadline.model.DeadlineDto;
|
|
|
|
|
import ru.ulstu.user.model.UserDto;
|
|
|
|
@ -16,9 +17,11 @@ import java.util.stream.Collectors;
|
|
|
|
|
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
|
|
|
|
|
|
|
|
|
public class PaperDto {
|
|
|
|
|
private final static int MAX_AUTHORS_LENGTH = 60;
|
|
|
|
|
|
|
|
|
|
private Integer id;
|
|
|
|
|
@NotEmpty
|
|
|
|
|
@Size(min = 3, max = 100)
|
|
|
|
|
@Size(min = 3, max = 254)
|
|
|
|
|
private String title;
|
|
|
|
|
private Paper.PaperStatus status;
|
|
|
|
|
private Date createDate;
|
|
|
|
@ -196,10 +199,10 @@ public class PaperDto {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getAuthorsString() {
|
|
|
|
|
return authors
|
|
|
|
|
return StringUtils.abbreviate(authors
|
|
|
|
|
.stream()
|
|
|
|
|
.map(author -> author.getLastName())
|
|
|
|
|
.collect(Collectors.joining(", "));
|
|
|
|
|
.collect(Collectors.joining(", ")), MAX_AUTHORS_LENGTH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getFilterAuthorId() {
|
|
|
|
|