-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: PR #11 코드 리뷰 반영 #29
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
565017f
feat: Participant 파일 위치 수정
Lee-Dahyeon 7913adf
feat: ParticipantRepository 메소드 명 수정
Lee-Dahyeon f5662d6
feat:ParticipantService 예외 처리
Lee-Dahyeon 2a7c261
feat: WorkspaceRepository 어노테이션 추가
Lee-Dahyeon 1ab4923
feat: UserRepository 추가
Lee-Dahyeon bacd534
feat: 파일 재생성에 따른 파일 삭제
Lee-Dahyeon 1c77935
feat: ParticipantRepository 수정
Lee-Dahyeon c5c4a23
feat:Merge Confilcts 해결
Lee-Dahyeon e6f17e6
feat:Merge Confilcts 해결
Lee-Dahyeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/main/java/com/hyunsolution/dangu/participant/domain/Participant.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.hyunsolution.dangu.participant.domain; | ||
|
||
import com.hyunsolution.dangu.user.domain.User; | ||
import com.hyunsolution.dangu.workspace.domain.Workspace; | ||
import javax.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.hibernate.annotations.ColumnDefault; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Participant { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn( | ||
name = "user_id", | ||
nullable = false, | ||
foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) | ||
private User user; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn( | ||
name = "workspace_id", | ||
nullable = false, | ||
foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) | ||
private Workspace workspace; | ||
|
||
@Column(name = "participant_match", nullable = false) | ||
@ColumnDefault("false") | ||
private boolean participantMatch; | ||
|
||
@Builder | ||
public Participant(User user, Workspace workspace, boolean participantMatch) { | ||
this.user = user; | ||
this.workspace = workspace; | ||
this.participantMatch = participantMatch; | ||
} | ||
|
||
public void accept() { | ||
this.participantMatch = true; | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/hyunsolution/dangu/workspace/domain/WorkspaceRepository.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,10 +1,12 @@ | ||
package com.hyunsolution.dangu.workspace.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface WorkspaceRepository extends JpaRepository<Workspace, Long> { | ||
|
||
@Modifying | ||
@Query(value = "UPDATE Workspace w SET w.isMatched=true WHERE w.id=:workspaceId") | ||
void UpdateWorkspaceStatus(Long workspaceId); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean existsByIdAndAndParticipantMatchTrue(long id);
위처럼 JPQL을 사용하지 않고 Data JPA를 사용 할 수도 있을 것 같아요
그리고 isClicekd는 너무 추상적인 단어 인 것 같아요.