Skip to content

Commit

Permalink
Merge pull request #206 from ssu-student-union/feat/204-get-major-col…
Browse files Browse the repository at this point in the history
…lege-list

[feat] #204 단과대 학과 조회 api 수정
  • Loading branch information
JangInho authored Feb 12, 2025
2 parents 954a23a + 733e9c2 commit a7648d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ public ResponseEntity<MyPostsResponse> getMyPostList(@Parameter(hidden = true) @
단과대 학과 리스트 조회하는 api입니다.
""")
@GetMapping("/colleges-departments")
public ResponseEntity<CollegeAndDepartmentResponse> getCollegeAndDepartmentList(@Parameter(hidden = true) @UserId Long userId) {
public ApiResponse<CollegeAndDepartmentResponse> getCollegeAndDepartmentList(@Parameter(hidden = true) @UserId Long userId) {
CollegeAndDepartmentResponse response = postManageService.getCollegeAndDepartment(userId);
return ResponseEntity.ok(response);
return ApiResponse.onSuccess(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,6 @@ public CollegeAndDepartmentResponse getCollegeAndDepartment(Long userId) {
"융합특성화자유전공학부"
);

return new CollegeAndDepartmentResponse(colleges, departments);
return CollegeAndDepartmentResponse.of(colleges, departments);
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
package ussum.homepage.application.user.service.dto.response;

import lombok.Builder;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.List;

@Builder
@RequiredArgsConstructor
@Getter
public class CollegeAndDepartmentResponse {
private final List<String> colleges;
private final List<String> departments;

public record CollegeAndDepartmentResponse(List<String> colleges, List<String> departments) {
public static CollegeAndDepartmentResponse of(List<String> colleges, List<String> departments) {
return CollegeAndDepartmentResponse.builder()
.colleges(colleges)
Expand Down

0 comments on commit a7648d1

Please sign in to comment.