Skip to content

Commit

Permalink
Hotfix: Rank 페이지 이미지 URL 응답
Browse files Browse the repository at this point in the history
  • Loading branch information
zionhann committed Oct 23, 2023
1 parent 2094136 commit 75c8fea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -17,9 +18,19 @@ public class PublicController {

private final TeamService teamService;

@Value("${custom.resource.path}")
private String imageBasePath;

@Value("${custom.jwt.issuer}")
private String baseUri;

@Operation(summary = "그룹 목록 조회")
@GetMapping("/teams")
public TeamRankDto getTeams() {
return teamService.getAllTeams();
TeamRankDto res = teamService.getAllTeams();
res.getTeams().forEach(teamInfo ->
teamInfo.addPathToFilename(baseUri + imageBasePath));

return res;
}
}
4 changes: 4 additions & 0 deletions src/main/java/edu/handong/csee/histudy/dto/TeamRankDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ public TeamInfo(StudyGroup studyGroup) {
.map(Image::getPath)))
.orElse(null);
}

public void addPathToFilename(String imageBasePath) {
this.thumbnail = imageBasePath + this.thumbnail;
}
}
}

0 comments on commit 75c8fea

Please sign in to comment.