ip program test
This commit is contained in:
50
src/main/java/ru/ip/example/domain/FilmDto.java
Normal file
50
src/main/java/ru/ip/example/domain/FilmDto.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package ru.ip.example.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
//dto - data transfer object
|
||||
@Schema(description = "Информация о фильме")
|
||||
public class FilmDto {
|
||||
|
||||
@Schema(description = "Название фильма")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "Категория фильма")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "Год выпуска")
|
||||
private Integer releaseYear;
|
||||
|
||||
public FilmDto(String title, String category, Integer releaseYear) {
|
||||
this.title = title;
|
||||
this.category = category;
|
||||
this.releaseYear = releaseYear;
|
||||
}
|
||||
|
||||
public FilmDto() {
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Integer getReleaseYear() {
|
||||
return releaseYear;
|
||||
}
|
||||
|
||||
public void setReleaseYear(Integer releaseYear) {
|
||||
this.releaseYear = releaseYear;
|
||||
}
|
||||
}
|
||||
79
src/main/java/ru/ip/example/domain/FilmEntity.java
Normal file
79
src/main/java/ru/ip/example/domain/FilmEntity.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package ru.ip.example.domain;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class FilmEntity {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String category;
|
||||
|
||||
private Integer releaseYear;
|
||||
|
||||
public FilmEntity(Integer id, String title, String category, Integer releaseYear) {
|
||||
this.id = id;
|
||||
this.title = title;
|
||||
this.category = category;
|
||||
this.releaseYear = releaseYear;
|
||||
}
|
||||
|
||||
public FilmEntity() {
|
||||
}
|
||||
|
||||
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 String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Integer getReleaseYear() {
|
||||
return releaseYear;
|
||||
}
|
||||
|
||||
public void setReleaseYear(Integer releaseYear) {
|
||||
this.releaseYear = releaseYear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
FilmEntity that = (FilmEntity) o;
|
||||
return Objects.equals(id, that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FilmEntity{" +
|
||||
"id=" + id +
|
||||
", title='" + title + '\'' +
|
||||
", category='" + category + '\'' +
|
||||
", releaseYear=" + releaseYear +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user