mirror of
https://github.com/usbharu/Hideout.git
synced 2026-08-30 00:04:04 +00:00
refactor: 不要なコードを削除、DI用アノテーションを追加
This commit is contained in:
@@ -5,8 +5,10 @@ import dev.usbharu.hideout.repository.Users
|
||||
import dev.usbharu.hideout.repository.UsersFollowers
|
||||
import org.jetbrains.exposed.sql.*
|
||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||
import org.koin.core.annotation.Single
|
||||
import java.time.Instant
|
||||
|
||||
@Single
|
||||
class FollowerQueryServiceImpl : FollowerQueryService {
|
||||
override suspend fun findFollowersById(id: Long): List<User> {
|
||||
val followers = Users.alias("FOLLOWERS")
|
||||
|
||||
@@ -19,8 +19,6 @@ class UserService(
|
||||
) :
|
||||
IUserService {
|
||||
|
||||
override suspend fun findByUrls(urls: List<String>): List<User> = userRepository.findByUrls(urls)
|
||||
|
||||
override suspend fun usernameAlreadyUse(username: String): Boolean {
|
||||
val findByNameAndDomain = userRepository.findByNameAndDomain(username, Config.configData.domain)
|
||||
return findByNameAndDomain != null
|
||||
@@ -64,8 +62,6 @@ class UserService(
|
||||
return userRepository.save(userEntity)
|
||||
}
|
||||
|
||||
override suspend fun findFollowersById(id: Long): List<User> = userRepository.findFollowersById(id)
|
||||
|
||||
// TODO APのフォロー処理を作る
|
||||
override suspend fun followRequest(id: Long, followerId: Long): Boolean {
|
||||
val user = userRepository.findById(id) ?: throw UserNotFoundException("$id was not found.")
|
||||
|
||||
Reference in New Issue
Block a user