-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from potenday-project/develop
면접 시작 관련 로직 추가
- Loading branch information
Showing
28 changed files
with
980 additions
and
23 deletions.
There are no files selected for viewing
Submodule server_config
updated
from 9d8e8c to 8ebfd1
61 changes: 61 additions & 0 deletions
61
src/main/generated/com/chwipoClova/interview/entity/QInterview.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.chwipoClova.interview.entity; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.processing.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QInterview is a Querydsl query type for Interview | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEntitySerializer") | ||
public class QInterview extends EntityPathBase<Interview> { | ||
|
||
private static final long serialVersionUID = 1729798915L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QInterview interview = new QInterview("interview"); | ||
|
||
public final NumberPath<Long> interviewId = createNumber("interviewId", Long.class); | ||
|
||
public final DateTimePath<java.util.Date> modifyDate = createDateTime("modifyDate", java.util.Date.class); | ||
|
||
public final StringPath recruitSummary = createString("recruitSummary"); | ||
|
||
public final DateTimePath<java.util.Date> regDate = createDateTime("regDate", java.util.Date.class); | ||
|
||
public final StringPath resumeSummary = createString("resumeSummary"); | ||
|
||
public final StringPath title = createString("title"); | ||
|
||
public final com.chwipoClova.user.entity.QUser user; | ||
|
||
public QInterview(String variable) { | ||
this(Interview.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QInterview(Path<? extends Interview> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QInterview(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QInterview(PathMetadata metadata, PathInits inits) { | ||
this(Interview.class, metadata, inits); | ||
} | ||
|
||
public QInterview(Class<? extends Interview> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.user = inits.isInitialized("user") ? new com.chwipoClova.user.entity.QUser(forProperty("user")) : null; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.chwipoClova.qa.entity; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.processing.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QQa is a Querydsl query type for Qa | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEntitySerializer") | ||
public class QQa extends EntityPathBase<Qa> { | ||
|
||
private static final long serialVersionUID = 24461021L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QQa qa = new QQa("qa"); | ||
|
||
public final StringPath aiAnswer = createString("aiAnswer"); | ||
|
||
public final StringPath answer = createString("answer"); | ||
|
||
public final com.chwipoClova.interview.entity.QInterview interview; | ||
|
||
public final DateTimePath<java.util.Date> modifyDate = createDateTime("modifyDate", java.util.Date.class); | ||
|
||
public final NumberPath<Long> qaId = createNumber("qaId", Long.class); | ||
|
||
public final StringPath question = createString("question"); | ||
|
||
public final DateTimePath<java.util.Date> regDate = createDateTime("regDate", java.util.Date.class); | ||
|
||
public QQa(String variable) { | ||
this(Qa.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QQa(Path<? extends Qa> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QQa(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QQa(PathMetadata metadata, PathInits inits) { | ||
this(Qa.class, metadata, inits); | ||
} | ||
|
||
public QQa(Class<? extends Qa> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.interview = inits.isInitialized("interview") ? new com.chwipoClova.interview.entity.QInterview(forProperty("interview"), inits.get("interview")) : null; | ||
} | ||
|
||
} | ||
|
67 changes: 67 additions & 0 deletions
67
src/main/generated/com/chwipoClova/recruit/entity/QRecruit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.chwipoClova.recruit.entity; | ||
|
||
import static com.querydsl.core.types.PathMetadataFactory.*; | ||
|
||
import com.querydsl.core.types.dsl.*; | ||
|
||
import com.querydsl.core.types.PathMetadata; | ||
import javax.annotation.processing.Generated; | ||
import com.querydsl.core.types.Path; | ||
import com.querydsl.core.types.dsl.PathInits; | ||
|
||
|
||
/** | ||
* QRecruit is a Querydsl query type for Recruit | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEntitySerializer") | ||
public class QRecruit extends EntityPathBase<Recruit> { | ||
|
||
private static final long serialVersionUID = 1252659683L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QRecruit recruit = new QRecruit("recruit"); | ||
|
||
public final StringPath content = createString("content"); | ||
|
||
public final StringPath fileName = createString("fileName"); | ||
|
||
public final StringPath filePath = createString("filePath"); | ||
|
||
public final NumberPath<Long> fileSize = createNumber("fileSize", Long.class); | ||
|
||
public final StringPath originalFileName = createString("originalFileName"); | ||
|
||
public final NumberPath<Long> recruitId = createNumber("recruitId", Long.class); | ||
|
||
public final DateTimePath<java.util.Date> regDate = createDateTime("regDate", java.util.Date.class); | ||
|
||
public final StringPath summary = createString("summary"); | ||
|
||
public final StringPath title = createString("title"); | ||
|
||
public final com.chwipoClova.user.entity.QUser user; | ||
|
||
public QRecruit(String variable) { | ||
this(Recruit.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QRecruit(Path<? extends Recruit> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QRecruit(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QRecruit(PathMetadata metadata, PathInits inits) { | ||
this(Recruit.class, metadata, inits); | ||
} | ||
|
||
public QRecruit(Class<? extends Recruit> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.user = inits.isInitialized("user") ? new com.chwipoClova.user.entity.QUser(forProperty("user")) : null; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/chwipoClova/common/config/MultipartJackson2HttpMessageConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.chwipoClova.common.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
@Component | ||
public class MultipartJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter { | ||
|
||
/** | ||
* Converter for support http request with header Content-Type: multipart/form-data | ||
*/ | ||
public MultipartJackson2HttpMessageConverter(ObjectMapper objectMapper) { | ||
super(objectMapper, MediaType.APPLICATION_OCTET_STREAM); | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected boolean canWrite(MediaType mediaType) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/chwipoClova/interview/controller/InterviewController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.chwipoClova.interview.controller; | ||
|
||
import com.chwipoClova.interview.request.InterviewInsertReq; | ||
import com.chwipoClova.interview.response.InterviewInsertRes; | ||
import com.chwipoClova.interview.service.InterviewService; | ||
import com.chwipoClova.resume.response.ResumeUploadRes; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Encoding; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@Tag(name = "Interview", description = "면접 API") | ||
@RequestMapping("interview") | ||
public class InterviewController { | ||
|
||
private final InterviewService interviewService; | ||
|
||
@Operation(summary = "면접 등록", description = "면접 등록") | ||
@PostMapping(path = "/insertInterview", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.APPLICATION_JSON_VALUE}) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "OK") | ||
} | ||
) | ||
public InterviewInsertRes insertInterview( | ||
@RequestPart(value = "interviewData") InterviewInsertReq interviewInsertReq, | ||
@RequestPart(value = "file", required = false) MultipartFile file | ||
) throws Exception { | ||
return interviewService.insertInterview(interviewInsertReq, file); | ||
} | ||
|
||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/com/chwipoClova/interview/entity/Interview.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.chwipoClova.interview.entity; | ||
|
||
import com.chwipoClova.user.entity.User; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicInsert; | ||
|
||
import java.util.Date; | ||
|
||
@Entity(name = "Interview") | ||
@Table(name = "Interview") | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonIgnoreProperties() | ||
@DynamicInsert | ||
@Builder | ||
@Getter | ||
@ToString | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Interview { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "interviewId") | ||
@Schema(description = "면접ID") | ||
private Long interviewId; | ||
|
||
@Column(name = "title") | ||
@Schema(description = "제목") | ||
private String title; | ||
|
||
@Column(name = "resumeSummary") | ||
@Schema(description = "이력서 요약") | ||
private String resumeSummary; | ||
|
||
@Column(name = "recruitSummary") | ||
@Schema(description = "채용공고 요약") | ||
private String recruitSummary; | ||
|
||
@Column(name = "regDate") | ||
@Schema(description = "등록일") | ||
private Date regDate; | ||
|
||
@Column(name = "modifyDate") | ||
@Schema(description = "수정일") | ||
private Date modifyDate; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "userId") | ||
private User user; | ||
|
||
// @PrePersist 메서드 정의 (최초 등록시 호출) | ||
@PrePersist | ||
public void prePersist() { | ||
this.regDate = new Date(); // 현재 날짜와 시간으로 등록일 설정 | ||
} | ||
|
||
// @PreUpdate 메서드 정의 (업데이트 시 호출) | ||
@PreUpdate | ||
public void preUpdate() { | ||
this.modifyDate = new Date(); // 현재 날짜와 시간으로 수정일 업데이트 | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/chwipoClova/interview/repository/InterviewRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.chwipoClova.interview.repository; | ||
|
||
import com.chwipoClova.interview.entity.Interview; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface InterviewRepository extends JpaRepository<Interview, Long> { | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/chwipoClova/interview/request/InterviewInsertReq.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.chwipoClova.interview.request; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class InterviewInsertReq { | ||
|
||
@Schema(description = "유저 ID", example = "1", name = "userId") | ||
private Long userId; | ||
|
||
@Schema(description = "이력서 ID", example = "1", name = "resumeId") | ||
private Long resumeId; | ||
|
||
@Schema(description = "채용공고내용", example = "삼성채용", name = "recruitContent") | ||
private String recruitContent; | ||
|
||
} |
Oops, something went wrong.