-
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.
- Loading branch information
Showing
28 changed files
with
160 additions
and
25 deletions.
There are no files selected for viewing
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
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: 1 addition & 1 deletion
2
...ain/java/ddingdong/ddingdongBE/domain/documents/service/dto/query/AdminDocumentQuery.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
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
6 changes: 6 additions & 0 deletions
6
src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/FileCategory.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,6 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.entity; | ||
|
||
public enum FileCategory { | ||
CLUB_PROFILE_IMAGE, | ||
CLUB_INTRODUCTION_IMAGE | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/ddingdong/ddingdongBE/domain/filemetadata/entity/FileMetaData.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,37 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.entity; | ||
|
||
import ddingdong.ddingdongBE.common.BaseEntity; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.Id; | ||
import java.util.UUID; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class FileMetaData extends BaseEntity { | ||
|
||
@Id | ||
@Column(length = 16) | ||
private UUID fileId; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(nullable = false) | ||
private FileCategory fileCategory; | ||
|
||
@Column(nullable = false) | ||
private String fileName; | ||
|
||
@Builder | ||
public FileMetaData(FileCategory fileCategory, UUID fileId, String fileName) { | ||
this.fileId = fileId; | ||
this.fileCategory = fileCategory; | ||
this.fileName = fileName; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ain/java/ddingdong/ddingdongBE/domain/filemetadata/repository/FileMetaDataRepository.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,9 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.repository; | ||
|
||
import ddingdong.ddingdongBE.domain.filemetadata.entity.FileMetaData; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface FileMetaDataRepository extends JpaRepository<FileMetaData, UUID> { | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...ain/java/ddingdong/ddingdongBE/domain/filemetadata/service/FacadeFileMetaDataService.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,9 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.service; | ||
|
||
import ddingdong.ddingdongBE.domain.filemetadata.entity.FileMetaData; | ||
import java.util.UUID; | ||
|
||
public interface FacadeFileMetaDataService { | ||
|
||
FileMetaData getFileUrlWithMetaData(UUID fileId); | ||
} |
21 changes: 21 additions & 0 deletions
21
...java/ddingdong/ddingdongBE/domain/filemetadata/service/FacadeFileMetaDataServiceImpl.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,21 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.service; | ||
|
||
import ddingdong.ddingdongBE.domain.filemetadata.entity.FileMetaData; | ||
import java.util.UUID; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class FacadeFileMetaDataServiceImpl implements FacadeFileMetaDataService { | ||
|
||
private final FileMetaDataService fileMetaDataService; | ||
|
||
@Override | ||
public FileMetaData getFileUrlWithMetaData(UUID fileId) { | ||
return fileMetaDataService.getByFileId(fileId); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/ddingdong/ddingdongBE/domain/filemetadata/service/FileMetaDataService.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,12 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.service; | ||
|
||
import ddingdong.ddingdongBE.domain.filemetadata.entity.FileMetaData; | ||
import java.util.UUID; | ||
|
||
public interface FileMetaDataService { | ||
|
||
void create(FileMetaData fileMetaData); | ||
|
||
FileMetaData getByFileId(UUID fileId); | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...in/java/ddingdong/ddingdongBE/domain/filemetadata/service/GeneralFileMetaDataService.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,30 @@ | ||
package ddingdong.ddingdongBE.domain.filemetadata.service; | ||
|
||
import ddingdong.ddingdongBE.common.exception.PersistenceException.ResourceNotFound; | ||
import ddingdong.ddingdongBE.domain.filemetadata.entity.FileMetaData; | ||
import ddingdong.ddingdongBE.domain.filemetadata.repository.FileMetaDataRepository; | ||
import java.util.UUID; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class GeneralFileMetaDataService implements FileMetaDataService { | ||
|
||
private final FileMetaDataRepository fileMetaDataRepository; | ||
|
||
@Transactional | ||
@Override | ||
public void create(FileMetaData fileMetaData) { | ||
fileMetaDataRepository.save(fileMetaData); | ||
} | ||
|
||
@Override | ||
public FileMetaData getByFileId(UUID fileId) { | ||
return fileMetaDataRepository.findById(fileId) | ||
.orElseThrow(() -> new ResourceNotFound("FimeMetaData(fileId=" + fileId + "를 찾을 수 없습니다.")); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ava/ddingdong/ddingdongBE/domain/notice/controller/dto/response/DetailNoticeResponse.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
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
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
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: 1 addition & 1 deletion
2
...ngdongBE/file/dto/ExcelClubMemberDto.java → .../file/service/dto/ExcelClubMemberDto.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
2 changes: 1 addition & 1 deletion
2
...ng/ddingdongBE/file/dto/FileResponse.java → ...dongBE/file/service/dto/FileResponse.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
3 changes: 2 additions & 1 deletion
3
...g/ddingdongBE/file/dto/UploadFileDto.java → ...ongBE/file/service/dto/UploadFileDto.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
9 changes: 9 additions & 0 deletions
9
src/main/resources/db/migration/V10__create_file_meta_data_table.sql
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,9 @@ | ||
create table file_meta_data | ||
( | ||
file_id binary(16) not null | ||
primary key, | ||
created_at timestamp null, | ||
updated_at timestamp null, | ||
file_category varchar(255) not null, | ||
file_name varchar(255) not null | ||
); |
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
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