-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from f-lab-edu/feature/44-cache
[#44] Cache 적용으로 읽기 성능 최적화하기
- Loading branch information
Showing
11 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/kboticketing/kboticketing/config/RedisCacheConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.kboticketing.kboticketing.config; | ||
|
||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.redis.cache.RedisCacheConfiguration; | ||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; | ||
import org.springframework.data.redis.serializer.RedisSerializationContext; | ||
import org.springframework.data.redis.serializer.StringRedisSerializer; | ||
|
||
/** | ||
* @author hazel | ||
*/ | ||
@EnableCaching | ||
@Configuration | ||
public class RedisCacheConfig { | ||
|
||
@Bean | ||
public RedisCacheConfiguration redisCacheConfiguration() { | ||
return RedisCacheConfiguration.defaultCacheConfig() | ||
.disableCachingNullValues() | ||
.serializeKeysWith( | ||
RedisSerializationContext.SerializationPair.fromSerializer( | ||
new StringRedisSerializer()) | ||
) | ||
.serializeValuesWith( | ||
RedisSerializationContext.SerializationPair.fromSerializer( | ||
new GenericJackson2JsonRedisSerializer())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletions
15
src/main/java/com/kboticketing/kboticketing/domain/ScheduleInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
package com.kboticketing.kboticketing.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* @author hazel | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor | ||
public class ScheduleInfo { | ||
|
||
private final Integer scheduleId; | ||
private final String scheduleName; | ||
private final String date; | ||
private final String stadiumName; | ||
|
||
@JsonCreator | ||
public ScheduleInfo(@JsonProperty("scheduleId") Integer scheduleId, | ||
@JsonProperty("scheduleName") String scheduleName, | ||
@JsonProperty("date") String date, | ||
@JsonProperty("stadiumName") String stadiumName) { | ||
this.scheduleId = scheduleId; | ||
this.scheduleName = scheduleName; | ||
this.date = date; | ||
this.stadiumName = stadiumName; | ||
} | ||
} |
14 changes: 12 additions & 2 deletions
14
src/main/java/com/kboticketing/kboticketing/domain/ScheduleTeam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
package com.kboticketing.kboticketing.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* @author hazel | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public class ScheduleTeam { | ||
|
||
private final Integer scheduleId; | ||
private final String scheduleName; | ||
private final String stadiumName; | ||
private final String date; | ||
|
||
@JsonCreator | ||
public ScheduleTeam(@JsonProperty("scheduleId") Integer scheduleId, | ||
@JsonProperty("scheduleName") String scheduleName, | ||
@JsonProperty("stadiumName") String stadiumName, @JsonProperty("date") String date) { | ||
this.scheduleId = scheduleId; | ||
this.scheduleName = scheduleName; | ||
this.stadiumName = stadiumName; | ||
this.date = date; | ||
} | ||
} |
13 changes: 11 additions & 2 deletions
13
src/main/java/com/kboticketing/kboticketing/domain/SeatGrade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
package com.kboticketing.kboticketing.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* @author hazel | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor | ||
@EqualsAndHashCode | ||
public class SeatGrade { | ||
|
||
private final Integer seatGradeId; | ||
private final String seatGradeName; | ||
private final String seatCount; | ||
|
||
@JsonCreator | ||
public SeatGrade(@JsonProperty("seatGradeId") Integer seatGradeId, | ||
@JsonProperty("seatGradeName") String seatGradeName, | ||
@JsonProperty("seatCount") String seatCount) { | ||
this.seatGradeId = seatGradeId; | ||
this.seatGradeName = seatGradeName; | ||
this.seatCount = seatCount; | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/com/kboticketing/kboticketing/domain/Team.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package com.kboticketing.kboticketing.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* @author hazel | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public class Team { | ||
|
||
private final Integer teamId; | ||
private final String name; | ||
|
||
@JsonCreator | ||
public Team(@JsonProperty("teamId") Integer teamId, @JsonProperty("name") String name) { | ||
this.teamId = teamId; | ||
this.name = name; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/kboticketing/kboticketing/dto/ScheduleQueryParamDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters