Skip to content

Commit

Permalink
밸런스 게임 조회 시 파일 id 필드 추가 (#819)
Browse files Browse the repository at this point in the history
* feat: log prod 파일 추가

* feat: 밸런스 게임 조회 시 fileId 필드 추가

* chore: submodule 최신화

* feat: 변수를 선언하여 가독성 있게 수정

* feat: 네이밍 변경
  • Loading branch information
jschoi-96 authored Dec 20, 2024
1 parent e64f8ad commit 7268ed4
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/balancetalk/game/dto/GameDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ public static GameMyPageResponse from(Game game, GameVote vote, String imgA, Str
public static List<GameOptionDto> getGameOptionDtos(Game game, Map<Long, String> gameOptionImgUrls) {
return game.getGameOptions().stream()
.map(option -> {
Long fileId = option.getImgId();
String imgUrl = gameOptionImgUrls.get(option.getId());
return GameOptionDto.fromEntity(option, imgUrl);
return GameOptionDto.fromEntity(option, fileId, imgUrl);
})
.toList();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/balancetalk/game/dto/GameOptionDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ public class GameOptionDto {
@Schema(description = "선택지", example = "A")
private VoteOption optionType;

public static GameOptionDto fromEntity(GameOption gameOption, String imgUrl) {
public static GameOptionDto fromEntity(GameOption gameOption, Long fileId, String imgUrl) {
return GameOptionDto.builder()
.id(gameOption.getId())
.name(gameOption.getName())
.fileId(fileId)
.imgUrl(imgUrl)
.description(gameOption.getDescription())
.optionType(gameOption.getOptionType())
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/balancetalk/game/dto/TempGameDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public static List<TempGameOptionDto> getTempGameOptionDtos(
) {
return tempGame.getTempGameOptions().stream()
.map(option -> {
Long fileId = option.getImgId();
String imgUrl = tempGameOptionImgUrls.get(option.getId());
return TempGameOptionDto.fromEntity(option, option.getImgId(), imgUrl);
return TempGameOptionDto.fromEntity(option, fileId, imgUrl);
})
.toList();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/balancetalk/game/dto/TempGameSetDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import lombok.Data;

public class TempGameSetDto {

@Data
public static class CreateTempGameSetRequest {

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config
41 changes: 41 additions & 0 deletions src/main/resources/logs/log4j2-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Configuration:
name: Logger-prod
status: info

Appenders:
RollingFile:
name: RollingFile_Appender
fileName: ${sys:LOG_DIR}/logfile.log
filePattern: "${sys:LOG_DIR}/logfile-%d{yyyy-MM-dd}.%i.txt"
PatternLayout:
pattern: "%style{%d{yyyy-MM-dd HH:mm:ss.SSS}{GMT+9}}{cyan} %highlight{[%-5p]}{FATAL=bg_red,
ERROR=red, INFO=green, DEBUG=blue, TRACE=bg_yellow} [%C] %style{[%t]}{yellow}- %m%n"
# immediateFlush: false # async 방식으로 버퍼를 통해 로그 남기기

Policies:
SizeBasedTriggeringPolicy:
size: "10 MB"
TimeBasedTriggeringPolicy:
Interval: 1 # 하루마다 rollover 발생
modulate: true

DefaultRollOverStrategy:
max: 10
Delete:
basePath: ${sys:LOG_DIR}
maxDepth: "1" # 디렉토리 깊이
IfLastModified:
age: "P7D" # 파일을 7일동안 보관

Loggers:
Root:
level: info
AppenderRef:
ref: RollingFile_Appender
Logger:
name: picko-prod
additivity: false
level: info
includeLocation: false
AppenderRef:
ref: RollingFile_Appender

0 comments on commit 7268ed4

Please sign in to comment.