Resolve "Тех. долг: отрефакторить контроллеры и модели"
#159
Merged
tatyana_belousova
merged 1 commits from 50-refactorForGrants
into dev
5 years ago
@ -1,58 +0,0 @@
|
|||||||
package ru.ulstu.deadline.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class DeadlineDto {
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date date;
|
|
||||||
|
|
||||||
public DeadlineDto() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonCreator
|
|
||||||
public DeadlineDto(@JsonProperty("id") Integer id,
|
|
||||||
@JsonProperty("description") String description,
|
|
||||||
@JsonProperty("date") Date date) {
|
|
||||||
this.id = id;
|
|
||||||
this.description = description;
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DeadlineDto(Deadline deadline) {
|
|
||||||
this.id = deadline.getId();
|
|
||||||
this.description = deadline.getDescription();
|
|
||||||
this.date = deadline.getDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDate() {
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(Date date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue