style: fix lint (CI)

This commit is contained in:
usbharu 2024-09-05 15:35:56 +00:00 committed by github-actions[bot]
parent ed41c025cf
commit 5036e01c89
10 changed files with 31 additions and 27 deletions

View File

@ -18,14 +18,14 @@ class GetActorDetailApplicationService(
transaction: Transaction transaction: Transaction
) : ) :
AbstractApplicationService<GetActorDetail, ActorDetail>( AbstractApplicationService<GetActorDetail, ActorDetail>(
transaction, logger transaction,
logger
) { ) {
override suspend fun internalExecute(command: GetActorDetail, principal: Principal): ActorDetail { override suspend fun internalExecute(command: GetActorDetail, principal: Principal): ActorDetail {
val actor = if (command.id != null) { val actor = if (command.id != null) {
actorRepository.findById(ActorId(command.id)) actorRepository.findById(ActorId(command.id))
?: throw IllegalArgumentException("Actor ${command.id} not found.") ?: throw IllegalArgumentException("Actor ${command.id} not found.")
} else if (command.actorName != null) { } else if (command.actorName != null) {
val host = if (command.actorName.host.isEmpty()) { val host = if (command.actorName.host.isEmpty()) {
applicationConfig.url.host applicationConfig.url.host
} else { } else {

View File

@ -35,12 +35,15 @@ class GetUserTimelineApplicationService(
val postDetailMap = userTimelineQueryService.findByIdAll(postIdList, principal).associateBy { it.id } val postDetailMap = userTimelineQueryService.findByIdAll(postIdList, principal).associateBy { it.id }
return PaginationList(postList.mapNotNull { return PaginationList(
postList.mapNotNull {
postDetailMap[it.id.id]?.copy( postDetailMap[it.id.id]?.copy(
repost = postDetailMap[it.repostId?.id], repost = postDetailMap[it.repostId?.id],
reply = postDetailMap[it.replyId?.id] reply = postDetailMap[it.replyId?.id]
) )
}, postList.next, postList.prev) },
postList.next, postList.prev
)
} }
companion object { companion object {

View File

@ -11,7 +11,6 @@ import org.springframework.web.servlet.ModelAndView
class SPAInterceptor : HandlerInterceptor { class SPAInterceptor : HandlerInterceptor {
override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean { override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
if (request.getParameter("s") == "f") { if (request.getParameter("s") == "f") {
request.session.setAttribute("s", "f") request.session.setAttribute("s", "f")
} else if (request.getParameter("s") == "t") { } else if (request.getParameter("s") == "t") {

View File

@ -39,11 +39,13 @@ class UserController(
actorDetail actorDetail
) )
model.addAttribute( model.addAttribute(
"userTimeline", getUserTimelineApplicationService.execute( "userTimeline",
getUserTimelineApplicationService.execute(
GetUserTimeline( GetUserTimeline(
actorDetail.id, actorDetail.id,
Page.of(maxId, sinceId, minId, 20) Page.of(maxId, sinceId, minId, 20)
), principal ),
principal
) )
) )
return "userById" return "userById"