File tree Expand file tree Collapse file tree 4 files changed +21
-44
lines changed
src/main/java/com/example/Jinus/service Expand file tree Collapse file tree 4 files changed +21
-44
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,10 @@ private long calculateTtlUntilNextMidnight(Date dietDate) {
5555
5656
5757 // Redis에서 조회 (없으면 DB에서 가져옴)
58- @ Cacheable (
59- value = "cafeteriaList" ,
60- key = "#p0" ,
61- cacheManager = "contentCacheManager" )
58+ // @Cacheable(
59+ // value = "cafeteriaList",
60+ // key = "#p0",
61+ // cacheManager = "contentCacheManager")
6262 public List <CafeteriaDto > getCafeteriaList (int campusId ) {
6363 return cafeteriaRepositoryV2 .findCafeteriaListByCampusId (campusId );
6464 }
Original file line number Diff line number Diff line change 1212public class CafeteriaQueryService {
1313 private final CafeteriaRepository cafeteriaRepositoryV2 ;
1414
15- @ Cacheable (
16- value = "cafeteriaId" ,
17- key = "#p0 + '::' + #p1" ,
18- unless = "#result == -1" ,
19- cacheManager = "contentCacheManager" )
15+ // @Cacheable(
16+ // value = "cafeteriaId",
17+ // key = "#p0 + '::' + #p1",
18+ // unless = "#result == -1",
19+ // cacheManager = "contentCacheManager")
2020 public int getCafeteriaId (String cafeteriaName , int campusId ) {
2121 return cafeteriaRepositoryV2 .findCafeteriaId (cafeteriaName , campusId ).orElse (-1 );
2222 }
2323
24- @ Cacheable (
25- value = "cafeteriaUrl" ,
26- key = "#p0" ,
27- cacheManager = "contentCacheManager" )
24+ // @Cacheable(
25+ // value = "cafeteriaUrl",
26+ // key = "#p0",
27+ // cacheManager = "contentCacheManager")
2828 public String getImgUrl (int cafeteriaId ) {
2929 return cafeteriaRepositoryV2 .findImgUrlByCafeteriaId (cafeteriaId );
3030 }
Original file line number Diff line number Diff line change 1515public class CampusService {
1616 private final CampusRepository campusRepositoryV2 ;
1717
18- @ Cacheable (
19- value = "campusId" ,
20- key = "#p0" ,
21- cacheManager = "contentCacheManager" )
18+ // @Cacheable(
19+ // value = "campusId",
20+ // key = "#p0",
21+ // cacheManager = "contentCacheManager")
2222 // 사용자의 campusId 받아 캠퍼스 이름 찾기
2323 public String getUserCampusName (int campusId ) {
2424 return campusRepositoryV2 .findCampusNameByCampusId (campusId );
@@ -29,10 +29,10 @@ public List<CampusEntity> getCampusList() {
2929 return campusRepositoryV2 .findCampusList ();
3030 }
3131
32- @ Cacheable (
33- value = "campusName" ,
34- key = "#p0" ,
35- cacheManager = "contentCacheManager" )
32+ // @Cacheable(
33+ // value = "campusName",
34+ // key = "#p0",
35+ // cacheManager = "contentCacheManager")
3636 // 캠퍼스 이름으로 id 찾기
3737 public int getCampusId (String campusName ) {
3838 return campusRepositoryV2 .findCampusIdByName (campusName );
Original file line number Diff line number Diff line change 11package com .example .Jinus .service .userInfo ;
22
3- import com .example .Jinus .entity .userInfo .CollegeEntity ;
43import com .example .Jinus .repository .userInfo .CollegeRepository ;
54import org .slf4j .Logger ;
65import org .slf4j .LoggerFactory ;
76import org .springframework .stereotype .Service ;
87
98@ Service
109public class CollegeService {
11- private static final Logger logger = LoggerFactory .getLogger (CollegeService .class );
1210 private final CollegeRepository collegeRepository ;
1311
1412 public CollegeService (CollegeRepository collegeRepository ) {
1513 this .collegeRepository = collegeRepository ;
1614 }
1715
18- public String getCollegeName (int collegeId ) {
19- CollegeEntity collegeEntity = collegeRepository .findById (collegeId ).orElse (null );
20-
21- if (collegeEntity != null ) {
22- return collegeEntity .getCollegeEng (); // 학과 영어 이름 리턴(테이블 찾기 위함)
23- } else {
24- logger .debug ("CollegeService: collge를 찾을 수 없습니다." );
25- return null ;
26- }
27- }
28-
29- public boolean checkEtcValue (int collegeId ) {
30- CollegeEntity collegeEntity = collegeRepository .findById (collegeId ).orElse (null );
31- return collegeEntity .isEtcValue ();
32- }
33-
34- // collegeId에 해당하는 campusId 찾기
35- public int getCampusId (int collegeId ) {
36- int campusId = collegeRepository .findCampusId (collegeId );
37- return campusId ;
38- }
3916}
You can’t perform that action at this time.
0 commit comments