-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor : FeedType에 따른 FileMetaData 삭제로직 수정
- Loading branch information
Showing
5 changed files
with
21 additions
and
41 deletions.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
src/main/java/ddingdong/ddingdongBE/domain/feed/entity/FeedType.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
39 changes: 11 additions & 28 deletions
39
src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/DomainType.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,37 +1,20 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.entity; | ||
|
||
import ddingdong.ddingdongBE.domain.activityreport.domain.ActivityReport; | ||
import ddingdong.ddingdongBE.domain.banner.entity.Banner; | ||
import ddingdong.ddingdongBE.domain.club.entity.Club; | ||
import ddingdong.ddingdongBE.domain.documents.entity.Document; | ||
import ddingdong.ddingdongBE.domain.feed.entity.Feed; | ||
import ddingdong.ddingdongBE.domain.fixzone.entity.FixZone; | ||
import ddingdong.ddingdongBE.domain.notice.entity.Notice; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum DomainType { | ||
CLUB_PROFILE(Club.class), | ||
CLUB_INTRODUCTION(Club.class), | ||
FIX_ZONE_IMAGE(FixZone.class), | ||
NOTICE_IMAGE(Notice.class), | ||
NOTICE_FILE(Notice.class), | ||
DOCUMENT_FILE(Document.class), | ||
ACTIVITY_REPORT_IMAGE(ActivityReport.class), | ||
BANNER_WEB_IMAGE(Banner.class), | ||
BANNER_MOBILE_IMAGE(Banner.class), | ||
FEED_IMAGE(Feed.class), | ||
FEED_VIDEO(Feed.class); | ||
|
||
private final Class<?> classType; | ||
|
||
public static List<DomainType> findAllByClassType(Class<?> classType) { | ||
return Arrays.stream(values()) | ||
.filter(domainType -> domainType.getClassType() == classType) | ||
.toList(); | ||
} | ||
CLUB_PROFILE, | ||
CLUB_INTRODUCTION, | ||
FIX_ZONE_IMAGE, | ||
NOTICE_IMAGE, | ||
NOTICE_FILE, | ||
DOCUMENT_FILE, | ||
ACTIVITY_REPORT_IMAGE, | ||
BANNER_WEB_IMAGE, | ||
BANNER_MOBILE_IMAGE, | ||
FEED_IMAGE, | ||
FEED_VIDEO; | ||
} |
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