Skip to content

Commit

Permalink
Merge pull request #48 from kookmin-sw/feat/chat4
Browse files Browse the repository at this point in the history
fix: 자기소개서 디버깅
  • Loading branch information
KimChanJin97 authored May 7, 2024
2 parents 48235b1 + 1d1dae5 commit eb28c40
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
9 changes: 0 additions & 9 deletions src/main/java/capstone/facefriend/DummyInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,13 @@ public class DummyInitializer {
private final MemberRepository memberRepository;

private final AnalysisInfoRepository analysisInfoRepository;
private final AnalysisInfoService analysisInfoService;

private final ResumeService resumeService;
private final ResumeRepository resumeRepository;


@PostConstruct
@Transactional
public void init() {
Random random = new Random();

List<Integer> GOOD_COMBI = new ArrayList<>();


List<List<String>> CATEGORY = List.of(
List.of("FOOD"),
List.of("WORKOUT"),
Expand Down Expand Up @@ -183,8 +176,6 @@ public void init() {
.member(member)
.build();
resumeRepository.save(resume);

// Resume.Category.valueOf(CATEGORY.get(random.nextInt(size-1))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public List<String> uploadResumeImages(

for (MultipartFile image : images) {

log.info("size = {}", image.getSize());
if (image.isEmpty() || image.getSize() == 0) {
return List.of();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

import java.io.IOException;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;


@Slf4j
Expand All @@ -24,12 +27,20 @@ public class ResumeController {
private final ResumeService resumeService;

// 정적 쿼리
@PostMapping(value = "/my-resume", consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
@PostMapping(value = "/my-resume")
public ResponseEntity<ResumePostPutResponse> postMyResume(
@AuthMember Long memberId,
@RequestPart(value = "images") List<MultipartFile> images,
@RequestPart(value = "image1", required = false) MultipartFile image1,
@RequestPart(value = "image2", required = false) MultipartFile image2,
@RequestPart(value = "image3", required = false) MultipartFile image3,
@RequestPart(value = "image4", required = false) MultipartFile image4,
@RequestPart(value = "image5", required = false) MultipartFile image5,
@RequestPart(value = "request") ResumePostRequest request
) throws IOException {
List<MultipartFile> images = Stream.of(image1, image2, image3, image4, image5)
.filter(Objects::nonNull)
.collect(Collectors.toList());
log.info("size = {}", images.size());
return ResponseEntity.ok(resumeService.postMyResume(memberId, images, request));
}

Expand All @@ -51,9 +62,16 @@ public ResponseEntity<ResumeGetResponse> getMyResume(
@PutMapping(value = "/my-resume", consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
public ResponseEntity<ResumePostPutResponse> putMyResume(
@AuthMember Long memberId,
@RequestPart(value = "images", required = false) List<MultipartFile> images,
@RequestPart(value = "image1", required = false) MultipartFile image1,
@RequestPart(value = "image2", required = false) MultipartFile image2,
@RequestPart(value = "image3", required = false) MultipartFile image3,
@RequestPart(value = "image4", required = false) MultipartFile image4,
@RequestPart(value = "image5", required = false) MultipartFile image5,
@RequestPart(value = "request") ResumePutRequest request
) throws IOException {
List<MultipartFile> images = Stream.of(image1, image2, image3, image4, image5)
.filter(Objects::nonNull)
.collect(Collectors.toList());
return ResponseEntity.ok(resumeService.putMyResume(memberId, images, request));
}

Expand Down

0 comments on commit eb28c40

Please sign in to comment.