-
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.
모든 코드가 Reactor기반으로 동작하도록 구현.
- Loading branch information
Showing
10 changed files
with
227 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.van1164.user | ||
|
||
import com.van1164.common.domain.UserR2dbc | ||
import org.springframework.data.r2dbc.repository.R2dbcRepository | ||
import org.springframework.stereotype.Repository | ||
import reactor.core.publisher.Mono | ||
|
||
@Repository | ||
interface UserRepository : R2dbcRepository<UserR2dbc,Long> { | ||
fun findFirstByUserId(userId: String): Mono<UserR2dbc> | ||
} |
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,22 @@ | ||
package com.van1164.user | ||
|
||
import com.van1164.common.domain.UserR2dbc | ||
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories | ||
import org.springframework.stereotype.Service | ||
import reactor.core.publisher.Mono | ||
|
||
|
||
@Service | ||
@EnableR2dbcRepositories(basePackageClasses = [UserRepository::class]) | ||
class UserService( | ||
val userRepository: UserRepository | ||
) { | ||
|
||
fun findByUserId(userId : String): Mono<UserR2dbc> { | ||
return userRepository.findFirstByUserId(userId) | ||
} | ||
|
||
fun save(user: UserR2dbc): Mono<UserR2dbc> { | ||
return userRepository.save(user) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
package com.van1164.common.util | ||
|
||
import mu.KotlinLogging | ||
import java.util.UUID | ||
|
||
|
||
object Utils { | ||
val logger = KotlinLogging.logger { } | ||
|
||
fun createFilePath(fileUUID : String, extension : String): String { | ||
return "$fileUUID.$extension" | ||
} | ||
|
||
fun createImagePath(): String { | ||
return UUID.randomUUID().toString() + ".jpg" | ||
} | ||
|
||
fun createVideoPath(): String { | ||
return UUID.randomUUID().toString() + ".mp4" | ||
} | ||
|
||
fun createM3U8Path() : String{ | ||
return UUID.randomUUID().toString() + ".m3u8" | ||
} | ||
} |
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.