-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[fix] #11 applications 도메인 변경
- Loading branch information
Showing
27 changed files
with
347 additions
and
84 deletions.
There are no files selected for viewing
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,17 @@ | ||
## 1. 무슨 이유로 코드를 변경했나요? | ||
|
||
<br> | ||
|
||
## 2. 어떤 위험이나 장애를 발견했나요? | ||
|
||
<br> | ||
|
||
## 3. 관련 스크린샷을 첨부해주세요. | ||
|
||
<br> | ||
|
||
## 4. 완료 사항 | ||
|
||
<br> | ||
|
||
## 5. 추가 사항 |
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
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
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
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
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
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
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
7 changes: 0 additions & 7 deletions
7
src/main/java/land/leets/domain/application/usecase/HasInterview.java
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/main/java/land/leets/domain/application/usecase/HasInterviewImpl.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/main/java/land/leets/domain/interview/domain/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,36 @@ | ||
package land.leets.domain.interview.domain; | ||
|
||
import jakarta.persistence.*; | ||
import land.leets.domain.application.domain.Application; | ||
import land.leets.domain.interview.type.HasInterview; | ||
import land.leets.domain.shared.BaseTimeEntity; | ||
import lombok.*; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Entity(name = "interviews") | ||
@Builder | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
public class Interview extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@OneToOne | ||
private Application application; | ||
|
||
@Builder.Default | ||
@Column(columnDefinition = "char(10)") | ||
@Enumerated(EnumType.STRING) | ||
private HasInterview hasInterview = HasInterview.PENDING; | ||
|
||
@Column(nullable = false) | ||
private LocalDateTime fixedInterviewDate; | ||
|
||
@Column(nullable = false) | ||
private String place; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/land/leets/domain/interview/domain/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,13 @@ | ||
package land.leets.domain.interview.domain.repository; | ||
|
||
import land.leets.domain.application.domain.Application; | ||
import land.leets.domain.interview.domain.Interview; | ||
import land.leets.domain.user.domain.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface InterviewRepository extends JpaRepository<Interview, Long> { | ||
Optional<Interview> findByApplication_User(User user); | ||
Optional<Interview> findByApplication(Application application); | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/land/leets/domain/interview/presentation/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,49 @@ | ||
package land.leets.domain.interview.presentation; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
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 land.leets.domain.interview.domain.Interview; | ||
import land.leets.domain.interview.presentation.dto.req.FixedInterviewRequest; | ||
import land.leets.domain.interview.presentation.dto.req.InterviewAttendanceRequest; | ||
import land.leets.domain.interview.usecase.UpdateInterview; | ||
import land.leets.global.error.ErrorResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/interview") | ||
@Tag(name = "INTERVIEW") | ||
public class InterviewController { | ||
private final UpdateInterview updateInterview; | ||
|
||
@Operation(summary = "(유저) 면접 참여 여부 변경", description = "면접 참여 여부를 변경합니다.") | ||
@ApiResponses({ | ||
@ApiResponse(responseCode = "200"), | ||
@ApiResponse(responseCode = "400", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
}) | ||
@PostMapping() | ||
public Interview update(@RequestBody InterviewAttendanceRequest request) { | ||
return updateInterview.byUser(request); | ||
} | ||
|
||
@Operation(summary = "(관리자) 면접 정보 변경", description = "면접 정보를 변경합니다.") | ||
@ApiResponses({ | ||
@ApiResponse(responseCode = "200"), | ||
@ApiResponse(responseCode = "400", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "403", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))), | ||
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
}) | ||
@PostMapping("/{id}") | ||
public Interview update(@PathVariable Long id, @RequestBody FixedInterviewRequest request) { | ||
return updateInterview.byAdmin(id, request); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/land/leets/domain/interview/presentation/dto/req/FixedInterviewRequest.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,17 @@ | ||
package land.leets.domain.interview.presentation.dto.req; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class FixedInterviewRequest { | ||
@NotNull | ||
private LocalDateTime fixedInterviewDate; | ||
|
||
@NotNull | ||
private String place; | ||
} |
16 changes: 16 additions & 0 deletions
16
...ain/java/land/leets/domain/interview/presentation/dto/req/InterviewAttendanceRequest.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,16 @@ | ||
package land.leets.domain.interview.presentation.dto.req; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import land.leets.domain.interview.type.HasInterview; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class InterviewAttendanceRequest { | ||
@NotNull | ||
private String email; | ||
|
||
@NotNull | ||
private HasInterview hasInterview; | ||
} |
Oops, something went wrong.