paper model optimize
parent
f89928ce3d
commit
b99a5e9f06
@ -0,0 +1,64 @@
|
||||
package ru.ulstu.paper.model;
|
||||
|
||||
import ru.ulstu.user.model.UserDto;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
||||
|
||||
public class PaperDashboardDto {
|
||||
|
||||
private Integer id;
|
||||
private String title;
|
||||
private Paper.PaperStatus status;
|
||||
private Set<UserDto> authors;
|
||||
private String url;
|
||||
|
||||
public PaperDashboardDto(Paper paper) {
|
||||
this.id = paper.getId();
|
||||
this.title = paper.getTitle();
|
||||
this.status = paper.getStatus();
|
||||
this.authors = convert(paper.getAuthors(), UserDto::new);
|
||||
this.url = paper.getUrl();
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Paper.PaperStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Paper.PaperStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Set<UserDto> getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public void setAuthors(Set<UserDto> authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package ru.ulstu.paper.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PaperFilterListDto {
|
||||
private List<PaperListDto> papers;
|
||||
private Integer filterAuthorId;
|
||||
private Integer paperDeleteId;
|
||||
private Integer year;
|
||||
|
||||
public PaperFilterListDto() {
|
||||
}
|
||||
|
||||
public PaperFilterListDto(List<PaperListDto> paperDtos, Integer filterAuthorId, Integer year) {
|
||||
this.papers = paperDtos;
|
||||
this.filterAuthorId = filterAuthorId;
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public List<PaperListDto> getPapers() {
|
||||
return papers;
|
||||
}
|
||||
|
||||
public void setPapers(List<PaperListDto> papers) {
|
||||
this.papers = papers;
|
||||
}
|
||||
|
||||
public Integer getFilterAuthorId() {
|
||||
return filterAuthorId;
|
||||
}
|
||||
|
||||
public void setFilterAuthorId(Integer filterAuthorId) {
|
||||
this.filterAuthorId = filterAuthorId;
|
||||
}
|
||||
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(Integer year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public Integer getPaperDeleteId() {
|
||||
return paperDeleteId;
|
||||
}
|
||||
|
||||
public void setPaperDeleteId(Integer paperDeleteId) {
|
||||
this.paperDeleteId = paperDeleteId;
|
||||
}
|
||||
}
|
@ -1,51 +1,54 @@
|
||||
package ru.ulstu.paper.model;
|
||||
|
||||
import java.util.List;
|
||||
import ru.ulstu.user.model.UserDto;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
||||
|
||||
public class PaperListDto {
|
||||
private List<PaperDto> papers;
|
||||
private Integer filterAuthorId;
|
||||
private Integer paperDeleteId;
|
||||
private Integer year;
|
||||
|
||||
public PaperListDto() {
|
||||
}
|
||||
private Integer id;
|
||||
private String title;
|
||||
private Paper.PaperStatus status;
|
||||
private Set<UserDto> authors;
|
||||
|
||||
public PaperListDto(List<PaperDto> paperDtos, Integer filterAuthorId, Integer year) {
|
||||
this.papers = paperDtos;
|
||||
this.filterAuthorId = filterAuthorId;
|
||||
this.year = year;
|
||||
public PaperListDto(Paper paper) {
|
||||
this.id = paper.getId();
|
||||
this.title = paper.getTitle();
|
||||
this.status = paper.getStatus();
|
||||
this.authors = convert(paper.getAuthors(), UserDto::new);
|
||||
}
|
||||
|
||||
public List<PaperDto> getPapers() {
|
||||
return papers;
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPapers(List<PaperDto> papers) {
|
||||
this.papers = papers;
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getFilterAuthorId() {
|
||||
return filterAuthorId;
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setFilterAuthorId(Integer filterAuthorId) {
|
||||
this.filterAuthorId = filterAuthorId;
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
public Paper.PaperStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setYear(Integer year) {
|
||||
this.year = year;
|
||||
public void setStatus(Paper.PaperStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getPaperDeleteId() {
|
||||
return paperDeleteId;
|
||||
public Set<UserDto> getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public void setPaperDeleteId(Integer paperDeleteId) {
|
||||
this.paperDeleteId = paperDeleteId;
|
||||
public void setAuthors(Set<UserDto> authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,28 @@
|
||||
<template>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/papers" class="btn btn-light toolbar-button"><i class="fa fa-list-alt"></i>
|
||||
Список
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/dashboard" class="btn btn-light toolbar-button"><i class="fa fa-newspaper-o"
|
||||
aria-hidden="true"></i> Панель
|
||||
управления
|
||||
</router-link>
|
||||
<div>
|
||||
<div class="col-lg-12 text-center">
|
||||
<h2 class="section-heading text-uppercase">Статьи</h2>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/papers" class="btn btn-light toolbar-button"><i class="fa fa-list-alt"></i>
|
||||
Список
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/dashboard" class="btn btn-light toolbar-button"><i class="fa fa-newspaper-o"
|
||||
aria-hidden="true"></i>
|
||||
Панель
|
||||
управления
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/paper?id=0" class="btn btn-light toolbar-button"><i class="fa fa-plus-circle"
|
||||
aria-hidden="true"></i>
|
||||
Добавить статью
|
||||
</router-link>
|
||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||
<router-link to="/papers/paper?id=0" class="btn btn-light toolbar-button"><i class="fa fa-plus-circle"
|
||||
aria-hidden="true"></i>
|
||||
Добавить статью
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue