Skip to content

Commit

Permalink
fix : swagger request 요청 값 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hanseu9839 committed Jan 11, 2025
1 parent 4069784 commit 444ebcc
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import darkoverload.itzip.global.config.response.code.CommonResponseCode;
import darkoverload.itzip.global.config.swagger.ExceptionCodeAnnotations;
import darkoverload.itzip.global.config.swagger.ResponseCodeAnnotation;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,124 +20,35 @@
@Setter
public class CreateResumeRequest {

@Schema(description = "수상 리스트", example = """
{
"achievements": [
{
"name": "Hackathon Winner",
"organization": "Global Hackathon 2024",
"achievementDate": "2024-11-27T05:51:54.050Z",
"content": "Developed an award-winning AI-powered application."
}
]
}
""")
@Schema(description = "수상 리스트")
@ResumeConditional
private List<AchievementDto> achievements = new ArrayList<>();

@Schema(description = "자격증 리스트", example = """
{
"qualifications": [
{
"organization": "Oracle",
"qualificationDate": "2020-08-15T00:00:00.000Z",
"name": "Oracle Certified Professional",
"score": 95
}
]
}
""")
@Schema(description = "자격증 리스트")
@ResumeConditional
private List<QualificationDto> qualifications = new ArrayList<>();

@Schema(description = "기술 스택 리스트", example = """
{
"mySkills": [
{
"name": "Java"
}
]
}
""")
@Schema(description = "기술 스택 리스트")
@ResumeConditional
private List<MySkillsDto> mySkills = new ArrayList<>();

@Schema(description = "대외 활동 리스트", example = """
{
"activities": [
{
"name": "Open Source Contribution",
"content": "Contributed to Apache Kafka project.",
"startDate": "2023-01-01T00:00:00.000Z",
"endDate": "2023-12-31T23:59:59.999Z"
}
]
}
""")
@Schema(description = "대외 활동 리스트")
@ResumeConditional
private List<ActivityDto> activities = new ArrayList<>(); // activity ==> save

@Schema(description = "경력 정보 리스트", example = """
{
"careers": [
{
"companyName": "TechCorp",
"careerPosition": "Senior Software Engineer",
"department": "Backend Development",
"startDate": "2020-01-01T00:00:00.000Z",
"endDate": "2023-11-27T05:51:54.050Z"
}
]
}
""")
@Schema(description = "경력 정보 리스트")
@ResumeConditional
private List<CareerDto> careers = new ArrayList<>(); // ==> save

@Schema(description = "학력 정보 리스트", example = """
{
"educations": [
{
"schoolName": "Itzip University",
"major": "Software Engineering",
"startDate": "2016-03-01T00:00:00.000Z",
"endDate": "2020-02-29T23:59:59.999Z"
}
]
}
""")
@Schema(description = "학력 정보 리스트")
@ResumeConditional
private List<EducationDto> educations = new ArrayList<>(); //

@Schema(description = "언어 자격증 리스트", example = """
{
"languages": [
{
"name": "English",
"score": "TOEIC 900",
"acquisitionDate": "2022-10-01T00:00:00.000Z"
}
]
}
""")
@Schema(description = "언어 자격증 리스트")
@ResumeConditional
private List<LanguageDto> languages = new ArrayList<>();

@Schema(description = "이력서 정보", example = """
{
"email": "user@example.com",
"phone": "+821012345678",
"subject": "Software Engineer Resume",
"introduction": "Experienced software engineer specializing in backend development.",
"publicOnOff": "YES",
"links": [
"https://github.com/user",
"https://linkedin.com/in/user"
],
"fileUrls": ["https://example.com"],
"imageUrl": "https://example.com/profile.jpg",
"userId": 123
}
""")
@Schema(description = "이력서 정보")
private ResumeDto resume;

@Schema(description = "유저 아이디", example = "1")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.achievement;

import darkoverload.itzip.feature.resume.domain.achievement.Achievement;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -15,19 +16,24 @@ public class AchievementDto {


// 수상명
@Schema(description = "수상 이름", example = "Hackathon Winner")
private String name;

// 수상기관
@Schema(description = "수상 조직", example = "Global Hackathon 2024")
private String organization;

// 수상일
@Schema(description = "수상 날짜", example = "2024-11-27T05:51:54.050Z")
private LocalDateTime achievementDate;

// 설명
@Size(max = 255, message = "내용을 255 글자 이상 입력 할 수 없습니다.")
@Schema(description = "내용", example = "Developed an award-winning AI-powered application.")
private String content;

// id 값
@Schema(description = "수상 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long achievementId;

public AchievementDto(String name, String organization, LocalDateTime achievementDate, String content) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.activity;

import darkoverload.itzip.feature.resume.domain.activity.Activity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -15,18 +16,23 @@
public class ActivityDto {

// 활동명
@Schema(description = "활동 이름", example = "Open Source Contribution")
private String name;

// 내용
@Schema(description = "활동 내용", example = "Contributed to Apache Kafka project.")
private String content;

// 시작일
@Schema(description = "시작 날짜", example = "2023-01-01T00:00:00.000Z")
private LocalDateTime startDate;

// 종료일
@Schema(description = "종료 날짜", example = "2023-12-31T23:59:59.999Z")
private LocalDateTime endDate;

// 아이디
@Schema(description = "활동 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long activityId;

public ActivityDto(String name, String content, LocalDateTime startDate, LocalDateTime endDate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.career;

import darkoverload.itzip.feature.resume.domain.career.Career;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDateTime;
Expand All @@ -13,21 +14,27 @@
public class CareerDto {

// 회사명
@Schema(description = "회사 이름", example = "TechCorp")
private String companyName;

// 직책
@Schema(description = "직급", example = "Senior Software Engineer")
private String careerPosition;

// 부서
@Schema(description = "부서", example = "Backend Development")
private String department;

// 입사일
@Schema(description = "시작 날짜", example = "2020-01-01T00:00:00.000Z")
private LocalDateTime startDate;

// 퇴사일
@Schema(description = "종료 날짜", example = "2023-11-27T05:51:54.050Z")
private LocalDateTime endDate;

// 아이디
@Schema(description = "경력 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long careerId;

public CareerDto(String companyName, String careerPosition, String department, LocalDateTime startDate, LocalDateTime endDate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package darkoverload.itzip.feature.resume.dto.education;

import darkoverload.itzip.feature.resume.domain.education.Education;
import lombok.AllArgsConstructor;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
Expand All @@ -14,18 +14,23 @@
public class EducationDto {

// 학교명
@Schema(description = "학교 이름", example = "Itzip University")
private String schoolName;

// 전공
@Schema(description = "전공", example = "Software Engineering")
private String major;

// 입학일
@Schema(description = "시작 날짜", example = "2016-03-01T00:00:00.000Z")
private LocalDateTime startDate;

// 졸업일
@Schema(description = "종료 날짜", example = "2020-02-29T23:59:59.999Z")
private LocalDateTime endDate;

// 아이디
@Schema(description = "학교 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long educationId;

public EducationDto(String schoolName, String major, LocalDateTime startDate, LocalDateTime endDate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.language;

import darkoverload.itzip.feature.resume.domain.language.Language;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -15,15 +16,19 @@
public class LanguageDto {

// 어학시험명
@Schema(description = "언어 이름", example = "English")
private String name;

// 점수
@Schema(description = "점수", example = "TOEIC 900")
private String score;

// 취득일
@Schema(description = "취득 날짜", example = "2022-10-01T00:00:00.000Z")
private LocalDateTime acquisitionDate;

// 아이디
@Schema(description = "언어 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long languageId;

public LanguageDto(String name, String score, LocalDateTime acquisitionDate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.myskill;

import darkoverload.itzip.feature.resume.domain.myskill.MySkill;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -13,9 +14,11 @@
public class MySkillsDto {

// 이름
@Schema(description = "기술 이름", example = "Java")
private String name;

// 아이디
@Schema(description = "기술 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long mySkillId;

public MySkill toModel() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.qualification;

import darkoverload.itzip.feature.resume.domain.qualification.Qualification;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -15,15 +16,19 @@
public class QualificationDto {

// 발급기관
@Schema(description = "발급 기관", example = "Oracle")
private String organization;

// 취득일
@Schema(description = "발급 날짜", example = "2020-08-15T00:00:00.000Z")
private LocalDateTime qualificationDate;

// 자격증명
@Schema(description = "자격증 이름", example = "Oracle Certified Professional")
private String name;

// 아이디
@Schema(description = "자격증 아이디 값", example = "이력서 생성 시 제외 업데이트 시 추가해서 사용")
private Long qualificationId;

public QualificationDto(String organization, LocalDateTime qualificationDate, String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package darkoverload.itzip.feature.resume.dto.resume;

import darkoverload.itzip.feature.resume.code.PublicOnOff;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
Expand All @@ -15,31 +16,39 @@ public class ResumeDto {
// 이메일
@Pattern(regexp = "^[0-9a-zA-Z]([-_\\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\\.]?[0-9a-zA-Z])*\\.[a-zA-Z]{2,3}$",
message = "올바르지 않은 이메일 형식입니다.")
@Schema(description = "이메일", example = "user@example.com")
private String email;

// 핸드폰
@Pattern(regexp= "/^(01[0-9])-?\\d{3,4}-?\\d{4}$/", message="올바르지 않은 번호입니다.")
@Schema(description = "전화번호", example = "+821012345678")
private String phone;

// 제목
@NotNull(message="제목을 입력해주세요.")
@Schema(description = "제목", example = "Software Engineer Resume")
private String subject;

// 소개글
@NotNull(message="소개글은 필수 입력입니다.")
@Schema(description = "자기소개", example = "Experienced software engineer specializing in backend development.")
private String introduction;

// 공개여부
@NotNull(message="공개 여부는 필수 입력입니다.")
@Schema(description = "공개 여부", example = "YES")
private PublicOnOff publicOnOff;

// 링크
@Schema(description = "링크 목록", example = "[\"https://github.com/user\", \"https://linkedin.com/in/user\"]")
private List<String> links;

// 이미지
@Schema(description = "프로필 이미지 URL", example = "https://example.com/profile.jpg")
private String imageUrl;

// 파일 경로
@Schema(description = "파일 URL 목록", example = "[\"https://example.com\"]")
private List<String> fileUrls;

private int scrapCount;
Expand Down
Loading

0 comments on commit 444ebcc

Please sign in to comment.