mirror of https://github.com/usbharu/Hideout.git
style: スタイルを調整
This commit is contained in:
parent
8297d578bc
commit
0d7e4aaedc
|
@ -11,8 +11,8 @@ import java.time.Instant
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
class StatusQueryServiceImpl : StatusQueryService {
|
class StatusQueryServiceImpl : StatusQueryService {
|
||||||
|
@Suppress("LongMethod")
|
||||||
override suspend fun findByPostIds(ids: List<Long>): List<Status> {
|
override suspend fun findByPostIds(ids: List<Long>): List<Status> {
|
||||||
|
|
||||||
val pairs = Posts.innerJoin(Users, onColumn = { userId }, otherColumn = { id })
|
val pairs = Posts.innerJoin(Users, onColumn = { userId }, otherColumn = { id })
|
||||||
.select { Posts.id inList ids }
|
.select { Posts.id inList ids }
|
||||||
.map {
|
.map {
|
||||||
|
@ -98,7 +98,5 @@ class StatusQueryServiceImpl : StatusQueryService {
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Timeline
|
||||||
import org.springframework.data.domain.Pageable
|
import org.springframework.data.domain.Pageable
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository
|
import org.springframework.data.mongodb.repository.MongoRepository
|
||||||
|
|
||||||
|
@Suppress("LongParameterList")
|
||||||
interface MongoTimelineRepository : MongoRepository<Timeline, Long> {
|
interface MongoTimelineRepository : MongoRepository<Timeline, Long> {
|
||||||
fun findByUserId(id: Long): List<Timeline>
|
fun findByUserId(id: Long): List<Timeline>
|
||||||
fun findByUserIdAndTimelineId(userId: Long, timelineId: Long): List<Timeline>
|
fun findByUserIdAndTimelineId(userId: Long, timelineId: Long): List<Timeline>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import kotlinx.coroutines.withContext
|
||||||
import org.springframework.stereotype.Repository
|
import org.springframework.stereotype.Repository
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
|
@Suppress("InjectDispatcher")
|
||||||
class MongoTimelineRepositoryWrapper(
|
class MongoTimelineRepositoryWrapper(
|
||||||
private val mongoTimelineRepository: MongoTimelineRepository,
|
private val mongoTimelineRepository: MongoTimelineRepository,
|
||||||
private val idGenerateService: IdGenerateService
|
private val idGenerateService: IdGenerateService
|
||||||
|
|
|
@ -38,6 +38,7 @@ interface APNoteService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Suppress("LongParameterList")
|
||||||
class APNoteServiceImpl(
|
class APNoteServiceImpl(
|
||||||
private val httpClient: HttpClient,
|
private val httpClient: HttpClient,
|
||||||
private val jobQueueParentService: JobQueueParentService,
|
private val jobQueueParentService: JobQueueParentService,
|
||||||
|
|
|
@ -5,6 +5,7 @@ import dev.usbharu.hideout.service.core.Transaction
|
||||||
import dev.usbharu.hideout.service.post.GenerateTimelineService
|
import dev.usbharu.hideout.service.post.GenerateTimelineService
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
|
@Suppress("LongParameterList")
|
||||||
interface TimelineApiService {
|
interface TimelineApiService {
|
||||||
suspend fun publicTimeline(
|
suspend fun publicTimeline(
|
||||||
localOnly: Boolean = false,
|
localOnly: Boolean = false,
|
||||||
|
@ -25,7 +26,6 @@ interface TimelineApiService {
|
||||||
): List<Status>
|
): List<Status>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class TimelineApiServiceImpl(
|
class TimelineApiServiceImpl(
|
||||||
private val generateTimelineService: GenerateTimelineService,
|
private val generateTimelineService: GenerateTimelineService,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import dev.usbharu.hideout.domain.mastodon.model.generated.Status
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Suppress("LongParameterList")
|
||||||
interface GenerateTimelineService {
|
interface GenerateTimelineService {
|
||||||
suspend fun getTimeline(
|
suspend fun getTimeline(
|
||||||
forUserId: Long? = null,
|
forUserId: Long? = null,
|
||||||
|
@ -14,5 +15,4 @@ interface GenerateTimelineService {
|
||||||
sinceId: Long? = null,
|
sinceId: Long? = null,
|
||||||
limit: Int = 20
|
limit: Int = 20
|
||||||
): List<Status>
|
): List<Status>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,6 @@ class MongoGenerateTimelineService(
|
||||||
sinceId: Long?,
|
sinceId: Long?,
|
||||||
limit: Int
|
limit: Int
|
||||||
): List<Status> {
|
): List<Status> {
|
||||||
|
|
||||||
|
|
||||||
val query = Query()
|
val query = Query()
|
||||||
if (forUserId != null) {
|
if (forUserId != null) {
|
||||||
val criteria = Criteria.where("userId").`is`(forUserId)
|
val criteria = Criteria.where("userId").`is`(forUserId)
|
||||||
|
|
Loading…
Reference in New Issue