-
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.
* Fix: 다른 기수 중복 지원을 위해 unique 제약 조건 제거 * Feat: 기수 저장을 위한 엔티티 생성 * Feat: 기수와 지원서 간 연관관계 작성 * Feat: 기수 레포지토리 작성 * Feat: 기수 DTO 작성 * Feat: 기수 서비스 작성 * Feat: 기수 컨트롤러 작성 * Feat: 기수 ErrorCode 작성 * Fix: 중복 제출 오류 코드를 좀더 명확하게 수정 * Feat: 지원서 403 에러코드 추가 * Feat: ClassYear 업데이트 편의 메서드 추가 * Refac: 에러코드를 명확하게 변경 * Feat: 지원서 작성 시 기수 정보도 요청 * Fix: 누락된 갱신 로직 적용 * Feat: 기수 정보를 포함해 지원서를 조회 * Fix: 기수 정보 단건 조회 방식 수정 * Fix: 잘못된 응답코드 수정 * Feat: 기수 - 지원서 간 연관관계 설정 * Feat: 조건별 서류 조회(필터링)에 기수 id 추가 * Fix: LocalDateTime 통신 형태 지정 * Fix: 잘못된 초기 지원 중복 체크 로직 수정 * Fix: 지원서 auto auditing 제거 * Fix: 지원서 - 프레젠테이션 계층 간 의존성 제거 * Feat: 예외 상황 추가 및 에러메시지 자세하게 수정 * Feat: 기수 예외처리 추가 * Test: 지원서 테스트에 기수 관련 로직 추가 및 수정 * Docs: 조건별 지원 서류 조회 스웨거 설명 추가 * Rename: ApplicationRequestDTO -> ApplicationModel * Fix: 고유 code로 수정 * Refac: 기수 관련 코드 분리 * Fix: 일관된 ErrorCode 사용 * Fix: 의미 없는 save 제거 * Fix: 객체 생성 방식 통일 * Fix: 테스트용 출력, 주석 삭제 * Docs: 분리한 기수 컨트롤러 스웨거 태그 추가
- Loading branch information
Showing
22 changed files
with
449 additions
and
72 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
55 changes: 55 additions & 0 deletions
55
src/main/java/com/gdsc_knu/official_homepage/controller/admin/AdminClassYearController.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,55 @@ | ||
package com.gdsc_knu.official_homepage.controller.admin; | ||
|
||
import com.gdsc_knu.official_homepage.dto.admin.application.AdminApplicationRequest; | ||
import com.gdsc_knu.official_homepage.dto.admin.application.AdminApplicationResponse; | ||
import com.gdsc_knu.official_homepage.service.admin.AdminClassYearService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@Tag(name = "Admin ClassYear", description = "기수 관리 관련 API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("api/admin/class-year") | ||
public class AdminClassYearController { | ||
private final AdminClassYearService classYearService; | ||
|
||
@GetMapping() | ||
@Operation(summary="기수 목록 조회 API", description = "기수 목록을 조회합니다.") | ||
public ResponseEntity<List<AdminApplicationResponse.ClassYearResponse>> getClassYearList() { | ||
return ResponseEntity.ok(classYearService.getClassYearList()); | ||
} | ||
|
||
@GetMapping("/{id}") | ||
@Operation(summary="기수 단건 조회 API", description = "기수를 단건 조회합니다.") | ||
public ResponseEntity<AdminApplicationResponse.ClassYearResponse> getClassYear(@PathVariable("id") Long id) { | ||
return ResponseEntity.ok(classYearService.getClassYear(id)); | ||
} | ||
|
||
@PostMapping() | ||
@Operation(summary="기수 추가 API", description = "기수를 추가합니다.") | ||
public ResponseEntity<Void> addClassYear(@RequestBody AdminApplicationRequest.ClassYearRequest classYearRequest) { | ||
classYearService.addClassYear(classYearRequest); | ||
return new ResponseEntity<>(HttpStatus.CREATED); | ||
} | ||
|
||
@PutMapping() | ||
@Operation(summary="기수 수정 API", description = "기수의 정보를 수정합니다.") | ||
public ResponseEntity<Void> updateClassYear(@RequestParam("id") Long id, | ||
@RequestBody AdminApplicationRequest.ClassYearRequest classYearRequest) { | ||
classYearService.updateClassYear(id, classYearRequest); | ||
return new ResponseEntity<>(HttpStatus.OK); | ||
} | ||
|
||
@DeleteMapping() | ||
@Operation(summary="기수 삭제 API", description = "기수를 삭제 합니다.") | ||
public ResponseEntity<Void> deleteClassYear(@RequestParam("id") Long id) { | ||
classYearService.deleteClassYear(id); | ||
return new ResponseEntity<>(HttpStatus.OK); | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/gdsc_knu/official_homepage/dto/application/ApplicationModel.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,30 @@ | ||
package com.gdsc_knu.official_homepage.dto.application; | ||
|
||
import com.gdsc_knu.official_homepage.entity.enumeration.ApplicationStatus; | ||
import com.gdsc_knu.official_homepage.entity.enumeration.Track; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
@NoArgsConstructor | ||
public class ApplicationModel { | ||
private String techStack; | ||
private String links; | ||
private ApplicationStatus applicationStatus; | ||
private Track track; | ||
private List<ApplicationAnswerDTO> answers; | ||
|
||
public ApplicationModel(ApplicationRequest applicationRequest) { | ||
this.techStack = applicationRequest.getTechStack(); | ||
this.links = applicationRequest.getLinks(); | ||
this.applicationStatus = applicationRequest.getApplicationStatus(); | ||
this.track = applicationRequest.getTrack(); | ||
this.answers = applicationRequest.getAnswers(); | ||
} | ||
} |
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/gdsc_knu/official_homepage/entity/ClassYear.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.gdsc_knu.official_homepage.entity; | ||
|
||
import com.gdsc_knu.official_homepage.entity.application.Application; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ClassYear { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(nullable = false, unique = true) | ||
private String name; | ||
|
||
@Column(nullable = false) | ||
private LocalDateTime applicationStartDateTime; | ||
|
||
@Column(nullable = false) | ||
private LocalDateTime applicationEndDateTime; | ||
|
||
public void update(String name, LocalDateTime applicationStartDateTime, LocalDateTime applicationEndDateTime) { | ||
this.name = name; | ||
this.applicationStartDateTime = applicationStartDateTime; | ||
this.applicationEndDateTime = applicationEndDateTime; | ||
} | ||
} |
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
Oops, something went wrong.