Skip to content

Commit c78d80a

Browse files
authored
Merge pull request #109 from prgrms-web-devcourse-final-project/feature/EA3-74-calender-api
[EA3-132] refactor : 클래스 및 필드명 수정
2 parents 9ee00c1 + 6582ae2 commit c78d80a

File tree

14 files changed

+159
-163
lines changed

14 files changed

+159
-163
lines changed
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
package grep.neogul_coder.domain.calender.controller;
22

3-
import grep.neogul_coder.domain.calender.controller.dto.requset.PersonalCalenderRequest;
4-
import grep.neogul_coder.domain.calender.controller.dto.response.PersonalCalenderResponse;
3+
import grep.neogul_coder.domain.calender.controller.dto.requset.PersonalCalendarRequest;
4+
import grep.neogul_coder.domain.calender.controller.dto.response.PersonalCalendarResponse;
55
import grep.neogul_coder.global.response.ApiResponse;
66

77
import java.util.List;
88
import org.springframework.web.bind.annotation.*;
99

1010
@RestController
1111
@RequestMapping("/api/users/{userId}/calendar")
12-
public class PersonalCalenderController implements PersonalCalenderSpecification {
12+
public class PersonalCalendarController implements PersonalCalendarSpecification {
1313

1414
@PostMapping
1515
public ApiResponse<Void> create(
1616
@PathVariable("userId") Long userId,
17-
@RequestBody PersonalCalenderRequest request) {
17+
@RequestBody PersonalCalendarRequest request) {
1818
return ApiResponse.noContent();
1919
}
2020

2121
@GetMapping
22-
public ApiResponse<List<PersonalCalenderResponse>> findAll(@PathVariable("userId") Long userId) {
23-
return ApiResponse.success(List.of(new PersonalCalenderResponse()));
22+
public ApiResponse<List<PersonalCalendarResponse>> findAll(@PathVariable("userId") Long userId) {
23+
return ApiResponse.success(List.of(new PersonalCalendarResponse()));
2424
}
2525

2626

27-
@GetMapping("/{scheduleId}")
28-
public ApiResponse<PersonalCalenderResponse> findOne(
27+
@GetMapping("/{calendarId}")
28+
public ApiResponse<PersonalCalendarResponse> findOne(
2929
@PathVariable("userId") Long userId,
30-
@PathVariable("scheduleId") Long scheduleId
30+
@PathVariable("calendarId") Long calendarId
3131
) {
32-
return ApiResponse.success(new PersonalCalenderResponse());
32+
return ApiResponse.success(new PersonalCalendarResponse());
3333
}
3434
@GetMapping("/day")
35-
public ApiResponse<List<PersonalCalenderResponse>> findByDate(
35+
public ApiResponse<List<PersonalCalendarResponse>> findByDate(
3636
@PathVariable("userId") Long userId,
3737
@RequestParam String date
3838
) {
39-
return ApiResponse.success(List.of(new PersonalCalenderResponse()));
39+
return ApiResponse.success(List.of(new PersonalCalendarResponse()));
4040
}
4141

42-
@PutMapping("/{scheduleId}")
42+
@PutMapping("/{calendarId}")
4343
public ApiResponse<Void> update(
4444
@PathVariable("userId") Long userId,
45-
@PathVariable("scheduleId") Long scheduleId,
46-
@RequestBody PersonalCalenderRequest request
45+
@PathVariable("calendarId") Long calendarId,
46+
@RequestBody PersonalCalendarRequest request
4747
) {
4848
return ApiResponse.noContent();
4949
}
5050

51-
@DeleteMapping("/{scheduleId}")
51+
@DeleteMapping("/{calendarId}")
5252
public ApiResponse<Void> delete(
5353
@PathVariable("userId") Long userId,
54-
@PathVariable("scheduleId") Long scheduleId
54+
@PathVariable("calendarId") Long calendarId
5555
) {
5656
return ApiResponse.noContent();
5757
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package grep.neogul_coder.domain.calender.controller;
22

3-
import grep.neogul_coder.domain.calender.controller.dto.requset.PersonalCalenderRequest;
4-
import grep.neogul_coder.domain.calender.controller.dto.response.PersonalCalenderResponse;
3+
import grep.neogul_coder.domain.calender.controller.dto.requset.PersonalCalendarRequest;
4+
import grep.neogul_coder.domain.calender.controller.dto.response.PersonalCalendarResponse;
55
import grep.neogul_coder.global.response.ApiResponse;
66
import io.swagger.v3.oas.annotations.Operation;
77
import io.swagger.v3.oas.annotations.Parameter;
@@ -14,7 +14,7 @@
1414
import org.springframework.web.bind.annotation.RequestParam;
1515

1616
@Tag(name = "개인 캘린더", description = "개인 캘린더 API (Swagger 인터페이스)")
17-
public interface PersonalCalenderSpecification {
17+
public interface PersonalCalendarSpecification {
1818

1919
@Operation(
2020
summary = "개인 일정 생성",
@@ -23,36 +23,36 @@ public interface PersonalCalenderSpecification {
2323
ApiResponse<Void> create(
2424
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
2525
@PathVariable("userId") Long userId,
26-
@RequestBody PersonalCalenderRequest request
26+
@RequestBody PersonalCalendarRequest request
2727
);
2828

2929
@Operation(
3030
summary = "개인 일정 전체 조회",
3131
description = "사용자 ID 기준으로 모든 개인 일정을 조회합니다.\n\n예: `/api/users/{userId}/calendar`"
3232
)
33-
ApiResponse<List<PersonalCalenderResponse>> findAll(
33+
ApiResponse<List<PersonalCalendarResponse>> findAll(
3434
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
3535
@PathVariable("userId") Long userId
3636
);
3737

3838
@Operation(
3939
summary = "개인 일정 상세 조회",
40-
description = "사용자의 특정 일정 상세정보를 조회합니다.\n\n예: `/api/users/{userId}/calendar/{scheduleId}`"
40+
description = "사용자의 특정 일정 상세정보를 조회합니다.\n\n예: `/api/users/{userId}/calendar/{calendarId}`"
4141
)
42-
ApiResponse<PersonalCalenderResponse> findOne(
42+
ApiResponse<PersonalCalendarResponse> findOne(
4343
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
4444
@PathVariable("userId") Long userId,
4545

46-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
47-
@PathVariable("scheduleId") Long scheduleId
46+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
47+
@PathVariable("calendarId") Long calendarId
4848
);
4949

5050
@Operation(
5151
summary = "개인 일정 날짜별 조회",
5252
description = "특정 사용자 ID와 날짜에 해당하는 모든 개인 일정을 조회합니다.\n\n" +
5353
"예: `/api/users/{userId}/calendar/day?date=2025-07-17`"
5454
)
55-
ApiResponse<List<PersonalCalenderResponse>> findByDate(
55+
ApiResponse<List<PersonalCalendarResponse>> findByDate(
5656
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
5757
@PathVariable("userId") Long userId,
5858

@@ -63,27 +63,27 @@ ApiResponse<List<PersonalCalenderResponse>> findByDate(
6363

6464
@Operation(
6565
summary = "개인 일정 수정",
66-
description = "사용자의 특정 일정을 수정합니다.\n\n예: `/api/users/{userId}/calendar/{scheduleId}`"
66+
description = "사용자의 특정 일정을 수정합니다.\n\n예: `/api/users/{userId}/calendar/{calendarId}`"
6767
)
6868
ApiResponse<Void> update(
6969
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
7070
@PathVariable("userId") Long userId,
7171

72-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
73-
@PathVariable("scheduleId") Long scheduleId,
72+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
73+
@PathVariable("calendarId") Long calendarId,
7474

75-
@RequestBody PersonalCalenderRequest request
75+
@RequestBody PersonalCalendarRequest request
7676
);
7777

7878
@Operation(
7979
summary = "개인 일정 삭제",
80-
description = "사용자의 특정 일정을 삭제합니다.\n\n예: `/api/users/{userId}/calendar/{scheduleId}`"
80+
description = "사용자의 특정 일정을 삭제합니다.\n\n예: `/api/users/{userId}/calendar/{calendarId}`"
8181
)
8282
ApiResponse<Void> delete(
8383
@Parameter(name = "userId", description = "사용자 ID", required = true, in = ParameterIn.PATH)
8484
@PathVariable("userId") Long userId,
8585

86-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
87-
@PathVariable("scheduleId") Long scheduleId
86+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
87+
@PathVariable("calendarId") Long calendarId
8888
);
8989
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package grep.neogul_coder.domain.calender.controller;
2+
3+
import grep.neogul_coder.domain.calender.controller.dto.requset.TeamCalendarRequest;
4+
import grep.neogul_coder.domain.calender.controller.dto.response.TeamCalendarResponse;
5+
import grep.neogul_coder.global.response.ApiResponse;
6+
7+
import org.springframework.web.bind.annotation.*;
8+
9+
import java.util.List;
10+
11+
@RestController
12+
@RequestMapping("/api/teams/{studyId}/calendar")
13+
public class TeamCalendarController implements TeamCalendarSpecification {
14+
15+
@PostMapping
16+
public ApiResponse<Void> create(@PathVariable("studyId") Long studyId, @RequestBody TeamCalendarRequest request) {
17+
return ApiResponse.noContent();
18+
}
19+
20+
@GetMapping
21+
public ApiResponse<List<TeamCalendarResponse>> findAll(@PathVariable("studyId") Long studyId) {
22+
return ApiResponse.success(List.of(new TeamCalendarResponse()));
23+
}
24+
25+
@GetMapping("/{calendarId}")
26+
public ApiResponse<TeamCalendarResponse> findOne(
27+
@PathVariable("studyId") Long studyId,
28+
@PathVariable("calendarId") Long calendarId
29+
) {
30+
return ApiResponse.success(new TeamCalendarResponse());
31+
}
32+
33+
34+
@GetMapping("/day")
35+
public ApiResponse<List<TeamCalendarResponse>> findByDate(
36+
@PathVariable("studyId") Long studyId,
37+
@RequestParam String date
38+
) {
39+
return ApiResponse.success(List.of(new TeamCalendarResponse()));
40+
}
41+
42+
@PutMapping("/{calendarId}")
43+
public ApiResponse<Void> update(
44+
@PathVariable("studyId") Long studyId,
45+
@PathVariable("calendarId") Long calendarId,
46+
@RequestBody TeamCalendarRequest request
47+
) {
48+
return ApiResponse.noContent();
49+
}
50+
51+
@DeleteMapping("/{calendarId}")
52+
public ApiResponse<Void> delete(
53+
@PathVariable("studyId") Long studyId,
54+
@PathVariable("calendarId") Long calendarId
55+
) {
56+
return ApiResponse.noContent();
57+
}
58+
}
59+
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package grep.neogul_coder.domain.calender.controller;
22

3-
import grep.neogul_coder.domain.calender.controller.dto.requset.TeamCalenderRequest;
4-
import grep.neogul_coder.domain.calender.controller.dto.response.TeamCalenderResponse;
3+
import grep.neogul_coder.domain.calender.controller.dto.requset.TeamCalendarRequest;
4+
import grep.neogul_coder.domain.calender.controller.dto.response.TeamCalendarResponse;
55
import grep.neogul_coder.global.response.ApiResponse;
66
import io.swagger.v3.oas.annotations.Operation;
77
import io.swagger.v3.oas.annotations.Parameter;
@@ -14,40 +14,40 @@
1414
import org.springframework.web.bind.annotation.RequestParam;
1515

1616
@Tag(name = "팀 캘린더", description = "팀 캘린더 API (Swagger 인터페이스)")
17-
public interface TeamCalenderSpecification {
17+
public interface TeamCalendarSpecification {
1818

1919
@Operation(
2020
summary = "팀 일정 전체 조회",
2121
description = "특정 팀 ID에 해당하는 모든 일정을 조회합니다.\n\n" +
22-
"예: `/api/teams/{teamId}/calendar`"
22+
"예: `/api/teams/{studyId}/calendar`"
2323
)
24-
ApiResponse<List<TeamCalenderResponse>> findAll(
25-
@Parameter(name = "teamId", description = "조회할 팀 ID", required = true, in = ParameterIn.PATH)
26-
@PathVariable("teamId") Long teamId
24+
ApiResponse<List<TeamCalendarResponse>> findAll(
25+
@Parameter(name = "studyId", description = "조회할 팀 ID", required = true, in = ParameterIn.PATH)
26+
@PathVariable("studyId") Long studyId
2727
);
2828

2929

3030
@Operation(
3131
summary = "팀 일정 상세 조회",
3232
description = "특정 팀의 특정 일정 상세정보를 조회합니다.\n\n" +
33-
"예: `/api/teams/{teamId}/calendar/{scheduleId}`"
33+
"예: `/api/teams/{studyId}/calendar/{calendarId}`"
3434
)
35-
ApiResponse<TeamCalenderResponse> findOne(
36-
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
37-
@PathVariable("teamId") Long teamId,
38-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
39-
@PathVariable("scheduleId") Long scheduleId
35+
ApiResponse<TeamCalendarResponse> findOne(
36+
@Parameter(name = "studyId", description = "팀 ID", required = true, in = ParameterIn.PATH)
37+
@PathVariable("studyId") Long studyId,
38+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
39+
@PathVariable("calendarId") Long calendarId
4040
);
4141

4242

4343
@Operation(
4444
summary = "팀 일정 날짜별 조회",
4545
description = "특정 팀의 특정 날짜(yyyy-MM-dd)에 등록된 일정들을 조회합니다.\n\n" +
46-
"예: `/api/teams/{teamId}/calendar/day?date=2025-07-17`"
46+
"예: `/api/teams/{studyId}/calendar/day?date=2025-07-17`"
4747
)
48-
ApiResponse<List<TeamCalenderResponse>> findByDate(
49-
@Parameter(name = "teamId", description = "조회할 팀 ID", required = true, in = ParameterIn.PATH)
50-
@PathVariable("teamId") Long teamId,
48+
ApiResponse<List<TeamCalendarResponse>> findByDate(
49+
@Parameter(name = "studyId", description = "조회할 팀 ID", required = true, in = ParameterIn.PATH)
50+
@PathVariable("studyId") Long studyId,
5151

5252
@Parameter(name = "date", description = "조회할 날짜 (yyyy-MM-dd)", required = true, in = ParameterIn.QUERY)
5353
@RequestParam String date
@@ -57,36 +57,36 @@ ApiResponse<List<TeamCalenderResponse>> findByDate(
5757
@Operation(
5858
summary = "팀 일정 생성",
5959
description = "특정 팀 ID에 새로운 일정을 생성합니다.\n\n" +
60-
"예: `/api/teams/{teamId}/calendar`"
60+
"예: `/api/teams/{studyId}/calendar`"
6161
)
6262
ApiResponse<Void> create(
63-
@Parameter(name = "teamId", description = "일정을 생성할 팀 ID", required = true, in = ParameterIn.PATH)
64-
@PathVariable("teamId") Long teamId,
65-
@RequestBody TeamCalenderRequest request
63+
@Parameter(name = "studyId", description = "일정을 생성할 팀 ID", required = true, in = ParameterIn.PATH)
64+
@PathVariable("studyId") Long studyId,
65+
@RequestBody TeamCalendarRequest request
6666
);
6767

6868
@Operation(
6969
summary = "팀 일정 수정",
7070
description = "기존 팀 일정을 수정합니다.\n\n" +
71-
"예: `/api/teams/{teamId}/calendar/{scheduleId}`"
71+
"예: `/api/teams/{studyId}/calendar/{calendarId}`"
7272
)
7373
ApiResponse<Void> update(
74-
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
75-
@PathVariable("teamId") Long teamId,
76-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
77-
@PathVariable("scheduleId") Long scheduleId,
78-
@RequestBody TeamCalenderRequest request
74+
@Parameter(name = "studyId", description = "팀 ID", required = true, in = ParameterIn.PATH)
75+
@PathVariable("studyId") Long studyId,
76+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
77+
@PathVariable("calendarId") Long calendarId,
78+
@RequestBody TeamCalendarRequest request
7979
);
8080

8181
@Operation(
8282
summary = "팀 일정 삭제",
8383
description = "기존 팀 일정을 삭제합니다.\n\n" +
84-
"예: `/api/teams/{teamId}/calendar/{scheduleId}`"
84+
"예: `/api/teams/{studyId}/calendar/{calendarId}`"
8585
)
8686
ApiResponse<Void> delete(
87-
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
88-
@PathVariable("teamId") Long teamId,
89-
@Parameter(name = "scheduleId", description = "일정 ID", required = true, in = ParameterIn.PATH)
90-
@PathVariable("scheduleId") Long scheduleId
87+
@Parameter(name = "studyId", description = "팀 ID", required = true, in = ParameterIn.PATH)
88+
@PathVariable("studyId") Long studyId,
89+
@Parameter(name = "calendarId", description = "일정 ID", required = true, in = ParameterIn.PATH)
90+
@PathVariable("calendarId") Long calendarId
9191
);
9292
}

0 commit comments

Comments
 (0)