-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2 Crud de Cursos - Alterações do Review
- Loading branch information
Jhê Cardoso
committed
Feb 6, 2021
1 parent
3d8af53
commit 2959260
Showing
14 changed files
with
96 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# hatcher-pm | ||
Sistema de gestão e acompanhamento de projetos do AYTY | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 17 additions & 61 deletions
78
src/main/java/org/ayty/hatcher/api/v1/course/dto/Course.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,34 @@ | ||
package org.ayty.hatcher.api.v1.course.dto; | ||
|
||
import lombok.Data; | ||
import org.hibernate.validator.constraints.Length; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.EqualsAndHashCode; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import javax.persistence.GenerationType; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotEmpty; | ||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
@Data | ||
@Entity | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(exclude={"name", "description"}) | ||
@Table(name="REGISTRATION_COURSE") | ||
public class Course implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Getter @Setter private Long id; | ||
|
||
@NotEmpty(message = "Não pode ser deixado vazio") | ||
@Length(min=3, max=255, message = "O nome dever ter entre 3 e 100 caracteres") | ||
private String name; | ||
@Getter @Setter private String name; | ||
|
||
private String description; | ||
@Getter @Setter private String description; | ||
|
||
public Course(){ | ||
super(); | ||
} | ||
|
||
public Course(Long id, String name, String description) { | ||
this.id = id; | ||
this.name = name; | ||
this.description = description; | ||
} | ||
|
||
public static long getSerialVersionUID() { | ||
return serialVersionUID; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
Course that = (Course) o; | ||
return id.equals(that.id); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id); | ||
} | ||
} |
13 changes: 11 additions & 2 deletions
13
src/main/java/org/ayty/hatcher/api/v1/course/dto/CourseController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/org/ayty/hatcher/api/v1/course/exception/ObjectNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 13 additions & 36 deletions
49
src/main/java/org/ayty/hatcher/api/v1/course/exception/StandardError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,19 @@ | ||
package org.ayty.hatcher.api.v1.course.exception; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@ResponseStatus(code = HttpStatus.BAD_REQUEST) | ||
public class StandardError { | ||
|
||
private Integer status; | ||
private Long timestamp; | ||
private String message; | ||
@Getter @Setter private Integer status; | ||
@Getter @Setter private Long timestamp; | ||
@Getter @Setter private String message; | ||
|
||
public StandardError() { | ||
super(); | ||
} | ||
|
||
public StandardError(Integer status, Long timestamp, String message) { | ||
this.status = status; | ||
this.timestamp = timestamp; | ||
this.message = message; | ||
} | ||
|
||
public Integer getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(Integer status) { | ||
this.status = status; | ||
} | ||
|
||
public Long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(Long timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
} |
Oops, something went wrong.