Skip to content

Commit

Permalink
[SAMBAD-254]-HandWaving 엔티티 작성 (#106)
Browse files Browse the repository at this point in the history
* [SAMBAD-254]-feat: Poking 엔티티 작성

* [SAMBAD-254]-feat: Poking controller service repository 추가

* [SAMBAD-254]-refactor: poking에서 handWaving으로 변경
  • Loading branch information
LeeHanEum authored and kkjsw17 committed Aug 20, 2024
1 parent dd5afb3 commit b9d50c8
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.depromeet.sambad.moring.meeting.handWaving.application;

public interface HandWavingRepository {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.depromeet.sambad.moring.meeting.handWaving.application;

import org.depromeet.sambad.moring.meeting.member.application.MeetingMemberService;
import org.springframework.stereotype.Service;

import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
public class HandWavingService {
private final HandWavingRepository handWavingRepository;
private final MeetingMemberService meetingMemberService;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.depromeet.sambad.moring.meeting.handWaving.domain;

import static jakarta.persistence.EnumType.STRING;

import org.depromeet.sambad.moring.common.domain.BaseTimeEntity;
import org.depromeet.sambad.moring.meeting.member.domain.MeetingMember;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class HandWaving extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "hand_waving_id")
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "sender_id")
private MeetingMember sender;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "receiver_id")
private MeetingMember receiver;

@Enumerated(STRING)
private HandWavingStatus status;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.depromeet.sambad.moring.meeting.handWaving.domain;

public enum HandWavingStatus {
REQUESTED, ACCEPTED, REJECTED
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.depromeet.sambad.moring.meeting.handWaving.infrastructure;

import org.depromeet.sambad.moring.meeting.handWaving.domain.HandWaving;
import org.springframework.data.jpa.repository.JpaRepository;

public interface HandWavingJpaRepository extends JpaRepository<HandWaving, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.depromeet.sambad.moring.meeting.handWaving.infrastructure;

import org.depromeet.sambad.moring.meeting.handWaving.application.HandWavingRepository;
import org.springframework.stereotype.Repository;

import lombok.RequiredArgsConstructor;

@Repository
@RequiredArgsConstructor
public class HandWavingRepositoryImpl implements HandWavingRepository {
private final HandWavingJpaRepository handWavingJpaRepository;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.depromeet.sambad.moring.meeting.handWaving.presentation;

import org.depromeet.sambad.moring.meeting.handWaving.application.HandWavingService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

@Tag(name = "손 흔들어 인사하기", description = "손 흔들어 인사하기 관련 api / 담당자 : 이한음")
@RequiredArgsConstructor
@RestController
@RequestMapping("/v1")
public class HandWavingController {
private final HandWavingService handWavingService;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.depromeet.sambad.moring.file.domain.FileEntity;
import org.depromeet.sambad.moring.meeting.meeting.domain.Meeting;
import org.depromeet.sambad.moring.meeting.member.presentation.request.MeetingMemberPersistRequest;
import org.depromeet.sambad.moring.meeting.handWaving.domain.HandWaving;
import org.depromeet.sambad.moring.meeting.question.domain.MeetingQuestion;
import org.depromeet.sambad.moring.meeting.question.presentation.exception.InvalidMeetingMemberTargetException;
import org.depromeet.sambad.moring.user.domain.User;
Expand Down Expand Up @@ -81,6 +82,12 @@ public class MeetingMember extends BaseTimeEntity implements Comparable<MeetingM
@OneToMany(mappedBy = "meetingMember", fetch = FetchType.LAZY)
private List<MeetingMemberHobby> meetingMemberHobbies = new ArrayList<>();

@OneToMany(mappedBy = "sender", fetch = FetchType.LAZY)
private List<HandWaving> sentHandWavings = new ArrayList<>();

@OneToMany(mappedBy = "receiver", fetch = FetchType.LAZY)
private List<HandWaving> receivedHandWavings = new ArrayList<>();

private MeetingMember(Meeting meeting, User user, FileEntity profileImageFile, MeetingMemberRole role, String name,
Gender gender, LocalDate birth, String job, String location, MBTI mbti, String introduction) {
this.meeting = meeting;
Expand Down

0 comments on commit b9d50c8

Please sign in to comment.