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
cac777a8c0
commit
9c6c0a450b
|
@ -22,10 +22,8 @@ class HttpClientConfig {
|
||||||
install(Logging) {
|
install(Logging) {
|
||||||
logger = Logger.DEFAULT
|
logger = Logger.DEFAULT
|
||||||
level = LogLevel.INFO
|
level = LogLevel.INFO
|
||||||
|
|
||||||
}
|
}
|
||||||
install(HttpCache) {
|
install(HttpCache) {
|
||||||
|
|
||||||
}
|
}
|
||||||
expectSuccess = true
|
expectSuccess = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ import java.security.interfaces.RSAPrivateKey
|
||||||
import java.security.interfaces.RSAPublicKey
|
import java.security.interfaces.RSAPublicKey
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
@EnableWebSecurity(debug = false)
|
@EnableWebSecurity(debug = false)
|
||||||
@Configuration
|
@Configuration
|
||||||
class SecurityConfig {
|
class SecurityConfig {
|
||||||
|
|
|
@ -55,7 +55,6 @@ class PostRepositoryImpl(private val idGenerateService: IdGenerateService) : Pos
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
assert(Posts.select { Posts.id eq post.id }.singleOrNull() != null) {
|
assert(Posts.select { Posts.id eq post.id }.singleOrNull() != null) {
|
||||||
"Faild to insert"
|
"Faild to insert"
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ class APLikeServiceImpl(
|
||||||
val content = like.content ?: throw IllegalActivityPubObjectException("content is null")
|
val content = like.content ?: throw IllegalActivityPubObjectException("content is null")
|
||||||
like.`object` ?: throw IllegalActivityPubObjectException("object is null")
|
like.`object` ?: throw IllegalActivityPubObjectException("object is null")
|
||||||
transaction.transaction {
|
transaction.transaction {
|
||||||
|
|
||||||
LOGGER.trace("FETCH Liked Person $actor")
|
LOGGER.trace("FETCH Liked Person $actor")
|
||||||
val person = apUserService.fetchPersonWithEntity(actor)
|
val person = apUserService.fetchPersonWithEntity(actor)
|
||||||
LOGGER.trace("{}", person.second)
|
LOGGER.trace("{}", person.second)
|
||||||
|
|
|
@ -206,8 +206,9 @@ class APServiceImpl(
|
||||||
logger.debug("process activity: {}", type)
|
logger.debug("process activity: {}", type)
|
||||||
return when (type) {
|
return when (type) {
|
||||||
ActivityType.Accept -> apAcceptService.receiveAccept(objectMapper.readValue(json))
|
ActivityType.Accept -> apAcceptService.receiveAccept(objectMapper.readValue(json))
|
||||||
ActivityType.Follow -> apReceiveFollowService
|
ActivityType.Follow ->
|
||||||
.receiveFollow(objectMapper.readValue(json, Follow::class.java))
|
apReceiveFollowService
|
||||||
|
.receiveFollow(objectMapper.readValue(json, Follow::class.java))
|
||||||
ActivityType.Create -> apCreateService.receiveCreate(objectMapper.readValue(json))
|
ActivityType.Create -> apCreateService.receiveCreate(objectMapper.readValue(json))
|
||||||
ActivityType.Like -> apLikeService.receiveLike(objectMapper.readValue(json))
|
ActivityType.Like -> apLikeService.receiveLike(objectMapper.readValue(json))
|
||||||
ActivityType.Undo -> apUndoService.receiveUndo(objectMapper.readValue(json))
|
ActivityType.Undo -> apUndoService.receiveUndo(objectMapper.readValue(json))
|
||||||
|
|
|
@ -18,7 +18,6 @@ class MdcXrequestIdFilter : Filter {
|
||||||
} finally {
|
} finally {
|
||||||
MDC.remove(KEY)
|
MDC.remove(KEY)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class ReactionServiceImpl(
|
||||||
) : ReactionService {
|
) : ReactionService {
|
||||||
override suspend fun receiveReaction(name: String, domain: String, userId: Long, postId: Long) {
|
override suspend fun receiveReaction(name: String, domain: String, userId: Long, postId: Long) {
|
||||||
if (reactionQueryService.reactionAlreadyExist(postId, userId, 0).not()) {
|
if (reactionQueryService.reactionAlreadyExist(postId, userId, 0).not()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
reactionRepository.save(
|
reactionRepository.save(
|
||||||
Reaction(reactionRepository.generateId(), 0, postId, userId)
|
Reaction(reactionRepository.generateId(), 0, postId, userId)
|
||||||
|
|
Loading…
Reference in New Issue