refactor: 不要なコードを削除、DI用アノテーションを追加

This commit is contained in:
usbharu 2023-08-10 19:26:52 +09:00
parent 4fa0b07dff
commit 4fcc096a42
2 changed files with 2 additions and 4 deletions

View File

@ -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")

View File

@ -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.")