This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
46 additions
and
34 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
37 changes: 3 additions & 34 deletions
37
daemawiki-api/src/main/java/org/daemawiki/domain/common/DefaultProfile.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,40 +1,9 @@ | ||
package org.daemawiki.domain.common; | ||
|
||
import org.daemawiki.domain.file.model.File; | ||
import org.daemawiki.domain.file.model.FileDetail; | ||
import org.daemawiki.domain.file.model.type.FileType; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.UUID; | ||
|
||
@Component | ||
public class DefaultProfile { | ||
|
||
@Value("${profile.image.url}") | ||
private String defaultImageURL; | ||
|
||
@Value("${profile.image.id}") | ||
private UUID defaultImageId; | ||
|
||
@Value("${profile.image.name}") | ||
private String defaultImageName; | ||
|
||
@Value("${profile.image.type}") | ||
private String defaultImageType; | ||
|
||
public final File defaultProfile() { | ||
return File.create(defaultImageId, | ||
defaultImageName, | ||
defaultImageType, | ||
FileDetail.create(FileType.PROFILE, defaultImageURL)); | ||
} | ||
|
||
public final File defaultDocumentImage() { | ||
return File.create(defaultImageId, | ||
defaultImageName, | ||
defaultImageType, | ||
FileDetail.create(FileType.DOCUMENT, defaultImageURL)); | ||
} | ||
public interface DefaultProfile { | ||
File defaultProfile(); | ||
File defaultDocumentImage(); | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
daemawiki-api/src/main/java/org/daemawiki/domain/common/DefaultProfileImpl.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,42 @@ | ||
package org.daemawiki.domain.common; | ||
|
||
import org.daemawiki.domain.file.model.File; | ||
import org.daemawiki.domain.file.model.FileDetail; | ||
import org.daemawiki.domain.file.model.type.FileType; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.UUID; | ||
|
||
@Component | ||
public class DefaultProfileImpl implements DefaultProfile { | ||
|
||
@Value("${profile.image.url}") | ||
private String defaultImageURL; | ||
|
||
@Value("${profile.image.id}") | ||
private UUID defaultImageId; | ||
|
||
@Value("${profile.image.name}") | ||
private String defaultImageName; | ||
|
||
@Value("${profile.image.type}") | ||
private String defaultImageType; | ||
|
||
@Override | ||
public final File defaultProfile() { | ||
return File.create(defaultImageId, | ||
defaultImageName, | ||
defaultImageType, | ||
FileDetail.create(FileType.PROFILE, defaultImageURL)); | ||
} | ||
|
||
@Override | ||
public final File defaultDocumentImage() { | ||
return File.create(defaultImageId, | ||
defaultImageName, | ||
defaultImageType, | ||
FileDetail.create(FileType.DOCUMENT, defaultImageURL)); | ||
} | ||
|
||
} |