-
Notifications
You must be signed in to change notification settings - Fork 0
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 #8 from byeolhaha/feat/1
feat : 상담원 회원가입, 로그인, 상담 완료 구현 및 Etag와 로컬 캐시 적용
- Loading branch information
Showing
45 changed files
with
1,389 additions
and
78 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/hellomeritz/chat/controller/BanWordController.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,26 @@ | ||
package com.hellomeritz.chat.controller; | ||
|
||
import com.hellomeritz.chat.service.BanWordService; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@RequestMapping("/banwords") | ||
public class BanWordController { | ||
|
||
private final BanWordService banWordService; | ||
|
||
public BanWordController(BanWordService banWordService) { | ||
this.banWordService = banWordService; | ||
} | ||
|
||
@PatchMapping | ||
public ResponseEntity<Void> uploadBanWord( ) { | ||
banWordService.uploadBanWordsToMemory(); | ||
|
||
return ResponseEntity.status(HttpStatus.CREATED) | ||
.build(); | ||
} | ||
|
||
} |
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
8 changes: 4 additions & 4 deletions
8
src/main/java/com/hellomeritz/chat/service/dto/param/ChatRoomPasswordCreateParam.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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/hellomeritz/global/cache/CacheConfig.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,35 @@ | ||
package com.hellomeritz.global.cache; | ||
|
||
import com.github.benmanes.caffeine.cache.Caffeine; | ||
import org.springframework.cache.CacheManager; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.cache.caffeine.CaffeineCache; | ||
import org.springframework.cache.support.SimpleCacheManager; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Configuration | ||
@EnableCaching | ||
public class CacheConfig { | ||
|
||
@Bean | ||
public List<CaffeineCache> caffeineCaches() { | ||
return Arrays.stream(CacheType.values()) | ||
.map(cache -> new CaffeineCache(cache.getCacheName(), Caffeine.newBuilder().recordStats() | ||
.expireAfterWrite(cache.getExpiredHourAfterWrite(), TimeUnit.HOURS) | ||
.maximumSize(cache.getMaximumSize()) | ||
.build())) | ||
.toList(); | ||
} | ||
@Bean | ||
public CacheManager cacheManager(List<CaffeineCache> caffeineCaches) { | ||
SimpleCacheManager cacheManager = new SimpleCacheManager(); | ||
cacheManager.setCaches(caffeineCaches); | ||
|
||
return cacheManager; | ||
} | ||
} |
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,19 @@ | ||
package com.hellomeritz.global.cache; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum CacheType { | ||
FOREIGNER_PROFILE("foreigner", 1, 10000), | ||
CONSULTANT_PROFILE("consultant", 3, 1000); | ||
|
||
private final String cacheName; | ||
private final int expiredHourAfterWrite; | ||
private final int maximumSize; | ||
|
||
CacheType(String cacheName, int expiredHourAfterWrite, int maximumSize) { | ||
this.cacheName = cacheName; | ||
this.expiredHourAfterWrite = expiredHourAfterWrite; | ||
this.maximumSize = maximumSize; | ||
} | ||
} |
34 changes: 17 additions & 17 deletions
34
...omeritz/chat/domain/ChatRoomPassword.java → ...llomeritz/global/encryption/PassWord.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
11 changes: 5 additions & 6 deletions
11
...er/global/encryption/PasswordEncoder.java → ...tz/global/encryption/PasswordEncoder.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
2 changes: 1 addition & 1 deletion
2
...bal/encryption/dto/EncryptionRequest.java → ...bal/encryption/dto/EncryptionRequest.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
2 changes: 1 addition & 1 deletion
2
...al/encryption/dto/EncryptionResponse.java → ...al/encryption/dto/EncryptionResponse.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
Oops, something went wrong.