Skip to content

Conversation

@wjdtkdgns
Copy link
Member

viewer 증가 했는데, 유저가 그냥 화면 꺼버리면 어떻게 처리해야할지 모르겠네요.....

@wjdtkdgns wjdtkdgns self-assigned this Nov 28, 2023
Copy link
Member

@DongGeon0908 DongGeon0908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웹소켓으로 작업해봐도 좋을 것 같아요.

  • viewer의 수를 count해서 저장하는 로직도 같이요. (요거는 영구 데이터 저장이 필요할 듯 합니다.)

Comment on lines +29 to 41
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")
}
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JpaRepository를 사용하시지 않은 이유가 궁금해요

Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구현해주신 로직은, 카운트 요청이 들어왔을 떄, 값을 올려주는 기능이네요.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redis 데이터가 날라간다면?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전에 말씀해주셨던 websocket을 적용해보는건 어때요?

Copy link
Member

@DongGeon0908 DongGeon0908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웹소켓으로 작업해봐도 좋을 것 같아요.

viewer의 수를 count해서 저장하는 로직도 같이요. (요거는 영구 데이터 저장이 필요할 듯 합니다.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants