-
Notifications
You must be signed in to change notification settings - Fork 1
V2 파일명 수정 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 파일명 수정 #39
Changes from all commits
e72c534
1dbbc56
b91f4a7
f19aa3d
7f9a50e
0c7cd50
dd851d2
c098a0c
2a7290c
fbca9f3
4e67e9e
a4eb0a9
e70e82b
9b7b803
00f3532
6f829d9
931b37c
cbd71ef
bd75fde
0165d50
14c8c57
f5d6eea
17ab978
a5704cb
c1f0134
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| package com.example.Jinus.controller.v2; | ||||||
| package com.example.Jinus.controller; | ||||||
|
|
||||||
| import com.example.Jinus.dto.request.RequestDto; | ||||||
| import com.example.Jinus.service.v2.cafeteria.DietServiceV2; | ||||||
| import com.example.Jinus.service.diet.DietService; | ||||||
| import lombok.RequiredArgsConstructor; | ||||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||||
|
|
@@ -11,8 +11,8 @@ | |||||
| @RestController | ||||||
| @RequestMapping("/api/spring") | ||||||
| @RequiredArgsConstructor | ||||||
| public class DietControllerV2 { | ||||||
| private final DietServiceV2 dietServiceV2; | ||||||
| public class DietController { | ||||||
| private final DietService dietServiceV2; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Field name inconsistent with field type The field type has been updated from - private final DietService dietServiceV2;
+ private final DietService dietService;📝 Committable suggestion
Suggested change
|
||||||
|
|
||||||
| @PostMapping("/v2/dish") | ||||||
| public String handleRequest(@RequestBody RequestDto requestDto) { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||||||||||
| package com.example.Jinus.controller.v2; | ||||||||||||||
| package com.example.Jinus.controller; | ||||||||||||||
|
|
||||||||||||||
| import com.example.Jinus.dto.request.RequestDto; | ||||||||||||||
| import com.example.Jinus.service.v2.notice.NoticeServiceV2; | ||||||||||||||
| import com.example.Jinus.service.v2.userInfo.DepartmentServiceV2; | ||||||||||||||
| import com.example.Jinus.service.v2.userInfo.UserServiceV2; | ||||||||||||||
| import com.example.Jinus.service.notice.NoticeService; | ||||||||||||||
| import com.example.Jinus.service.userInfo.DepartmentService; | ||||||||||||||
| import com.example.Jinus.service.userInfo.UserService; | ||||||||||||||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||||||||||||
|
|
@@ -15,11 +15,11 @@ | |||||||||||||
| @RestController | ||||||||||||||
| @RequiredArgsConstructor | ||||||||||||||
| @RequestMapping("/api/spring") | ||||||||||||||
| public class NoticeControllerV2 { | ||||||||||||||
| public class NoticeController { | ||||||||||||||
|
|
||||||||||||||
| private final NoticeServiceV2 noticeServiceV2; | ||||||||||||||
| private final DepartmentServiceV2 departmentServiceV2; | ||||||||||||||
| private final UserServiceV2 userServiceV2; | ||||||||||||||
| private final NoticeService noticeServiceV2; | ||||||||||||||
| private final DepartmentService departmentServiceV2; | ||||||||||||||
| private final UserService userServiceV2; | ||||||||||||||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Field names inconsistent with field types The field types have been updated to non-versioned classes, but the field names still contain V2 suffixes. This creates inconsistency between the type and name that might cause confusion. - private final NoticeService noticeServiceV2;
- private final DepartmentService departmentServiceV2;
- private final UserService userServiceV2;
+ private final NoticeService noticeService;
+ private final DepartmentService departmentService;
+ private final UserService userService;Make sure to update all references to these fields throughout the controller methods as well. 📝 Committable suggestion
Suggested change
|
||||||||||||||
| @Autowired | ||||||||||||||
| private ObjectMapper objectMapper; | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,15 +1,14 @@ | ||||||||||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||||||||||
| package com.example.Jinus.service.cafeteria; | ||||||||||||||
|
|
||||||||||||||
| import com.example.Jinus.config.RedisConfig; | ||||||||||||||
| import com.example.Jinus.dto.data.CafeteriaDto; | ||||||||||||||
| import com.example.Jinus.dto.data.DietDto; | ||||||||||||||
| import com.example.Jinus.dto.data.HandleRequestDto; | ||||||||||||||
| import com.example.Jinus.repository.v2.cafeteria.CafeteriaRepositoryV2; | ||||||||||||||
| import com.example.Jinus.repository.v2.cafeteria.DietRepositoryV2; | ||||||||||||||
| import com.example.Jinus.repository.cafeteria.CafeteriaRepository; | ||||||||||||||
| import com.example.Jinus.repository.cafeteria.DietRepository; | ||||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||||
| import lombok.extern.slf4j.Slf4j; | ||||||||||||||
| import org.springframework.cache.annotation.Cacheable; | ||||||||||||||
| import org.springframework.data.redis.core.RedisTemplate; | ||||||||||||||
| import org.springframework.stereotype.Service; | ||||||||||||||
|
|
||||||||||||||
| import java.sql.Date; | ||||||||||||||
|
|
@@ -20,9 +19,9 @@ | |||||||||||||
| @Service | ||||||||||||||
| @Slf4j | ||||||||||||||
| @RequiredArgsConstructor | ||||||||||||||
| public class CacheServiceV2 { | ||||||||||||||
| private final DietRepositoryV2 dietRepositoryV2; | ||||||||||||||
| private final CafeteriaRepositoryV2 cafeteriaRepositoryV2; | ||||||||||||||
| public class CacheService { | ||||||||||||||
| private final DietRepository dietRepositoryV2; | ||||||||||||||
| private final CafeteriaRepository cafeteriaRepositoryV2; | ||||||||||||||
|
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Inconsistent variable naming with imported types The class has been renamed from - private final DietRepository dietRepositoryV2;
- private final CafeteriaRepository cafeteriaRepositoryV2;
+ private final DietRepository dietRepository;
+ private final CafeteriaRepository cafeteriaRepository;This change should also be applied throughout the class where these fields are used. 📝 Committable suggestion
Suggested change
|
||||||||||||||
| private final RedisConfig redisConfig; | ||||||||||||||
|
|
||||||||||||||
| public List<DietDto> getDietList(HandleRequestDto parameters, int cafeteriaId) { | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||||||
| package com.example.Jinus.service.cafeteria; | ||||||||||
|
|
||||||||||
| import com.example.Jinus.repository.v2.cafeteria.CafeteriaRepositoryV2; | ||||||||||
| import com.example.Jinus.repository.cafeteria.CafeteriaRepository; | ||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||
| import lombok.extern.slf4j.Slf4j; | ||||||||||
| import org.springframework.cache.annotation.Cacheable; | ||||||||||
|
|
@@ -9,8 +9,8 @@ | |||||||||
| @Service | ||||||||||
| @RequiredArgsConstructor | ||||||||||
| @Slf4j | ||||||||||
| public class CafeteriaQueryServiceV2 { | ||||||||||
| private final CafeteriaRepositoryV2 cafeteriaRepositoryV2; | ||||||||||
| public class CafeteriaQueryService { | ||||||||||
| private final CafeteriaRepository cafeteriaRepositoryV2; | ||||||||||
|
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Inconsistent naming between class and field types vs. variable names The class has been renamed from public class CafeteriaQueryService {
- private final CafeteriaRepository cafeteriaRepositoryV2;
+ private final CafeteriaRepository cafeteriaRepository;📝 Committable suggestion
Suggested change
|
||||||||||
|
|
||||||||||
| @Cacheable( | ||||||||||
| value = "cafeteriaId", | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||||||||||||||
| package com.example.Jinus.service.cafeteria; | ||||||||||||||||||
|
|
||||||||||||||||||
| import com.example.Jinus.dto.data.CafeteriaDto; | ||||||||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||||||||
|
|
@@ -8,12 +8,12 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| @Service | ||||||||||||||||||
| @RequiredArgsConstructor | ||||||||||||||||||
| public class CafeteriaServiceV2 { | ||||||||||||||||||
| public class CafeteriaService { | ||||||||||||||||||
|
|
||||||||||||||||||
| private final CampusServiceV2 campusServiceV2; | ||||||||||||||||||
| private final CampusResponseServiceV2 campusResponseServiceV2; | ||||||||||||||||||
| private final CacheServiceV2 cacheServiceV2; | ||||||||||||||||||
| private final CafeteriaResponseServiceV2 cafeteriaResponseServiceV2; | ||||||||||||||||||
| private final CampusService campusServiceV2; | ||||||||||||||||||
| private final CampusResponseService campusResponseServiceV2; | ||||||||||||||||||
| private final CacheService cacheServiceV2; | ||||||||||||||||||
| private final CafeteriaResponseService cafeteriaResponseServiceV2; | ||||||||||||||||||
|
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update field names to match class naming pattern While the service types have been updated to remove the "V2" suffix, all field names still contain "V2". For consistency with the class naming changes, you should update all field names to remove the "V2" suffix. - private final CampusService campusServiceV2;
- private final CampusResponseService campusResponseServiceV2;
- private final CacheService cacheServiceV2;
- private final CafeteriaResponseService cafeteriaResponseServiceV2;
+ private final CampusService campusService;
+ private final CampusResponseService campusResponseService;
+ private final CacheService cacheService;
+ private final CafeteriaResponseService cafeteriaResponseService;Don't forget to update all references to these fields throughout the class methods. 📝 Committable suggestion
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| // 사용자가 선택한 블록 ID값에 따라 반환 조건 설정 | ||||||||||||||||||
| // campusId가 -1이면 사용자 정보가 존재하지 않는 경우임 | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package com.example.Jinus.service.v2.cafeteria; | ||
| package com.example.Jinus.service.cafeteria; | ||
|
|
||
| import com.example.Jinus.dto.response.ListItemDto; | ||
| import com.example.Jinus.dto.response.ResponseDto; | ||
|
|
@@ -15,9 +15,9 @@ | |
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class CampusResponseServiceV2 { | ||
| public class CampusResponseService { | ||
|
|
||
| private final CampusServiceV2 campusServiceV2; | ||
| private final CampusService campusServiceV2; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Field type updated but variable name still contains 'V2' While the type has been correctly updated from - private final CampusService campusServiceV2;
+ private final CampusService campusService;Additionally, you should update all references to this variable throughout the class (line 24).
|
||
|
|
||
| // 캠퍼스 리스트 반환 메소드 | ||
| public String makeCampusListCard() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||
| package com.example.Jinus.service.cafeteria; | ||||||
|
|
||||||
| import com.example.Jinus.entity.cafeteria.CampusEntity; | ||||||
| import com.example.Jinus.repository.v2.cafeteria.CampusRepositoryV2; | ||||||
| import com.example.Jinus.repository.cafeteria.CampusRepository; | ||||||
| import lombok.RequiredArgsConstructor; | ||||||
| import lombok.extern.slf4j.Slf4j; | ||||||
| import org.springframework.cache.annotation.Cacheable; | ||||||
|
|
@@ -12,8 +12,8 @@ | |||||
| @Service | ||||||
| @RequiredArgsConstructor | ||||||
| @Slf4j | ||||||
| public class CampusServiceV2 { | ||||||
| private final CampusRepositoryV2 campusRepositoryV2; | ||||||
| public class CampusService { | ||||||
| private final CampusRepository campusRepositoryV2; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Field name inconsistent with field type The field type has been updated from - private final CampusRepository campusRepositoryV2;
+ private final CampusRepository campusRepository;📝 Committable suggestion
Suggested change
|
||||||
|
|
||||||
| @Cacheable( | ||||||
| value = "campusId", | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,10 @@ | ||||||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||||||
| package com.example.Jinus.service.diet; | ||||||||||
|
|
||||||||||
| import com.example.Jinus.dto.data.HandleRequestDto; | ||||||||||
| import com.example.Jinus.dto.request.DetailParamsItemFieldDto; | ||||||||||
| import com.example.Jinus.dto.request.RequestDto; | ||||||||||
| import com.example.Jinus.service.v2.userInfo.UserServiceV2; | ||||||||||
| import com.example.Jinus.service.cafeteria.CampusService; | ||||||||||
| import com.example.Jinus.service.userInfo.UserService; | ||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||
| import lombok.extern.slf4j.Slf4j; | ||||||||||
| import org.springframework.stereotype.Service; | ||||||||||
|
|
@@ -16,10 +17,10 @@ | |||||||||
| @Service | ||||||||||
| @RequiredArgsConstructor | ||||||||||
| @Slf4j | ||||||||||
| public class DietParameterServiceV2 { | ||||||||||
| public class DietParameterService { | ||||||||||
|
|
||||||||||
| private final UserServiceV2 userServiceV2; | ||||||||||
| private final CampusServiceV2 campusServiceV2; | ||||||||||
| private final UserService userServiceV2; | ||||||||||
| private final CampusService campusServiceV2; | ||||||||||
|
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Inconsistent variable naming with imported types The class has been renamed from - private final UserService userServiceV2;
- private final CampusService campusServiceV2;
+ private final UserService userService;
+ private final CampusService campusService;📝 Committable suggestion
Suggested change
|
||||||||||
|
|
||||||||||
| // 요청 파라미터 객체 생성 | ||||||||||
| public HandleRequestDto setParameters(String kakaoId, LocalTime time, RequestDto requestDto) { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,26 +1,26 @@ | ||||||||||
| package com.example.Jinus.service.v2.cafeteria; | ||||||||||
| package com.example.Jinus.service.diet; | ||||||||||
|
|
||||||||||
| import com.example.Jinus.dto.data.DietDto; | ||||||||||
| import com.example.Jinus.dto.data.HandleRequestDto; | ||||||||||
| import com.example.Jinus.repository.v2.cafeteria.DietRepositoryV2; | ||||||||||
| import com.example.Jinus.repository.cafeteria.DietRepository; | ||||||||||
| import com.example.Jinus.service.cafeteria.CacheService; | ||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||
| import lombok.extern.slf4j.Slf4j; | ||||||||||
| import org.springframework.stereotype.Service; | ||||||||||
| import org.springframework.util.LinkedMultiValueMap; | ||||||||||
| import org.springframework.util.MultiValueMap; | ||||||||||
|
|
||||||||||
| import java.sql.Date; | ||||||||||
| import java.util.List; | ||||||||||
| import java.util.Set; | ||||||||||
| import java.util.TreeSet; | ||||||||||
|
|
||||||||||
| @Service | ||||||||||
| @RequiredArgsConstructor | ||||||||||
| @Slf4j | ||||||||||
| public class DietQueryServiceV2 { | ||||||||||
| public class DietQueryService { | ||||||||||
|
|
||||||||||
| private final CacheServiceV2 cacheServiceV2; | ||||||||||
| private final DietRepositoryV2 dietRepositoryV2; | ||||||||||
| private final CacheService cacheServiceV2; | ||||||||||
| private final DietRepository dietRepositoryV2; | ||||||||||
|
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Inconsistent variable naming with imported types The class has been renamed from - private final CacheService cacheServiceV2;
- private final DietRepository dietRepositoryV2;
+ private final CacheService cacheService;
+ private final DietRepository dietRepository;📝 Committable suggestion
Suggested change
|
||||||||||
|
|
||||||||||
| // 메뉴 존재 여부에 따른 반환값 처리 로직 | ||||||||||
| public String getDietResponse(HandleRequestDto parameters, int cafeteriaId) { | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update variable names to match their types.
The service field types have been updated to remove the V2 suffix, but the variable names still contain "V2" (
userServiceV2andcafeteriaServiceV2). For better consistency and readability, consider updating the variable names as well:Don't forget to update all references to these variables throughout the class.
📝 Committable suggestion