Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e72c534
[Fix]Test 코드 수정
hykim02 Mar 24, 2025
1dbbc56
[Fix]public 접근지정자 private으로 변경(캡슐화)
hykim02 Mar 26, 2025
b91f4a7
[Refactor]CafeteriaServiceV2 단일 책임 원칙 적용하여 클래스 분리
hykim02 Mar 27, 2025
f19aa3d
Update Java CI-CD.yml
hykim02 Mar 27, 2025
7f9a50e
merge conflict 해결
hykim02 Mar 27, 2025
0c7cd50
merge conflict 해결 중
hykim02 Mar 27, 2025
dd851d2
[Refactor]CampusServiceV2 클래스 분리
hykim02 Mar 27, 2025
c098a0c
merge conflict
hykim02 Mar 27, 2025
2a7290c
Merge branch 'main' of https://github.com/GNU-connect/Server-JavaSpring
hykim02 Mar 27, 2025
fbca9f3
[Refactor]DietServiceV2 서비스 클래스 분리
hykim02 Mar 27, 2025
4e67e9e
merge
hykim02 Apr 16, 2025
a4eb0a9
[fix]caheable 주석 처리 - 잠깐 보류
hykim02 Apr 17, 2025
e70e82b
[fix]Cafeteria Cacheable 주석처리
hykim02 Apr 17, 2025
9b7b803
Merge branch 'main' into main
hykim02 Apr 17, 2025
00f3532
[Refactor]캐시 적용 및 중복로직 최적화
hykim02 Apr 17, 2025
6f829d9
[Refactor]캐시 적용 및 중복 로직 최적화
hykim02 Apr 17, 2025
931b37c
Merge remote-tracking branch 'origin/main'
hykim02 Apr 17, 2025
cbd71ef
[fix]userService에서 발생한 hikariCP connection error 찾는 중
hykim02 Apr 21, 2025
bd75fde
Merge branch 'main' into main
hykim02 Apr 21, 2025
0165d50
[Test]HikariCP 멀티스레드 환경 테슽
hykim02 Apr 21, 2025
14c8c57
[Fix]conflict 해결
hykim02 Apr 21, 2025
f5d6eea
Merge branch 'GNU-connect:main' into main
hykim02 Apr 21, 2025
17ab978
merge 충돌
hykim02 Apr 21, 2025
a5704cb
[Fix]파일명 수정
hykim02 May 7, 2025
c1f0134
[Fix]파일명 수정
hykim02 May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +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.cafeteria.CafeteriaServiceV2;
import com.example.Jinus.service.v2.userInfo.UserServiceV2;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.example.Jinus.service.cafeteria.CafeteriaService;
import com.example.Jinus.service.userInfo.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -15,10 +12,10 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/spring")
public class CafeteriaControllerV2 {
public class CafeteriaController {

private final UserServiceV2 userServiceV2;
private final CafeteriaServiceV2 cafeteriaServiceV2;
private final UserService userServiceV2;
private final CafeteriaService cafeteriaServiceV2;
Comment on lines +17 to +18
Copy link

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" (userServiceV2 and cafeteriaServiceV2). For better consistency and readability, consider updating the variable names as well:

-    private final UserService userServiceV2;
-    private final CafeteriaService cafeteriaServiceV2;
+    private final UserService userService;
+    private final CafeteriaService cafeteriaService;

Don't forget to update all references to these variables throughout the class.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final UserService userServiceV2;
private final CafeteriaService cafeteriaServiceV2;
private final UserService userService;
private final CafeteriaService cafeteriaService;


// 사용자 존재 여부에 따라 응답
@PostMapping("/v2/cafeteria")
Expand Down
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;
Expand All @@ -11,8 +11,8 @@
@RestController
@RequestMapping("/api/spring")
@RequiredArgsConstructor
public class DietControllerV2 {
private final DietServiceV2 dietServiceV2;
public class DietController {
private final DietService dietServiceV2;
Copy link

Choose a reason for hiding this comment

The 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 DietServiceV2 to DietService, but the field name still contains the V2 suffix. Consider updating the field name to match its type for consistency.

-    private final DietService dietServiceV2;
+    private final DietService dietService;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final DietService dietServiceV2;
private final DietService dietService;


@PostMapping("/v2/dish")
public String handleRequest(@RequestBody RequestDto requestDto) {
Expand Down
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;
Expand All @@ -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
Copy link

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final NoticeService noticeServiceV2;
private final DepartmentService departmentServiceV2;
private final UserService userServiceV2;
private final NoticeService noticeService;
private final DepartmentService departmentService;
private final UserService userService;

@Autowired
private ObjectMapper objectMapper;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.example.Jinus.repository.v2.cafeteria;
package com.example.Jinus.repository.cafeteria;

import com.example.Jinus.dto.data.CafeteriaDto;
import com.example.Jinus.entity.cafeteria.CafeteriaEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Optional;

public interface CafeteriaRepositoryV2 extends JpaRepository<CafeteriaEntity, Integer> {
public interface CafeteriaRepository extends JpaRepository<CafeteriaEntity, Integer> {
// 사용자 campusId와 동일한 식당이름과 url 찾기
@Query(
"SELECT new com.example.Jinus.dto.data.CafeteriaDto(c.cafeteriaNameKo, c.thumbnailUrl) " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.cafeteria;
package com.example.Jinus.repository.cafeteria;

import com.example.Jinus.entity.cafeteria.CampusEntity;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -9,7 +9,7 @@
import java.util.List;

@Repository
public interface CampusRepositoryV2 extends JpaRepository<CampusEntity, Integer> {
public interface CampusRepository extends JpaRepository<CampusEntity, Integer> {
// 사용자 campusId로 캠퍼스 이름 찾기
@Query("SELECT c.campusNameKo FROM CampusEntity c WHERE c.id = :campusId")
String findCampusNameByCampusId(@Param("campusId") int campusId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.cafeteria;
package com.example.Jinus.repository.cafeteria;

import com.example.Jinus.dto.data.DietDto;
import com.example.Jinus.entity.cafeteria.CafeteriaDietEntity;
Expand All @@ -11,7 +11,7 @@
import java.util.List;

@Repository
public interface DietRepositoryV2 extends JpaRepository<CafeteriaDietEntity, Integer> {
public interface DietRepository extends JpaRepository<CafeteriaDietEntity, Integer> {
@Query("SELECT new com.example.Jinus.dto.data.DietDto(c.dishCategory, c.dishName, c.dishType) " +
"FROM CafeteriaDietEntity c " +
"WHERE c.dietDate = :dietDate " +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.notice;
package com.example.Jinus.repository.notice;

import com.example.Jinus.entity.notice.NoticeCategoryEntity;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -7,7 +7,7 @@

import java.util.List;

public interface CategoryRepositoryV2 extends JpaRepository<NoticeCategoryEntity, Integer> {
public interface CategoryRepository extends JpaRepository<NoticeCategoryEntity, Integer> {
@Query("SELECT n FROM NoticeCategoryEntity n" +
" WHERE n.departmentId = :departmentId AND n.lastNttSn != 0")
List<NoticeCategoryEntity> findCategoryListByDepartmentId(@Param("departmentId")int departmentId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.notice;
package com.example.Jinus.repository.notice;

import com.example.Jinus.entity.notice.NoticeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -7,7 +7,7 @@

import java.util.List;

public interface NoticeRepositoryV2 extends JpaRepository<NoticeEntity, Integer> {
public interface NoticeRepository extends JpaRepository<NoticeEntity, Integer> {
@Query("SELECT n FROM NoticeEntity n WHERE n.categoryId = :categoryId " +
"ORDER BY n.createdAt DESC LIMIT 4")
List<NoticeEntity> findNoticeListByCategoryId(@Param("categoryId")int categoryId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.userInfo;
package com.example.Jinus.repository.userInfo;

import com.example.Jinus.entity.userInfo.DepartmentEntity;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -7,7 +7,7 @@
import org.springframework.stereotype.Repository;

@Repository
public interface DepartmentRepositoryV2 extends JpaRepository<DepartmentEntity, Integer> {
public interface DepartmentRepository extends JpaRepository<DepartmentEntity, Integer> {
// 학과 영문명 찾기
@Query("SELECT d.departmentEn FROM DepartmentEntity d WHERE d.id = :id")
String findDepartmentEngById(@Param("id")Integer id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.Jinus.repository.v2.userInfo;
package com.example.Jinus.repository.userInfo;

import com.example.Jinus.entity.userInfo.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -9,7 +9,7 @@
import java.util.Optional;

@Repository
public interface UserRepositoryV2 extends JpaRepository<UserEntity, String> {
public interface UserRepository extends JpaRepository<UserEntity, String> {
// 사용자 등록여부 확인(존재한다면 campusId 찾기)
@Query("SELECT u.campusId FROM UserEntity u WHERE u.kakaoId = :kakaoId")
Optional<Integer> findCampusIdById(@Param("kakaoId") String id);
Expand Down
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;
Expand All @@ -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
Copy link

Choose a reason for hiding this comment

The 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 CacheServiceV2 to CacheService and the imports have been updated to use non-V2 repository types, but the variable names still contain "V2" suffixes. This creates a mismatch between the type and the variable name.

-    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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public class CacheService {
private final DietRepository dietRepositoryV2;
private final CafeteriaRepository cafeteriaRepositoryV2;
public class CacheService {
private final DietRepository dietRepository;
private final CafeteriaRepository cafeteriaRepository;

private final RedisConfig redisConfig;

public List<DietDto> getDietList(HandleRequestDto parameters, int cafeteriaId) {
Expand Down
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;
Expand All @@ -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
Copy link

Choose a reason for hiding this comment

The 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 CafeteriaQueryServiceV2 to CafeteriaQueryService and imports updated to use non-V2 classes, but the repository field name still uses the V2 suffix which creates inconsistency.

public class CafeteriaQueryService {
-    private final CafeteriaRepository cafeteriaRepositoryV2;
+    private final CafeteriaRepository cafeteriaRepository;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public class CafeteriaQueryService {
private final CafeteriaRepository cafeteriaRepositoryV2;
public class CafeteriaQueryService {
private final CafeteriaRepository cafeteriaRepository;


@Cacheable(
value = "cafeteriaId",
Expand Down
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 com.example.Jinus.dto.response.ButtonDto;
Expand All @@ -16,7 +16,7 @@

@Service
@RequiredArgsConstructor
public class CafeteriaResponseServiceV2 {
public class CafeteriaResponseService {

// 식당 리스트 카드 생성
public String createCafeteriaListCard(String campusName, List<CafeteriaDto> cafeteriaList) {
Expand Down
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;
Expand All @@ -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
Copy link

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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;


// 사용자가 선택한 블록 ID값에 따라 반환 조건 설정
// campusId가 -1이면 사용자 정보가 존재하지 않는 경우임
Expand Down
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;
Expand All @@ -15,9 +15,9 @@

@Service
@RequiredArgsConstructor
public class CampusResponseServiceV2 {
public class CampusResponseService {

private final CampusServiceV2 campusServiceV2;
private final CampusService campusServiceV2;
Copy link

Choose a reason for hiding this comment

The 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 CampusServiceV2 to CampusService, the variable name campusServiceV2 still contains the V2 suffix, which is inconsistent with the naming changes made to the classes.

-    private final CampusService campusServiceV2;
+    private final CampusService campusService;

Additionally, you should update all references to this variable throughout the class (line 24).

Committable suggestion skipped: line range outside the PR's diff.


// 캠퍼스 리스트 반환 메소드
public String makeCampusListCard() {
Expand Down
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;
Expand All @@ -12,8 +12,8 @@
@Service
@RequiredArgsConstructor
@Slf4j
public class CampusServiceV2 {
private final CampusRepositoryV2 campusRepositoryV2;
public class CampusService {
private final CampusRepository campusRepositoryV2;
Copy link

Choose a reason for hiding this comment

The 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 CampusRepositoryV2 to CampusRepository, but the field name still contains the V2 suffix. Consider updating the field name to match the updated type for consistency throughout the codebase.

-    private final CampusRepository campusRepositoryV2;
+    private final CampusRepository campusRepository;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final CampusRepository campusRepositoryV2;
private final CampusRepository campusRepository;


@Cacheable(
value = "campusId",
Expand Down
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;
Expand All @@ -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
Copy link

Choose a reason for hiding this comment

The 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 DietParameterServiceV2 to DietParameterService and imports have been updated to use non-V2 service types, but the variable names still contain "V2" suffixes.

-    private final UserService userServiceV2;
-    private final CampusService campusServiceV2;
+    private final UserService userService;
+    private final CampusService campusService;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final UserService userServiceV2;
private final CampusService campusServiceV2;
private final UserService userService;
private final CampusService campusService;


// 요청 파라미터 객체 생성
public HandleRequestDto setParameters(String kakaoId, LocalTime time, RequestDto requestDto) {
Expand Down
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
Copy link

Choose a reason for hiding this comment

The 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 DietQueryServiceV2 to DietQueryService and imports have been updated to use non-V2 service and repository types, but the variable names still contain "V2" suffixes.

-    private final CacheService cacheServiceV2;
-    private final DietRepository dietRepositoryV2;
+    private final CacheService cacheService;
+    private final DietRepository dietRepository;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final CacheService cacheServiceV2;
private final DietRepository dietRepositoryV2;
private final CacheService cacheService;
private final DietRepository dietRepository;


// 메뉴 존재 여부에 따른 반환값 처리 로직
public String getDietResponse(HandleRequestDto parameters, int cafeteriaId) {
Expand Down
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.diet;

import com.example.Jinus.dto.data.HandleRequestDto;
import com.example.Jinus.dto.response.*;
Expand All @@ -12,7 +12,7 @@

@Service
@RequiredArgsConstructor
public class DietResponseServiceV2 {
public class DietResponseService {

// 응답 객체 매핑
public String mappingResponse(HandleRequestDto parameters, String imgUrl, String title, String description) {
Expand Down
Loading
Loading