mirror of https://github.com/usbharu/Hideout.git
style: fix lint (CI)
This commit is contained in:
parent
ed41c025cf
commit
5036e01c89
|
@ -18,14 +18,14 @@ class GetActorDetailApplicationService(
|
|||
transaction: Transaction
|
||||
) :
|
||||
AbstractApplicationService<GetActorDetail, ActorDetail>(
|
||||
transaction, logger
|
||||
transaction,
|
||||
logger
|
||||
) {
|
||||
override suspend fun internalExecute(command: GetActorDetail, principal: Principal): ActorDetail {
|
||||
val actor = if (command.id != null) {
|
||||
actorRepository.findById(ActorId(command.id))
|
||||
?: throw IllegalArgumentException("Actor ${command.id} not found.")
|
||||
} else if (command.actorName != null) {
|
||||
|
||||
val host = if (command.actorName.host.isEmpty()) {
|
||||
applicationConfig.url.host
|
||||
} else {
|
||||
|
|
|
@ -29,9 +29,9 @@ class GetLocalInstanceApplicationService(
|
|||
}
|
||||
|
||||
val instance = (
|
||||
instanceRepository.findByUrl(applicationConfig.url.toURI())
|
||||
?: throw InternalServerException("Local instance not found.")
|
||||
)
|
||||
instanceRepository.findByUrl(applicationConfig.url.toURI())
|
||||
?: throw InternalServerException("Local instance not found.")
|
||||
)
|
||||
|
||||
cachedInstance = Instance.of(instance)
|
||||
@Suppress("UnsafeCallOnNullableType")
|
||||
|
|
|
@ -35,12 +35,15 @@ class GetUserTimelineApplicationService(
|
|||
|
||||
val postDetailMap = userTimelineQueryService.findByIdAll(postIdList, principal).associateBy { it.id }
|
||||
|
||||
return PaginationList(postList.mapNotNull {
|
||||
postDetailMap[it.id.id]?.copy(
|
||||
repost = postDetailMap[it.repostId?.id],
|
||||
reply = postDetailMap[it.replyId?.id]
|
||||
)
|
||||
}, postList.next, postList.prev)
|
||||
return PaginationList(
|
||||
postList.mapNotNull {
|
||||
postDetailMap[it.id.id]?.copy(
|
||||
repost = postDetailMap[it.repostId?.id],
|
||||
reply = postDetailMap[it.replyId?.id]
|
||||
)
|
||||
},
|
||||
postList.next, postList.prev
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -39,10 +39,10 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi
|
|||
.select(Posts.columns)
|
||||
.where {
|
||||
Posts.visibility eq Visibility.PUBLIC.name or
|
||||
(Posts.visibility eq Visibility.UNLISTED.name) or
|
||||
(Posts.visibility eq Visibility.DIRECT.name and (PostsVisibleActors.actorId eq principal.actorId.id)) or
|
||||
(Posts.visibility eq Visibility.FOLLOWERS.name and (Relationships.blocking eq false and (relationshipsAlias[Relationships.following] eq true))) or
|
||||
(Posts.actorId eq principal.actorId.id)
|
||||
(Posts.visibility eq Visibility.UNLISTED.name) or
|
||||
(Posts.visibility eq Visibility.DIRECT.name and (PostsVisibleActors.actorId eq principal.actorId.id)) or
|
||||
(Posts.visibility eq Visibility.FOLLOWERS.name and (Relationships.blocking eq false and (relationshipsAlias[Relationships.following] eq true))) or
|
||||
(Posts.actorId eq principal.actorId.id)
|
||||
}
|
||||
.alias("authorized_table")
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.springframework.web.servlet.ModelAndView
|
|||
class SPAInterceptor : HandlerInterceptor {
|
||||
|
||||
override fun preHandle(request: HttpServletRequest, response: HttpServletResponse, handler: Any): Boolean {
|
||||
|
||||
if (request.getParameter("s") == "f") {
|
||||
request.session.setAttribute("s", "f")
|
||||
} else if (request.getParameter("s") == "t") {
|
||||
|
|
|
@ -39,11 +39,13 @@ class UserController(
|
|||
actorDetail
|
||||
)
|
||||
model.addAttribute(
|
||||
"userTimeline", getUserTimelineApplicationService.execute(
|
||||
"userTimeline",
|
||||
getUserTimelineApplicationService.execute(
|
||||
GetUserTimeline(
|
||||
actorDetail.id,
|
||||
Page.of(maxId, sinceId, minId, 20)
|
||||
), principal
|
||||
),
|
||||
principal
|
||||
)
|
||||
)
|
||||
return "userById"
|
||||
|
|
Loading…
Reference in New Issue