#13 some refactoring

This commit is contained in:
Семенова Мария 2019-03-19 17:59:19 +04:00
parent 1a522f7b44
commit 3c068df201
3 changed files with 9 additions and 47 deletions

View File

@ -3,14 +3,9 @@ package ru.ulstu.file.model;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
public class FileDataDto { public class FileDataDto {
private Integer id; private Integer id;
private String name; private String name;
private long size;
private Date createDate;
private byte[] data;
private String fileName; private String fileName;
private String tmpFileName; private String tmpFileName;
@ -22,16 +17,10 @@ public class FileDataDto {
@JsonCreator @JsonCreator
public FileDataDto(@JsonProperty("id") Integer id, public FileDataDto(@JsonProperty("id") Integer id,
@JsonProperty("name") String name, @JsonProperty("name") String name,
@JsonProperty("size") long size,
@JsonProperty("createDate") Date createDate,
@JsonProperty("data") byte[] data,
@JsonProperty("fileName") String fileName, @JsonProperty("fileName") String fileName,
@JsonProperty("tmpFileName") String tmpFileName) { @JsonProperty("tmpFileName") String tmpFileName) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.size = size;
this.createDate = createDate;
this.data = data;
this.fileName = fileName; this.fileName = fileName;
this.tmpFileName = tmpFileName; this.tmpFileName = tmpFileName;
} }
@ -39,9 +28,6 @@ public class FileDataDto {
public FileDataDto(FileData fileData) { public FileDataDto(FileData fileData) {
this.id = fileData.getId(); this.id = fileData.getId();
this.name = fileData.getName(); this.name = fileData.getName();
this.size = fileData.getSize();
this.createDate = fileData.getCreateDate();
this.data = fileData.getData();
} }
public Integer getId() { public Integer getId() {
@ -60,30 +46,6 @@ public class FileDataDto {
this.name = name; this.name = name;
} }
public long getSize() {
return size;
}
public void setSize(long size) {
this.size = size;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
public String getFileName() { public String getFileName() {
return fileName; return fileName;
} }

View File

@ -0,0 +1,5 @@
#files-list .row > div:nth-child(6) {
display: flex;
justify-content: center;
flex-direction: column;
}

View File

@ -3,7 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html"> layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head> <head>
<link rel="stylesheet" href="../css/paper.css"/>
</head> </head>
<body> <body>
@ -107,14 +107,9 @@
<span aria-hidden="true"><i class="fa fa-times"/></span> <span aria-hidden="true"><i class="fa fa-times"/></span>
</a> </a>
</div> </div>
<div class="col-10" th:if="${file.id==null}"> <div class="col-10">
<a th:onclick="|downloadFile('${file.tmpFileName}',null,'${file.name}') |" <a th:onclick="${file.id==null} ? 'downloadFile('+${file.tmpFileName}+',null,\''+${file.name}+'\')':
href="javascript:void(0)" 'downloadFile(null,'+${file.id}+',\''+${file.name}+'\')' "
th:text="*{files[__${rowStat.index}__].name}">
</a>
</div>
<div class="col-10" th:unless="${file.id==null}">
<a th:onclick="|downloadFile(null,${file.id},'${file.name}') |"
href="javascript:void(0)" href="javascript:void(0)"
th:text="*{files[__${rowStat.index}__].name}"> th:text="*{files[__${rowStat.index}__].name}">
</a> </a>