Skip to content

Commit

Permalink
chore: 번쩍 도메인 네이밍 lightning -> flash로 변경 (#544)
Browse files Browse the repository at this point in the history
* chore: 환경 설정 관련 도메인 네이밍 변경

* chore: 서비스 로직 관련 도메인 네이밍 변경

* chore: 모임 관련 번쩍 네이밍 변경

* chore: 태그 관련 번쩍 네이밍 변경

* chore: 에러메시지 관련 번쩍 네이밍 변경

* chore: enum value에 공백 추가

* refactor: 반환 변수 네이밍 변경
  • Loading branch information
hoonyworld authored Jan 25, 2025
1 parent 39f8fb1 commit 96ebe1f
Show file tree
Hide file tree
Showing 43 changed files with 426 additions and 426 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.sopt.makers.crew.main.entity.lightning;
package org.sopt.makers.crew.main.entity.flash;

import java.time.LocalDateTime;
import java.util.List;

import org.hibernate.annotations.Type;
import org.sopt.makers.crew.main.entity.common.BaseTimeEntity;
import org.sopt.makers.crew.main.entity.lightning.converter.LightningPlaceTypeConverter;
import org.sopt.makers.crew.main.entity.lightning.converter.LightningTimingTypeConverter;
import org.sopt.makers.crew.main.entity.lightning.enums.LightningPlaceType;
import org.sopt.makers.crew.main.entity.lightning.enums.LightningTimingType;
import org.sopt.makers.crew.main.entity.flash.converter.FlashPlaceTypeConverter;
import org.sopt.makers.crew.main.entity.flash.converter.FlashTimingTypeConverter;
import org.sopt.makers.crew.main.entity.flash.enums.FlashPlaceType;
import org.sopt.makers.crew.main.entity.flash.enums.FlashTimingType;
import org.sopt.makers.crew.main.entity.meeting.enums.EnMeetingStatus;
import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO;

Expand All @@ -30,8 +30,8 @@
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "lightning")
public class Lightning extends BaseTimeEntity {
@Table(name = "flash")
public class Flash extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
Expand All @@ -52,10 +52,10 @@ public class Lightning extends BaseTimeEntity {
@Column(name = "desc", columnDefinition = "TEXT")
private String desc;

@Column(name = "lightningTimingType")
@Column(name = "flashTimingType")
@NotNull
@Convert(converter = LightningTimingTypeConverter.class)
private LightningTimingType lightningTimingType;
@Convert(converter = FlashTimingTypeConverter.class)
private FlashTimingType flashTimingType;

@Column(name = "startDate")
@NotNull
Expand All @@ -73,13 +73,13 @@ public class Lightning extends BaseTimeEntity {
@NotNull
private LocalDateTime activityEndDate;

@Column(name = "lightningPlaceType")
@Column(name = "flashPlaceType")
@NotNull
@Convert(converter = LightningPlaceTypeConverter.class)
private LightningPlaceType lightningPlaceType;
@Convert(converter = FlashPlaceTypeConverter.class)
private FlashPlaceType flashPlaceType;

@Column(name = "lightningPlace")
private String lightningPlace;
@Column(name = "flashPlace")
private String flashPlace;

@Column(name = "minimumCapacity")
@NotNull
Expand All @@ -98,38 +98,38 @@ public class Lightning extends BaseTimeEntity {
private List<ImageUrlVO> imageURL;

@Builder
public Lightning(Integer leaderUserId, Integer meetingId, String title, String desc,
LightningTimingType lightningTimingType,
public Flash(Integer leaderUserId, Integer meetingId, String title, String desc,
FlashTimingType flashTimingType,
LocalDateTime startDate, LocalDateTime endDate,
LocalDateTime activityStartDate, LocalDateTime activityEndDate, LightningPlaceType lightningPlaceType,
String lightningPlace, int minimumCapacity, int maximumCapacity, Integer createdGeneration,
LocalDateTime activityStartDate, LocalDateTime activityEndDate, FlashPlaceType flashPlaceType,
String flashPlace, int minimumCapacity, int maximumCapacity, Integer createdGeneration,
List<ImageUrlVO> imageURL) {
this.leaderUserId = leaderUserId;
this.meetingId = meetingId;
this.title = title;
this.desc = desc;
this.lightningTimingType = lightningTimingType;
this.flashTimingType = flashTimingType;
this.startDate = startDate;
this.endDate = endDate;
this.activityStartDate = activityStartDate;
this.activityEndDate = activityEndDate;
this.lightningPlaceType = lightningPlaceType;
this.lightningPlace = lightningPlace;
this.flashPlaceType = flashPlaceType;
this.flashPlace = flashPlace;
this.minimumCapacity = minimumCapacity;
this.maximumCapacity = maximumCapacity;
this.createdGeneration = createdGeneration;
this.imageURL = imageURL;
}

public boolean checkLightningMeetingLeader(Integer userId) {
public boolean checkFlashMeetingLeader(Integer userId) {
return this.leaderUserId.equals(userId);
}

public int getLightningMeetingStatusValue(LocalDateTime now) {
return getLightningMeetingStatus(now).getValue();
public int getFlashMeetingStatusValue(LocalDateTime now) {
return getFlashMeetingStatus(now).getValue();
}

public EnMeetingStatus getLightningMeetingStatus(LocalDateTime now) {
public EnMeetingStatus getFlashMeetingStatus(LocalDateTime now) {
if (now.isBefore(startDate)) {
return EnMeetingStatus.BEFORE_START;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.sopt.makers.crew.main.entity.flash;

import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;

public interface FlashRepository extends JpaRepository<Flash, Integer> {
Optional<Flash> findByMeetingId(Integer meetingId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.sopt.makers.crew.main.entity.flash.converter;

import org.sopt.makers.crew.main.entity.flash.enums.FlashPlaceType;

import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;

@Converter
public class FlashPlaceTypeConverter implements AttributeConverter<FlashPlaceType, String> {

@Override
public String convertToDatabaseColumn(FlashPlaceType flashPlaceType) {
return flashPlaceType.getValue(); // FlashPlaceType의 값을 반환
}

@Override
public FlashPlaceType convertToEntityAttribute(String dbData) {
return FlashPlaceType.ofValue(dbData); // dbData에 해당하는 FlashPlaceType 객체를 반환
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.sopt.makers.crew.main.entity.flash.converter;

import org.sopt.makers.crew.main.entity.flash.enums.FlashTimingType;

import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;

@Converter
public class FlashTimingTypeConverter implements AttributeConverter<FlashTimingType, String> {

@Override
public String convertToDatabaseColumn(FlashTimingType flashTimingType) {
return flashTimingType.getValue(); // FlashTimingType의 값을 반환
}

@Override
public FlashTimingType convertToEntityAttribute(String dbData) {
return FlashTimingType.ofValue(dbData); // dbData에 해당하는 FlashTimingType 객체를 반환
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.sopt.makers.crew.main.entity.flash.enums;

import lombok.Getter;

@Getter
public enum FlashPlaceType {
OFFLINE("오프라인"),
ONLINE("온라인"),
AFTER_DISCUSSION("협의 후 결정");

private final String value;

FlashPlaceType(String value) {
this.value = value;
}

public static FlashPlaceType ofValue(String dbData) {
for (FlashPlaceType place : FlashPlaceType.values()) {
if (place.getValue().equals(dbData)) {
return place;
}
}
throw new IllegalArgumentException("Invalid FlashPlaceType value: " + dbData);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.sopt.makers.crew.main.entity.flash.enums;

import lombok.Getter;

@Getter
public enum FlashTimingType {
IMMEDIATE("당일"),
AFTER_DISCUSSION("예정 기간 (협의 후 결정)");

private final String value;

FlashTimingType(String value) {
this.value = value;
}

public static FlashTimingType ofValue(String dbData) {
for (FlashTimingType timing : FlashTimingType.values()) {
if (timing.getValue().equals(dbData)) {
return timing;
}
}
throw new IllegalArgumentException("Invalid FlashTimingType value: " + dbData);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Meeting(User user, Integer userId, String title, MeetingCategory category
this.joinableParts = joinableParts;
}

public static Meeting createLightningMeeting(User user, Integer userId, String title,
public static Meeting createFlashMeeting(User user, Integer userId, String title,
List<ImageUrlVO> imageURL, LocalDateTime startDate,
LocalDateTime endDate, Integer capacity, String desc,
LocalDateTime mStartDate, LocalDateTime mEndDate,
Expand All @@ -205,7 +205,7 @@ public static Meeting createLightningMeeting(User user, Integer userId, String t
.user(user)
.userId(userId)
.title(title)
.category(MeetingCategory.LIGHTNING)
.category(MeetingCategory.FLASH)
.imageURL(imageURL)
.startDate(startDate)
.endDate(endDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public enum MeetingCategory {
STUDY("스터디"),
LECTURE("강연"),
LIGHTNING("번쩍"),
FLASH("번쩍"),
EVENT("행사"),
SEMINAR("세미나");

Expand All @@ -26,4 +26,4 @@ public static MeetingCategory ofValue(String dbData) {
public String getValue() {
return value;
}
}
}
Loading

0 comments on commit 96ebe1f

Please sign in to comment.