Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
usbharu 2023-12-14 01:13:16 +09:00 committed by GitHub
parent bdd69d258c
commit 53d195bd8d
4 changed files with 18 additions and 23 deletions

View File

@ -184,22 +184,22 @@ data class Actor private constructor(
override fun toString(): String {
return "Actor(" +
"id=$id, " +
"name='$name', " +
"domain='$domain', " +
"screenName='$screenName', " +
"description='$description', " +
"inbox='$inbox', " +
"outbox='$outbox', " +
"url='$url', " +
"publicKey='$publicKey', " +
"privateKey=$privateKey, " +
"createdAt=$createdAt, " +
"keyId='$keyId', " +
"followers=$followers, " +
"following=$following, " +
"instance=$instance, " +
"locked=$locked" +
")"
"id=$id, " +
"name='$name', " +
"domain='$domain', " +
"screenName='$screenName', " +
"description='$description', " +
"inbox='$inbox', " +
"outbox='$outbox', " +
"url='$url', " +
"publicKey='$publicKey', " +
"privateKey=$privateKey, " +
"createdAt=$createdAt, " +
"keyId='$keyId', " +
"followers=$followers, " +
"following=$following, " +
"instance=$instance, " +
"locked=$locked" +
")"
}
}

View File

@ -72,7 +72,7 @@ class PostServiceImpl(
postQueryService.findByActorId(actorId).filterNot { it.delted }.forEach { postRepository.save(it.delete()) }
val actor = actorRepository.findById(actorId)
?: throw IllegalStateException("actor: ${actorId} was not found.")
?: throw IllegalStateException("actor: $actorId was not found.")
actorRepository.save(actor.copy(postsCount = 0, lastPostDate = null))
}

View File

@ -113,8 +113,6 @@ class RelationshipServiceImpl(
val inverseRelationship = relationshipRepository.findByUserIdAndTargetUserId(targetId, actorId)
if (inverseRelationship?.following == true) {
actorRepository.save(targetActor.decrementFollowing())
actorRepository.save(user.decrementFollowers())
@ -131,7 +129,6 @@ class RelationshipServiceImpl(
val remoteUser = isRemoteUser(targetId)
if (remoteUser != null) {
apSendBlockService.sendBlock(user, remoteUser)
}
}
@ -261,7 +258,6 @@ class RelationshipServiceImpl(
val remoteUser = isRemoteUser(targetId)
if (remoteUser != null) {
apSendUndoService.sendUndoFollow(user, remoteUser)
}
}

View File

@ -14,7 +14,6 @@ import java.time.Instant
@Repository
class AccountQueryServiceImpl(private val applicationConfig: ApplicationConfig) : AccountQueryService {
override suspend fun findById(accountId: Long): Account {
val query = Actors.select { Actors.id eq accountId }
return query