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-10-12 01:55:32 +09:00 committed by GitHub
parent cac777a8c0
commit 9c6c0a450b
7 changed files with 3 additions and 9 deletions

View File

@ -22,10 +22,8 @@ class HttpClientConfig {
install(Logging) {
logger = Logger.DEFAULT
level = LogLevel.INFO
}
install(HttpCache) {
}
expectSuccess = true
}

View File

@ -40,7 +40,6 @@ import java.security.interfaces.RSAPrivateKey
import java.security.interfaces.RSAPublicKey
import java.util.*
@EnableWebSecurity(debug = false)
@Configuration
class SecurityConfig {

View File

@ -55,7 +55,6 @@ class PostRepositoryImpl(private val idGenerateService: IdGenerateService) : Pos
}
}
assert(Posts.select { Posts.id eq post.id }.singleOrNull() != null) {
"Faild to insert"
}

View File

@ -32,7 +32,6 @@ class APLikeServiceImpl(
val content = like.content ?: throw IllegalActivityPubObjectException("content is null")
like.`object` ?: throw IllegalActivityPubObjectException("object is null")
transaction.transaction {
LOGGER.trace("FETCH Liked Person $actor")
val person = apUserService.fetchPersonWithEntity(actor)
LOGGER.trace("{}", person.second)

View File

@ -206,7 +206,8 @@ class APServiceImpl(
logger.debug("process activity: {}", type)
return when (type) {
ActivityType.Accept -> apAcceptService.receiveAccept(objectMapper.readValue(json))
ActivityType.Follow -> apReceiveFollowService
ActivityType.Follow ->
apReceiveFollowService
.receiveFollow(objectMapper.readValue(json, Follow::class.java))
ActivityType.Create -> apCreateService.receiveCreate(objectMapper.readValue(json))
ActivityType.Like -> apLikeService.receiveLike(objectMapper.readValue(json))

View File

@ -18,7 +18,6 @@ class MdcXrequestIdFilter : Filter {
} finally {
MDC.remove(KEY)
}
}
companion object {

View File

@ -16,7 +16,6 @@ class ReactionServiceImpl(
) : ReactionService {
override suspend fun receiveReaction(name: String, domain: String, userId: Long, postId: Long) {
if (reactionQueryService.reactionAlreadyExist(postId, userId, 0).not()) {
try {
reactionRepository.save(
Reaction(reactionRepository.generateId(), 0, postId, userId)