-
Notifications
You must be signed in to change notification settings - Fork 1
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 #181 from CEOS-Developers/feat/availability
[feat] 면접 참여 및 활동 가능 여부 확인 기능
- Loading branch information
Showing
16 changed files
with
476 additions
and
15 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/ceos/backend/domain/application/dto/response/GetFinalAvailability.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,26 @@ | ||
package ceos.backend.domain.application.dto.response; | ||
|
||
import ceos.backend.domain.application.domain.Application; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class GetFinalAvailability { | ||
private boolean finalAvailability; // 활동 가능 여부 | ||
private String reason; // 활동 불가능 사유 | ||
|
||
@Builder | ||
public GetFinalAvailability(boolean finalCheck, String reason) { | ||
this.finalAvailability = finalCheck; | ||
this.reason = reason; | ||
} | ||
|
||
public static GetFinalAvailability of(Application application) { | ||
return GetFinalAvailability.builder() | ||
.finalAvailability(application.isFinalCheck()) | ||
.reason(application.getUnableReason()) | ||
.build(); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/ceos/backend/domain/application/dto/response/GetInterviewAvailability.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,25 @@ | ||
package ceos.backend.domain.application.dto.response; | ||
|
||
import ceos.backend.domain.application.domain.Application; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class GetInterviewAvailability { | ||
private boolean interviewAvailability; // 참여 가능 여부 | ||
private String reason; // 참여 불가능 사유 | ||
|
||
@Builder | ||
public GetInterviewAvailability(boolean interviewCheck, String reason) { | ||
this.interviewAvailability = interviewCheck; | ||
this.reason = reason; | ||
} | ||
|
||
public static GetInterviewAvailability of(Application application) { | ||
return GetInterviewAvailability.builder() | ||
.interviewAvailability(application.isInterviewCheck()) | ||
.reason(application.getUnableReason()) | ||
.build(); | ||
} | ||
} |
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
68 changes: 68 additions & 0 deletions
68
src/main/java/ceos/backend/domain/startup/StartupController.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,68 @@ | ||
package ceos.backend.domain.startup; | ||
|
||
import ceos.backend.domain.startup.dto.request.StartupRequest; | ||
import ceos.backend.domain.startup.dto.response.StartupResponse; | ||
import ceos.backend.domain.startup.dto.response.StartupsResponse; | ||
import ceos.backend.domain.startup.service.StartupService; | ||
import ceos.backend.global.common.dto.AwsS3Url; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping(value = "/start-ups") | ||
@Tag(name = "Start-Up") | ||
public class StartupController { | ||
|
||
private final StartupService startupService; | ||
|
||
@Operation(summary = "창업 리스트 추가") | ||
@PostMapping | ||
public void createStartup(@RequestBody @Valid StartupRequest startupRequest) { | ||
log.info("창업 리스트 추가"); | ||
startupService.createStartup(startupRequest); | ||
} | ||
|
||
@Operation(summary = "창업 리스트 보기") | ||
@GetMapping | ||
public StartupsResponse getStartups( | ||
@RequestParam("pageNum") Integer pageNum, @RequestParam("limit") Integer limit) { | ||
log.info("창업 리스트 보기"); | ||
return startupService.getStartups(pageNum, limit); | ||
} | ||
|
||
@Operation(summary = "창업 리스트 상세 보기") | ||
@GetMapping(value = "/{startupId}") | ||
public StartupResponse getStartup(@PathVariable("startupId") Long startupId) { | ||
log.info("창업 리스트 상세 보기"); | ||
return startupService.getStartup(startupId); | ||
} | ||
|
||
@Operation(summary = "창업 리스트 수정") | ||
@PatchMapping(value = "/{startupId}") | ||
public StartupResponse updateStartup(@PathVariable("startupId") Long startupId, | ||
@RequestBody @Valid StartupRequest startupRequest) { | ||
log.info("창업 리스트 수정"); | ||
return startupService.updateStartup(startupId, startupRequest); | ||
} | ||
|
||
@Operation(summary = "창업 리스트 삭제") | ||
@DeleteMapping("/{startupId}") | ||
public void deleteManagement(@PathVariable(name = "startupId") Long startupId) { | ||
log.info("창업 리스트 삭제"); | ||
startupService.deleteStartup(startupId); | ||
} | ||
|
||
@Operation(summary = "서비스 이미지 url 생성하기") | ||
@GetMapping("/image") | ||
public AwsS3Url getImageUrl() { | ||
log.info("서비스 이미지 url 생성하기"); | ||
return startupService.getImageUrl(); | ||
} | ||
|
||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/ceos/backend/domain/startup/domain/Startup.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,58 @@ | ||
package ceos.backend.domain.startup.domain; | ||
|
||
import ceos.backend.domain.startup.dto.request.StartupRequest; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
public class Startup { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "startup_id") | ||
private Long id; | ||
|
||
@NotBlank | ||
private String serviceName; | ||
|
||
private String companyName; | ||
|
||
@NotBlank | ||
private String imageUrl; | ||
|
||
@NotBlank | ||
private String serviceUrl; | ||
|
||
@NotNull | ||
private Integer generation; | ||
|
||
@NotBlank | ||
private String founder; | ||
|
||
@Builder | ||
public Startup(String serviceName, String companyName, String imageUrl, String serviceUrl, Integer generation, String founder) { | ||
this.serviceName = serviceName; | ||
this.companyName = companyName; | ||
this.imageUrl = imageUrl; | ||
this.serviceUrl = serviceUrl; | ||
this.generation = generation; | ||
this.founder = founder; | ||
} | ||
|
||
public void update(StartupRequest startupRequest) { | ||
this.serviceName = startupRequest.getServiceName(); | ||
this.companyName = startupRequest.getCompanyName(); | ||
this.imageUrl = startupRequest.getImageUrl(); | ||
this.serviceUrl = startupRequest.getServiceUrl(); | ||
this.generation = startupRequest.getGeneration(); | ||
this.founder = startupRequest.getFounder(); | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/ceos/backend/domain/startup/dto/request/StartupRequest.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,46 @@ | ||
package ceos.backend.domain.startup.dto.request; | ||
|
||
import ceos.backend.domain.startup.domain.Startup; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class StartupRequest { | ||
|
||
@NotBlank | ||
@Schema(defaultValue = "Repick",description = "서비스명") | ||
private String serviceName; | ||
|
||
@Schema(defaultValue = "(주)Repick",description = "회사명(생략가능)") | ||
private String companyName; | ||
|
||
@NotBlank | ||
@Schema(description = "서비스 이미지 url") | ||
private String imageUrl; | ||
|
||
@NotBlank | ||
@Schema(description = "서비스 url") | ||
private String serviceUrl; | ||
|
||
@NotNull | ||
@Schema(defaultValue = "17", description = "창업자 활동 기수") | ||
private Integer generation; | ||
|
||
@NotBlank | ||
@Schema(defaultValue = "이도현", description = "창업자 이름") | ||
private String founder; | ||
|
||
public Startup toEntity() { | ||
return Startup.builder() | ||
.serviceName(serviceName) | ||
.companyName(companyName) | ||
.imageUrl(imageUrl) | ||
.serviceUrl(serviceUrl) | ||
.generation(generation) | ||
.founder(founder) | ||
.build(); | ||
} | ||
|
||
} |
Oops, something went wrong.