-
Notifications
You must be signed in to change notification settings - Fork 6
Week 3/wjdtkdgns #11
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
base: week-3/wjdtkdgns
Are you sure you want to change the base?
Week 3/wjdtkdgns #11
Conversation
DongGeon0908
left a comment
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.
웹소켓으로 작업해봐도 좋을 것 같아요.
- viewer의 수를 count해서 저장하는 로직도 같이요. (요거는 영구 데이터 저장이 필요할 듯 합니다.)
| implementation("org.springframework.boot:spring-boot-starter-data-jpa") | ||
| implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
| implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.0") | ||
| implementation("org.springdoc:springdoc-openapi-starter-webmvc-api:2.0.0") | ||
| implementation("org.springframework.boot:spring-boot-starter-data-redis") | ||
| runtimeOnly("com.mysql:mysql-connector-j") | ||
|
|
||
| testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
| testImplementation("io.kotest:kotest-runner-junit5:5.7.2") | ||
| testImplementation("io.kotest:kotest-assertions-core:5.7.2") | ||
| testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2") | ||
| testImplementation("io.mockk:mockk:1.13.8") | ||
| } |
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.
버전을 상수로 관리하는 건 어떨까요?
| import org.springframework.data.repository.CrudRepository | ||
| import yapp.study.todolist.domain.viewer.entity.ViewerCount | ||
|
|
||
| interface ViewerCountRepository : CrudRepository<ViewerCount, Long> No newline at end of file |
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.
JpaRepository를 사용하시지 않은 이유가 궁금해요
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.
아 Redis Hash 구나
| private val viewerCountRepository: ViewerCountRepository, | ||
| private val viewerIdRepository: ViewerIdRepository | ||
| ) { | ||
| fun updateCount(increase: Boolean, id: Long) { |
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.
구현해주신 로직은, 카운트 요청이 들어왔을 떄, 값을 올려주는 기능이네요.
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.
redis 데이터가 날라간다면?
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.
이전에 말씀해주셨던 websocket을 적용해보는건 어때요?
DongGeon0908
left a comment
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.
웹소켓으로 작업해봐도 좋을 것 같아요.
viewer의 수를 count해서 저장하는 로직도 같이요. (요거는 영구 데이터 저장이 필요할 듯 합니다.)
viewer 증가 했는데, 유저가 그냥 화면 꺼버리면 어떻게 처리해야할지 모르겠네요.....