-
Notifications
You must be signed in to change notification settings - Fork 4
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 #20 from kahluaband/feat/admin-apply
#17 Feat: make admin-apply list & detail function
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/kahlua/KahluaProject/controller/AdminController.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,32 @@ | ||
package kahlua.KahluaProject.controller; | ||
|
||
import kahlua.KahluaProject.apipayload.ApiResponse; | ||
import kahlua.KahluaProject.dto.response.ApplyGetResponse; | ||
import kahlua.KahluaProject.dto.response.ApplyListResponse; | ||
import kahlua.KahluaProject.service.ApplyService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/v1/admin") | ||
public class AdminController { | ||
|
||
|
||
private final ApplyService applyService; | ||
|
||
@GetMapping("/apply") | ||
public ApiResponse<ApplyListResponse> getApplyList() { | ||
ApplyListResponse applyListResponse = applyService.getApplyList(); | ||
return ApiResponse.onSuccess(applyListResponse); | ||
} | ||
|
||
@GetMapping("/apply/{applyId}") | ||
public ApiResponse<ApplyGetResponse> getApplyDetail(@PathVariable Long applyId) { | ||
ApplyGetResponse applyGetResponse = applyService.getApply(applyId); | ||
return ApiResponse.onSuccess(applyGetResponse); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/kahlua/KahluaProject/dto/response/ApplyItemResponse.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,28 @@ | ||
package kahlua.KahluaProject.dto.response; | ||
|
||
import kahlua.KahluaProject.domain.apply.Gender; | ||
import kahlua.KahluaProject.domain.apply.Major; | ||
import kahlua.KahluaProject.domain.apply.Preference; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class ApplyItemResponse { | ||
|
||
private Long id; | ||
private String name; | ||
private String phone_num; | ||
private String birth_date; | ||
|
||
private Gender gender; | ||
|
||
private String address; | ||
|
||
private Major major; | ||
|
||
private Preference first_preference; | ||
private Preference second_preference; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/kahlua/KahluaProject/dto/response/ApplyListResponse.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 kahlua.KahluaProject.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class ApplyListResponse<T> { | ||
|
||
private T applies; | ||
} |
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