Skip to content

Commit

Permalink
Feat : 이력서 내보내기 API 구현
Browse files Browse the repository at this point in the history
- 이력서 내보내기 기능을 위한 데이터 조회 로직 추가
  • Loading branch information
hyeonda02 committed Nov 29, 2024
1 parent 271d450 commit 1987ea5
Show file tree
Hide file tree
Showing 21 changed files with 207 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package umc.kkijuk.server.career.controller.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import umc.kkijuk.server.career.domain.Activity;
import umc.kkijuk.server.detail.controller.response.BaseCareerDetailResponse;
Expand All @@ -22,8 +23,12 @@ public class ActivityResponse implements BaseCareerResponse{
private String alias;
private Boolean unknown;
private String summary;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private LocalDate startdate;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private LocalDate enddate;

private String organizer;
private String role;
private int teamSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ActivityReqDto {
@NotBlank(message = "활동명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/career/dto/CircleReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

//동아리
@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class CircleReqDto {
@NotBlank(message = "활동명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

//공모전, 대회
@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class CompetitionReqDto {
@NotBlank(message = "대회명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

Expand All @@ -16,6 +17,7 @@
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class EduCareerReqDto {
@NotBlank(message = "교육명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import umc.kkijuk.server.career.domain.JobType;

import java.time.LocalDate;

@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class EmploymentReqDto {
@NotBlank(message = "활동명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/career/dto/ProjectReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import umc.kkijuk.server.career.domain.ProjectType;

import java.time.LocalDate;

@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class ProjectReqDto {
@NotBlank(message = "활동명은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.java.Log;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -19,7 +20,7 @@
@Tag(name = "record", description = "이력서 API")
@RestController
@RequiredArgsConstructor
@RequestMapping("/history/resume/")
@RequestMapping("/history/resume")
public class RecordController {
private final RecordService recordService;
private final MemberService memberService;
Expand Down Expand Up @@ -61,6 +62,21 @@ public ResponseEntity<Object> update(
.body(new BaseResponse<>(HttpStatus.OK.value(), "이력서 수정 완료", recordResponse));
}

@GetMapping("/download")
@Operation(
summary = "이력서 내보내기",
description = "이력서 내보내기에 필요한 정보들을 조회합니다."
)
public ResponseEntity<Object> downloadResume(
@Login LoginInfo loginInfo ){
Long memberId = loginInfo.getMemberId();
RecordDownResponse response = recordService.downloadResume(recordService.findByMemberId(memberId).getId(),memberId);
return ResponseEntity.status(HttpStatus.OK)
.body(new BaseResponse<>(HttpStatus.OK.value(),"이력서 내보내기 정보 조회 완료",response));

}


@PostMapping("/education")
@Operation(summary = "학력 생성")
public ResponseEntity<Object> saveEducation(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package umc.kkijuk.server.record.controller.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import umc.kkijuk.server.member.domain.Member;
import umc.kkijuk.server.record.domain.Record;

import java.time.LocalDate;
import java.util.List;

@Data
@Getter
@Builder
@AllArgsConstructor
public class RecordDownResponse {
private String address;
private String profileImageUrl;

private List<EducationResponse> educationList;

private List<ResumeResponse> activitiesAndExperiences;
private List<ResumeResponse> employments;
private List<ResumeResponse> projects;
private List<ResumeResponse> eduCareers;

private List<AwardResponse> awards;
private List<LicenseResponse> licenses;
private List<SkillResponse> skills;
private List<FileResponse> files;

private String name;
private LocalDate birthday;
private String phone;
private String email;

public RecordDownResponse(Record record, Member member,
List<EducationResponse> educationList, List<ResumeResponse> employments, List<ResumeResponse> activitiesAndExperiences,
List<ResumeResponse> projectsAndComp, List<ResumeResponse> eduCareers, List<AwardResponse> awards,
List<LicenseResponse> licenses, List<SkillResponse> skills, List<FileResponse> files) {

this.address = record.getAddress();
this.profileImageUrl=record.getProfileImageUrl();

this.educationList=educationList;
this.employments = employments;
this.activitiesAndExperiences = activitiesAndExperiences;
this.projects = projectsAndComp;
this.eduCareers = eduCareers;

this.awards = awards;
this.licenses = licenses;
this.skills = skills;
this.files = files;

this.name = member.getName();
this.birthday=member.getBirthDate();
this.phone=member.getPhoneNumber();
this.email=member.getEmail();

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,6 @@ public class RecordResponse {
private String phone;
private String email;

// 이력서 없을 때
// @Builder
// public RecordResponse(Member member,
// List<RecordListResponse> activitiesAndExperiences,
// List<RecordListResponse> jobs) {
// this.activitiesAndExperiences=activitiesAndExperiences;
// this.jobs=jobs;
// this.name = member.getName();
// this.birthday=member.getBirthDate();
// this.phone=member.getPhoneNumber();
// this.email=member.getEmail();
// }

// 이력서 있을 때
// @Builder
// public RecordResponse(Record record, Member member, List<EducationResponse> educationList,
// List<RecordListResponse> activitiesAndExperiences,
// List<RecordListResponse> jobs) {
// this.record_id=record.getId();
// this.address = record.getAddress();
// this.profileImageUrl=record.getProfileImageUrl();
// this.educationList=educationList;
// this.activitiesAndExperiences=activitiesAndExperiences;
// this.jobs=jobs;
// this.name = member.getName();
// this.birthday=member.getBirthDate();
// this.phone=member.getPhoneNumber();
// this.email=member.getEmail();
// this.updatedAt = formatUpdatedAt(record.getUpdatedAt());
// }

// 이력서 있을 때
@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package umc.kkijuk.server.record.controller.response;

import lombok.*;

import java.time.LocalDate;

@Data
@Getter
@Setter
@Builder
@AllArgsConstructor
public class ResumeResponse {
private Long id;
private String category;
private String name;
private String alias;
private String summary;
private LocalDate startdate;
private LocalDate enddate;

}
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/record/dto/AwardReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.YearMonth;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AwardReqDto {
private String competitionName;
private String administer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.YearMonth;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class EducationReqDto {
private String category;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/record/dto/FileReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FileReqDto {
@NotBlank(message = "첨부파일 제목은 필수 입력 항목입니다. 최대 20자 까지 입력 가능")
@Size(max = 20)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/record/dto/LicenseReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import umc.kkijuk.server.record.domain.LicenseTag;

import java.time.YearMonth;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class LicenseReqDto {
private LicenseTag licenseTag;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/umc/kkijuk/server/record/dto/RecordReqDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class RecordReqDto {
private String address;
Expand Down
Loading

0 comments on commit 1987ea5

Please sign in to comment.