Skip to content

Commit

Permalink
Merge pull request #29 from Leets-Official/feat]-#21-프로젝트-소개-로직-개발
Browse files Browse the repository at this point in the history
[fix] #29 포트폴리오 저장 수정
  • Loading branch information
taeseokyang authored Feb 26, 2024
2 parents 84f8534 + fbcf53b commit 6c6c31f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.core.io.ClassPathResource;

@RestController
@RequiredArgsConstructor
@RequestMapping("/images")
public class ImageController {
@Value("${image.path}")
private String imageStoragePath;

@GetMapping("/{imageName}")
public ResponseEntity<?> getImage(@PathVariable String imageName) {
Resource resource = new ClassPathResource(imageStoragePath + imageName);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/land/leets/domain/portfolio/domain/Portfolio.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ public class Portfolio extends BaseTimeEntity {
@Column(nullable = false)
private LocalDate endDate;

@Column(nullable = false)
private String serviceUrl;

@OneToMany(mappedBy = "portfolio", fetch = FetchType.EAGER, orphanRemoval = true)
@JsonIgnore
private List<Contributor> contributors = new ArrayList<>();

@Column
private String serviceUrl;

@Column
@Column(nullable = false)
private String logoImgName;

@Column
@Column(nullable = false)
private String mainImgName;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public PortfolioResponse execute(PortfolioRequest request) {
.scope(request.getScope())
.startDate(request.getStartDate())
.endDate(request.getEndDate())
.serviceUrl(request.getServiceUrl())
.contributors(request.getContributors())
.logoImgName(request.getLogoImgName())
.mainImgName(request.getMainImgName())
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ target:
prod: ${TARGET_URL_PROD}

image:
path: src/main/resources/images/
path: images/

0 comments on commit 6c6c31f

Please sign in to comment.