Replace @Data, replace typo in word "exeption" to "exception"
This commit is contained in:
1 parent
55a5985b08
commit
6880bf8b3c
6 files changed
+76
-14
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
package site.easystartup.web.project.domain.exeption;
|
||||
package site.easystartup.web.project.domain.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
@@ -1,14 +1,17 @@
|
||||
package site.easystartup.web.project.domain.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import org.hibernate.Hibernate;
|
||||
import site.easystartup.web.domain.User;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@RequiredArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "participant")
|
||||
public class Participant {
|
||||
@@ -31,5 +34,19 @@ public class Participant {
|
||||
@JoinTable(name = "user_request",
|
||||
joinColumns = @JoinColumn(name = "participant_id"),
|
||||
inverseJoinColumns = @JoinColumn(name = "user_id"))
|
||||
@ToString.Exclude
|
||||
private List<User> requests;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
Participant that = (Participant) o;
|
||||
return participantId != null && Objects.equals(participantId, that.participantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getClass().hashCode();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package site.easystartup.web.project.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import org.hibernate.Hibernate;
|
||||
import site.easystartup.web.domain.User;
|
||||
|
||||
import javax.persistence.*;
|
||||
@@ -9,9 +10,12 @@ import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@RequiredArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "project")
|
||||
public class Project {
|
||||
@@ -41,6 +45,7 @@ public class Project {
|
||||
joinColumns = @JoinColumn(name = "project_id"),
|
||||
inverseJoinColumns = @JoinColumn(name = "tag_id")
|
||||
)
|
||||
@ToString.Exclude
|
||||
private List<Tag> technology;
|
||||
|
||||
@ManyToOne
|
||||
@@ -48,6 +53,7 @@ public class Project {
|
||||
private User owner;
|
||||
|
||||
@OneToMany(mappedBy = "project", cascade = {CascadeType.ALL})
|
||||
@ToString.Exclude
|
||||
private List<Participant> participants;
|
||||
|
||||
@Column(name = "created_date", updatable = false)
|
||||
@@ -58,4 +64,17 @@ public class Project {
|
||||
private void createdDate() {
|
||||
this.createdDate = LocalDateTime.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
Project project = (Project) o;
|
||||
return projectId != null && Objects.equals(projectId, project.projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getClass().hashCode();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
package site.easystartup.web.project.domain.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@RequiredArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "tag")
|
||||
public class Tag {
|
||||
@@ -18,5 +23,19 @@ public class Tag {
|
||||
private String tagName;
|
||||
|
||||
@ManyToMany(mappedBy = "technology")
|
||||
@ToString.Exclude
|
||||
private Set<Project> projects;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
Tag tag = (Tag) o;
|
||||
return tagId != null && Objects.equals(tagId, tag.tagId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getClass().hashCode();
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,9 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import site.easystartup.web.domain.User;
|
||||
import site.easystartup.web.project.domain.exeption.ProjectNotFoundException;
|
||||
import site.easystartup.web.project.domain.exception.ProjectNotFoundException;
|
||||
import site.easystartup.web.project.domain.model.Participant;
|
||||
import site.easystartup.web.project.domain.model.Project;
|
||||
import site.easystartup.web.project.domain.model.Tag;
|
||||
import site.easystartup.web.project.domain.payload.requst.ProjectRequest;
|
||||
import site.easystartup.web.project.repo.ParticipantRepo;
|
||||
import site.easystartup.web.project.repo.ProjectRepo;
|
||||
@@ -15,8 +14,6 @@ import site.easystartup.web.service.UserService;
|
||||
import site.easystartup.web.storage.service.StorageService;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
Reference in new issue
Block a user