mirror of https://github.com/usbharu/Hideout.git
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
bdd69d258c
commit
53d195bd8d
|
@ -184,22 +184,22 @@ data class Actor private constructor(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Actor(" +
|
return "Actor(" +
|
||||||
"id=$id, " +
|
"id=$id, " +
|
||||||
"name='$name', " +
|
"name='$name', " +
|
||||||
"domain='$domain', " +
|
"domain='$domain', " +
|
||||||
"screenName='$screenName', " +
|
"screenName='$screenName', " +
|
||||||
"description='$description', " +
|
"description='$description', " +
|
||||||
"inbox='$inbox', " +
|
"inbox='$inbox', " +
|
||||||
"outbox='$outbox', " +
|
"outbox='$outbox', " +
|
||||||
"url='$url', " +
|
"url='$url', " +
|
||||||
"publicKey='$publicKey', " +
|
"publicKey='$publicKey', " +
|
||||||
"privateKey=$privateKey, " +
|
"privateKey=$privateKey, " +
|
||||||
"createdAt=$createdAt, " +
|
"createdAt=$createdAt, " +
|
||||||
"keyId='$keyId', " +
|
"keyId='$keyId', " +
|
||||||
"followers=$followers, " +
|
"followers=$followers, " +
|
||||||
"following=$following, " +
|
"following=$following, " +
|
||||||
"instance=$instance, " +
|
"instance=$instance, " +
|
||||||
"locked=$locked" +
|
"locked=$locked" +
|
||||||
")"
|
")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class PostServiceImpl(
|
||||||
postQueryService.findByActorId(actorId).filterNot { it.delted }.forEach { postRepository.save(it.delete()) }
|
postQueryService.findByActorId(actorId).filterNot { it.delted }.forEach { postRepository.save(it.delete()) }
|
||||||
|
|
||||||
val actor = actorRepository.findById(actorId)
|
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))
|
actorRepository.save(actor.copy(postsCount = 0, lastPostDate = null))
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,8 +113,6 @@ class RelationshipServiceImpl(
|
||||||
|
|
||||||
val inverseRelationship = relationshipRepository.findByUserIdAndTargetUserId(targetId, actorId)
|
val inverseRelationship = relationshipRepository.findByUserIdAndTargetUserId(targetId, actorId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (inverseRelationship?.following == true) {
|
if (inverseRelationship?.following == true) {
|
||||||
actorRepository.save(targetActor.decrementFollowing())
|
actorRepository.save(targetActor.decrementFollowing())
|
||||||
actorRepository.save(user.decrementFollowers())
|
actorRepository.save(user.decrementFollowers())
|
||||||
|
@ -131,7 +129,6 @@ class RelationshipServiceImpl(
|
||||||
val remoteUser = isRemoteUser(targetId)
|
val remoteUser = isRemoteUser(targetId)
|
||||||
|
|
||||||
if (remoteUser != null) {
|
if (remoteUser != null) {
|
||||||
|
|
||||||
apSendBlockService.sendBlock(user, remoteUser)
|
apSendBlockService.sendBlock(user, remoteUser)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +258,6 @@ class RelationshipServiceImpl(
|
||||||
val remoteUser = isRemoteUser(targetId)
|
val remoteUser = isRemoteUser(targetId)
|
||||||
|
|
||||||
if (remoteUser != null) {
|
if (remoteUser != null) {
|
||||||
|
|
||||||
apSendUndoService.sendUndoFollow(user, remoteUser)
|
apSendUndoService.sendUndoFollow(user, remoteUser)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ import java.time.Instant
|
||||||
@Repository
|
@Repository
|
||||||
class AccountQueryServiceImpl(private val applicationConfig: ApplicationConfig) : AccountQueryService {
|
class AccountQueryServiceImpl(private val applicationConfig: ApplicationConfig) : AccountQueryService {
|
||||||
override suspend fun findById(accountId: Long): Account {
|
override suspend fun findById(accountId: Long): Account {
|
||||||
|
|
||||||
val query = Actors.select { Actors.id eq accountId }
|
val query = Actors.select { Actors.id eq accountId }
|
||||||
|
|
||||||
return query
|
return query
|
||||||
|
|
Loading…
Reference in New Issue