mirror of https://github.com/usbharu/Hideout.git
style: fix lint
This commit is contained in:
parent
61e61ec4bd
commit
e5f620749e
src/main/kotlin/dev/usbharu/hideout
activitypub/domain/model
core
domain/model
infrastructure/springframework
service
media
timeline
mastodon
infrastructure
interfaces/api/status
query
service
util
|
@ -52,11 +52,11 @@ open class Delete : Object, HasId, HasActor {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Delete(" +
|
return "Delete(" +
|
||||||
"apObject=$apObject, " +
|
"apObject=$apObject, " +
|
||||||
"published='$published', " +
|
"published='$published', " +
|
||||||
"actor='$actor', " +
|
"actor='$actor', " +
|
||||||
"id='$id'" +
|
"id='$id'" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,12 @@ open class Emoji(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Emoji(" +
|
return "Emoji(" +
|
||||||
"name='$name', " +
|
"name='$name', " +
|
||||||
"id='$id', " +
|
"id='$id', " +
|
||||||
"updated='$updated', " +
|
"updated='$updated', " +
|
||||||
"icon=$icon" +
|
"icon=$icon" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|
|
@ -36,10 +36,10 @@ open class Follow(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Follow(" +
|
return "Follow(" +
|
||||||
"apObject='$apObject', " +
|
"apObject='$apObject', " +
|
||||||
"actor='$actor', " +
|
"actor='$actor', " +
|
||||||
"id=$id" +
|
"id=$id" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,17 +62,17 @@ constructor(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Note(" +
|
return "Note(" +
|
||||||
"id='$id', " +
|
"id='$id', " +
|
||||||
"attributedTo='$attributedTo', " +
|
"attributedTo='$attributedTo', " +
|
||||||
"content='$content', " +
|
"content='$content', " +
|
||||||
"published='$published', " +
|
"published='$published', " +
|
||||||
"to=$to, " +
|
"to=$to, " +
|
||||||
"cc=$cc, " +
|
"cc=$cc, " +
|
||||||
"sensitive=$sensitive, " +
|
"sensitive=$sensitive, " +
|
||||||
"inReplyTo=$inReplyTo, " +
|
"inReplyTo=$inReplyTo, " +
|
||||||
"attachment=$attachment, " +
|
"attachment=$attachment, " +
|
||||||
"tag=$tag" +
|
"tag=$tag" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,11 +40,11 @@ open class Undo(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Undo(" +
|
return "Undo(" +
|
||||||
"actor='$actor', " +
|
"actor='$actor', " +
|
||||||
"id='$id', " +
|
"id='$id', " +
|
||||||
"apObject=$apObject, " +
|
"apObject=$apObject, " +
|
||||||
"published=$published" +
|
"published=$published" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,27 +212,27 @@ data class Actor private constructor(
|
||||||
fun withLastPostAt(lastPostDate: Instant): Actor = this.copy(lastPostDate = lastPostDate)
|
fun withLastPostAt(lastPostDate: Instant): Actor = this.copy(lastPostDate = lastPostDate)
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Actor(" +
|
return "Actor(" +
|
||||||
"id=$id, " +
|
"id=$id, " +
|
||||||
"name='$name', " +
|
"name='$name', " +
|
||||||
"domain='$domain', " +
|
"domain='$domain', " +
|
||||||
"screenName='$screenName', " +
|
"screenName='$screenName', " +
|
||||||
"description='$description', " +
|
"description='$description', " +
|
||||||
"inbox='$inbox', " +
|
"inbox='$inbox', " +
|
||||||
"outbox='$outbox', " +
|
"outbox='$outbox', " +
|
||||||
"url='$url', " +
|
"url='$url', " +
|
||||||
"publicKey='$publicKey', " +
|
"publicKey='$publicKey', " +
|
||||||
"privateKey=$privateKey, " +
|
"privateKey=$privateKey, " +
|
||||||
"createdAt=$createdAt, " +
|
"createdAt=$createdAt, " +
|
||||||
"keyId='$keyId', " +
|
"keyId='$keyId', " +
|
||||||
"followers=$followers, " +
|
"followers=$followers, " +
|
||||||
"following=$following, " +
|
"following=$following, " +
|
||||||
"instance=$instance, " +
|
"instance=$instance, " +
|
||||||
"locked=$locked, " +
|
"locked=$locked, " +
|
||||||
"followersCount=$followersCount, " +
|
"followersCount=$followersCount, " +
|
||||||
"followingCount=$followingCount, " +
|
"followingCount=$followingCount, " +
|
||||||
"postsCount=$postsCount, " +
|
"postsCount=$postsCount, " +
|
||||||
"lastPostDate=$lastPostDate, " +
|
"lastPostDate=$lastPostDate, " +
|
||||||
"emojis=$emojis" +
|
"emojis=$emojis" +
|
||||||
")"
|
")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,9 @@ sealed class Emoji {
|
||||||
abstract fun id(): String
|
abstract fun id(): String
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "Emoji(" +
|
return "Emoji(" +
|
||||||
"domain='$domain', " +
|
"domain='$domain', " +
|
||||||
"name='$name'" +
|
"name='$name'" +
|
||||||
")"
|
")"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ class HttpSignatureUser(
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "HttpSignatureUser(" +
|
return "HttpSignatureUser(" +
|
||||||
"domain='$domain', " +
|
"domain='$domain', " +
|
||||||
"id=$id" +
|
"id=$id" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
|
@ -273,7 +273,7 @@ class ExposedOAuth2AuthorizationService(
|
||||||
oidcTokenIssuedAt,
|
oidcTokenIssuedAt,
|
||||||
oidcTokenExpiresAt,
|
oidcTokenExpiresAt,
|
||||||
oidcTokenMetadata.getValue(OAuth2Authorization.Token.CLAIMS_METADATA_NAME)
|
oidcTokenMetadata.getValue(OAuth2Authorization.Token.CLAIMS_METADATA_NAME)
|
||||||
as MutableMap<String, Any>?
|
as MutableMap<String, Any>?
|
||||||
)
|
)
|
||||||
|
|
||||||
builder.token(oidcIdToken) { it.putAll(oidcTokenMetadata) }
|
builder.token(oidcIdToken) { it.putAll(oidcTokenMetadata) }
|
||||||
|
|
|
@ -28,9 +28,9 @@ class UserDetailsImpl(
|
||||||
) : User(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities) {
|
) : User(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities) {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "UserDetailsImpl(" +
|
return "UserDetailsImpl(" +
|
||||||
"id=$id" +
|
"id=$id" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|
|
@ -29,7 +29,7 @@ class MediaServiceImpl(
|
||||||
val fileName = mediaRequest.file.name
|
val fileName = mediaRequest.file.name
|
||||||
logger.info(
|
logger.info(
|
||||||
"Media upload. filename:$fileName " +
|
"Media upload. filename:$fileName " +
|
||||||
"contentType:${mediaRequest.file.contentType}"
|
"contentType:${mediaRequest.file.contentType}"
|
||||||
)
|
)
|
||||||
|
|
||||||
val tempFile = Files.createTempFile("hideout-tmp-file", ".tmp")
|
val tempFile = Files.createTempFile("hideout-tmp-file", ".tmp")
|
||||||
|
|
|
@ -8,7 +8,7 @@ data class ImageMediaProcessorConfiguration(
|
||||||
val thubnail: ImageMediaProcessorThumbnailConfiguration?,
|
val thubnail: ImageMediaProcessorThumbnailConfiguration?,
|
||||||
val supportedType: List<String>?,
|
val supportedType: List<String>?,
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ImageMediaProcessorThumbnailConfiguration(
|
data class ImageMediaProcessorThumbnailConfiguration(
|
||||||
val generate: Boolean,
|
val generate: Boolean,
|
||||||
|
|
|
@ -32,7 +32,6 @@ class ExposedGenerateTimelineService(private val statusQueryService: StatusQuery
|
||||||
}
|
}
|
||||||
val result = query.withPagination(page, Timelines.id)
|
val result = query.withPagination(page, Timelines.id)
|
||||||
|
|
||||||
|
|
||||||
val statusQueries = result.map {
|
val statusQueries = result.map {
|
||||||
StatusQuery(
|
StatusQuery(
|
||||||
it[Timelines.postId],
|
it[Timelines.postId],
|
||||||
|
|
|
@ -87,7 +87,7 @@ class StatusQueryServiceImpl : StatusQueryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
val pairs = query
|
val pairs = query
|
||||||
.withPagination(page,Posts.id)
|
.withPagination(page, Posts.id)
|
||||||
.groupBy { it[Posts.id] }
|
.groupBy { it[Posts.id] }
|
||||||
.map { it.value }
|
.map { it.value }
|
||||||
.map {
|
.map {
|
||||||
|
|
|
@ -50,7 +50,6 @@ class MongoMastodonNotificationRepositoryWrapper(
|
||||||
mongoTemplate.find(query, MastodonNotification::class.java)
|
mongoTemplate.find(query, MastodonNotification::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return PaginationList(
|
return PaginationList(
|
||||||
mastodonNotifications,
|
mastodonNotifications,
|
||||||
mastodonNotifications.firstOrNull()?.id,
|
mastodonNotifications.firstOrNull()?.id,
|
||||||
|
|
|
@ -66,16 +66,16 @@ class StatusesRequest {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "StatusesRequest(" +
|
return "StatusesRequest(" +
|
||||||
"status=$status, " +
|
"status=$status, " +
|
||||||
"media_ids=$media_ids, " +
|
"media_ids=$media_ids, " +
|
||||||
"poll=$poll, " +
|
"poll=$poll, " +
|
||||||
"in_reply_to_id=$in_reply_to_id, " +
|
"in_reply_to_id=$in_reply_to_id, " +
|
||||||
"sensitive=$sensitive, " +
|
"sensitive=$sensitive, " +
|
||||||
"spoiler_text=$spoiler_text, " +
|
"spoiler_text=$spoiler_text, " +
|
||||||
"visibility=$visibility, " +
|
"visibility=$visibility, " +
|
||||||
"language=$language, " +
|
"language=$language, " +
|
||||||
"scheduled_at=$scheduled_at" +
|
"scheduled_at=$scheduled_at" +
|
||||||
")"
|
")"
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("EnumNaming", "EnumEntryNameCase")
|
@Suppress("EnumNaming", "EnumEntryNameCase")
|
||||||
|
|
|
@ -9,6 +9,7 @@ interface StatusQueryService {
|
||||||
suspend fun findByPostIds(ids: List<Long>): List<Status>
|
suspend fun findByPostIds(ids: List<Long>): List<Status>
|
||||||
suspend fun findByPostIdsWithMediaIds(statusQueries: List<StatusQuery>): List<Status>
|
suspend fun findByPostIdsWithMediaIds(statusQueries: List<StatusQuery>): List<Status>
|
||||||
|
|
||||||
|
@Suppress("LongParameterList")
|
||||||
suspend fun accountsStatus(
|
suspend fun accountsStatus(
|
||||||
accountId: Long,
|
accountId: Long,
|
||||||
onlyMedia: Boolean = false,
|
onlyMedia: Boolean = false,
|
||||||
|
|
|
@ -20,6 +20,7 @@ import kotlin.math.min
|
||||||
@Suppress("TooManyFunctions")
|
@Suppress("TooManyFunctions")
|
||||||
interface AccountApiService {
|
interface AccountApiService {
|
||||||
|
|
||||||
|
@Suppress("ongParameterList")
|
||||||
suspend fun accountsStatuses(
|
suspend fun accountsStatuses(
|
||||||
userid: Long,
|
userid: Long,
|
||||||
onlyMedia: Boolean,
|
onlyMedia: Boolean,
|
||||||
|
@ -87,7 +88,7 @@ class AccountApiServiceImpl(
|
||||||
): PaginationList<Status, Long> {
|
): PaginationList<Status, Long> {
|
||||||
val canViewFollowers = if (loginUser == null) {
|
val canViewFollowers = if (loginUser == null) {
|
||||||
false
|
false
|
||||||
}else if(loginUser == userid) {
|
} else if (loginUser == userid) {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
transaction.transaction {
|
transaction.transaction {
|
||||||
|
|
|
@ -19,7 +19,7 @@ class InstanceApiServiceImpl(private val applicationConfig: ApplicationConfig) :
|
||||||
title = "Hideout Server",
|
title = "Hideout Server",
|
||||||
shortDescription = "Hideout test server",
|
shortDescription = "Hideout test server",
|
||||||
description = "This server is operated for testing of Hideout." +
|
description = "This server is operated for testing of Hideout." +
|
||||||
" We are not responsible for any events that occur when associating with this server",
|
" We are not responsible for any events that occur when associating with this server",
|
||||||
email = "i@usbharu.dev",
|
email = "i@usbharu.dev",
|
||||||
version = "0.0.1",
|
version = "0.0.1",
|
||||||
urls = V1InstanceUrls("wss://${url.host}"),
|
urls = V1InstanceUrls("wss://${url.host}"),
|
||||||
|
|
|
@ -7,9 +7,9 @@ class LruCache<K, V>(private val maxSize: Int) : LinkedHashMap<K, V>(15, 0.75f,
|
||||||
override fun removeEldestEntry(eldest: MutableMap.MutableEntry<K, V>?): Boolean = size > maxSize
|
override fun removeEldestEntry(eldest: MutableMap.MutableEntry<K, V>?): Boolean = size > maxSize
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "LruCache(" +
|
return "LruCache(" +
|
||||||
"maxSize=$maxSize" +
|
"maxSize=$maxSize" +
|
||||||
")" +
|
")" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Reference in New Issue