mirror of https://github.com/usbharu/Hideout.git
Merge branch 'refs/heads/develop' into test
# Conflicts: # hideout-core/src/main/kotlin/dev/usbharu/hideout/core/domain/model/filter/FilterKeyword.kt
This commit is contained in:
commit
ce731218ea
|
@ -4,6 +4,11 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- "develop"
|
||||
types:
|
||||
- opened # default
|
||||
- reopened # default
|
||||
- synchronize # default
|
||||
- ready_for_review # 必要
|
||||
|
||||
|
||||
permissions:
|
||||
|
@ -15,6 +20,7 @@ permissions:
|
|||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -257,8 +263,8 @@ jobs:
|
|||
with:
|
||||
arguments: :hideout-core:detektMain
|
||||
|
||||
- name: "reviewdog-suggester: Suggest any code changes based on diff with reviewdog"
|
||||
- name: Auto Commit
|
||||
if: ${{ always() }}
|
||||
uses: reviewdog/action-suggester@v1
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit_message: "style: fix lint (CI)"
|
|
@ -133,6 +133,8 @@ naming:
|
|||
- "**/test/**"
|
||||
|
||||
FunctionMinLength:
|
||||
ignoreFunction:
|
||||
- of
|
||||
active: true
|
||||
|
||||
LambdaParameterNaming:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
kotlin("jvm") version "1.9.23"
|
||||
kotlin("jvm") version "1.9.24"
|
||||
}
|
||||
|
||||
group = "dev.usbharu"
|
||||
|
|
|
@ -33,10 +33,6 @@ class GetUserDetailApplicationService(
|
|||
transaction: Transaction,
|
||||
) :
|
||||
AbstractApplicationService<GetUserDetail, UserDetail>(transaction, Companion.logger) {
|
||||
companion object {
|
||||
val logger = LoggerFactory.getLogger(GetUserDetailApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: GetUserDetail, executor: CommandExecutor): UserDetail {
|
||||
val userDetail = userDetailRepository.findById(command.id)
|
||||
?: throw IllegalArgumentException("actor does not exist")
|
||||
|
@ -46,4 +42,8 @@ class GetUserDetailApplicationService(
|
|||
|
||||
return UserDetail.of(actor, userDetail, emojis)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val logger = LoggerFactory.getLogger(GetUserDetailApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@ class UserDeleteFilterApplicationService(private val filterRepository: FilterRep
|
|||
transaction,
|
||||
logger
|
||||
) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserDeleteFilterApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: DeleteFilter, executor: CommandExecutor) {
|
||||
val filter = filterRepository.findByFilterId(FilterId(command.filterId)) ?: throw Exception("not found")
|
||||
filterRepository.delete(filter)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserDeleteFilterApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@ class UserRegisterFilterApplicationService(
|
|||
logger
|
||||
) {
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserRegisterFilterApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: RegisterFilter, executor: CommandExecutor): Filter {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -64,4 +60,8 @@ class UserRegisterFilterApplicationService(
|
|||
filterRepository.save(filter)
|
||||
return Filter.of(filter)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserRegisterFilterApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,10 +39,6 @@ class UploadMediaApplicationService(
|
|||
transaction,
|
||||
logger
|
||||
) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UploadMediaApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: UploadMedia, executor: CommandExecutor): Media {
|
||||
val process = mediaProcessor.process(command.path, command.name, null)
|
||||
val id = idGenerateService.generateId()
|
||||
|
@ -69,4 +65,8 @@ class UploadMediaApplicationService(
|
|||
|
||||
return Media.of(media)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UploadMediaApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,10 +39,6 @@ class RegisterLocalPostApplicationService(
|
|||
transaction: Transaction,
|
||||
) : AbstractApplicationService<RegisterLocalPost, Long>(transaction, Companion.logger) {
|
||||
|
||||
companion object {
|
||||
val logger: Logger = LoggerFactory.getLogger(RegisterLocalPostApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: RegisterLocalPost, executor: CommandExecutor): Long {
|
||||
val actorId = (
|
||||
userDetailRepository.findById(command.userDetailId)
|
||||
|
@ -67,4 +63,8 @@ class RegisterLocalPostApplicationService(
|
|||
|
||||
return post.id.id
|
||||
}
|
||||
|
||||
companion object {
|
||||
val logger: Logger = LoggerFactory.getLogger(RegisterLocalPostApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,10 +36,6 @@ class UserAcceptFollowRequestApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<AcceptFollowRequest, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: AcceptFollowRequest, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -55,4 +51,8 @@ class UserAcceptFollowRequestApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@ class UserBlockApplicationService(
|
|||
private val relationshipDomainService: RelationshipDomainService,
|
||||
) :
|
||||
AbstractApplicationService<Block, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: Block, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -65,4 +61,8 @@ class UserBlockApplicationService(
|
|||
relationshipRepository.save(relationship)
|
||||
relationshipRepository.save(inverseRelationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,10 +41,6 @@ class GetRelationshipApplicationService(
|
|||
transaction,
|
||||
logger
|
||||
) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(GetRelationshipApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: GetRelationship, executor: CommandExecutor): Relationship {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
val userDetail = userDetailRepository.findById(executor.userDetailId)!!
|
||||
|
@ -70,4 +66,8 @@ class GetRelationshipApplicationService(
|
|||
|
||||
return Relationship.of(relationship, relationship1, actorInstanceRelationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(GetRelationshipApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ class UserMuteApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<Mute, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: Mute, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -57,4 +53,8 @@ class UserMuteApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,10 +36,6 @@ class UserRejectFollowRequestApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<RejectFollowRequest, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: RejectFollowRequest, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -55,4 +51,8 @@ class UserRejectFollowRequestApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ class UserRemoveFromFollowersApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<RemoveFromFollowers, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: RemoveFromFollowers, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -57,4 +53,8 @@ class UserRemoveFromFollowersApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ class UserUnblockApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<Unblock, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: Unblock, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -57,4 +53,8 @@ class UserUnblockApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ class UserUnfollowApplicationService(
|
|||
private val userDetailRepository: UserDetailRepository,
|
||||
) :
|
||||
AbstractApplicationService<Unfollow, Unit>(transaction, logger) {
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
|
||||
override suspend fun internalExecute(command: Unfollow, executor: CommandExecutor) {
|
||||
require(executor is UserDetailGettableCommandExecutor)
|
||||
|
||||
|
@ -57,4 +53,8 @@ class UserUnfollowApplicationService(
|
|||
|
||||
relationshipRepository.save(relationship)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserBlockApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,9 +55,7 @@ import org.springframework.security.web.authentication.LoginUrlAuthenticationEnt
|
|||
@EnableWebSecurity(debug = true)
|
||||
class SecurityConfig {
|
||||
@Bean
|
||||
fun passwordEncoder(): PasswordEncoder {
|
||||
return BCryptPasswordEncoder()
|
||||
}
|
||||
fun passwordEncoder(): PasswordEncoder = BCryptPasswordEncoder()
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
|
@ -93,17 +91,16 @@ class SecurityConfig {
|
|||
}
|
||||
|
||||
@Bean
|
||||
fun registeredClientRepository(jdbcOperations: JdbcOperations): RegisteredClientRepository {
|
||||
return JdbcRegisteredClientRepository(jdbcOperations)
|
||||
}
|
||||
fun registeredClientRepository(jdbcOperations: JdbcOperations): RegisteredClientRepository =
|
||||
JdbcRegisteredClientRepository(jdbcOperations)
|
||||
|
||||
@Bean
|
||||
@Suppress("FunctionMaxLength")
|
||||
fun oauth2AuthorizationConsentService(
|
||||
jdbcOperations: JdbcOperations,
|
||||
registeredClientRepository: RegisteredClientRepository,
|
||||
): OAuth2AuthorizationConsentService {
|
||||
return JdbcOAuth2AuthorizationConsentService(jdbcOperations, registeredClientRepository)
|
||||
}
|
||||
): OAuth2AuthorizationConsentService =
|
||||
JdbcOAuth2AuthorizationConsentService(jdbcOperations, registeredClientRepository)
|
||||
|
||||
@Bean
|
||||
fun authorizationServerSettings(): AuthorizationServerSettings {
|
||||
|
|
|
@ -21,9 +21,8 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEvent
|
|||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventBody
|
||||
|
||||
class RelationshipEventFactory(private val relationship: Relationship) {
|
||||
fun createEvent(relationshipEvent: RelationshipEvent): DomainEvent {
|
||||
return DomainEvent.create(relationshipEvent.eventName, RelationshipEventBody(relationship))
|
||||
}
|
||||
fun createEvent(relationshipEvent: RelationshipEvent): DomainEvent =
|
||||
DomainEvent.create(relationshipEvent.eventName, RelationshipEventBody(relationship))
|
||||
}
|
||||
|
||||
class RelationshipEventBody(relationship: Relationship) : DomainEventBody(mapOf("relationship" to relationship))
|
||||
|
|
|
@ -26,7 +26,7 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventStorable
|
|||
import java.net.URI
|
||||
import java.time.Instant
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@Suppress("LongParameterList", "ClassOrdering")
|
||||
class Actor(
|
||||
val id: ActorId,
|
||||
val name: ActorName,
|
||||
|
@ -96,7 +96,7 @@ class Actor(
|
|||
|
||||
var alsoKnownAs = alsoKnownAs
|
||||
set(value) {
|
||||
require(value.find { it == id } == null)
|
||||
require(value.none { it == id })
|
||||
field = value
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
package dev.usbharu.hideout.core.domain.model.actor
|
||||
|
||||
class ActorDescription(description: String) {
|
||||
val description: String = description.take(length)
|
||||
val description: String = description.take(LENGTH)
|
||||
|
||||
companion object {
|
||||
val length = 10000
|
||||
const val LENGTH = 10000
|
||||
val empty = ActorDescription("")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ package dev.usbharu.hideout.core.domain.model.actor
|
|||
|
||||
class ActorScreenName(screenName: String) {
|
||||
|
||||
val screenName: String = screenName.take(length)
|
||||
val screenName: String = screenName.take(LENGTH)
|
||||
|
||||
companion object {
|
||||
val length = 300
|
||||
const val LENGTH = 300
|
||||
val empty = ActorScreenName("")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ class FilterKeyword(
|
|||
val id: FilterKeywordId,
|
||||
var keyword: FilterKeywordKeyword,
|
||||
val mode: FilterMode
|
||||
) {
|
||||
}
|
||||
)
|
||||
|
|
|
@ -53,7 +53,5 @@ class Instance(
|
|||
return id == other.id
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return id.hashCode()
|
||||
}
|
||||
override fun hashCode(): Int = id.hashCode()
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventStorable
|
|||
import java.net.URI
|
||||
import java.time.Instant
|
||||
|
||||
@Suppress("LongParameterList", "TooManyFunctions")
|
||||
@Suppress("LongParameterList", "TooManyFunctions", "ClassOrdering")
|
||||
class Post(
|
||||
val id: PostId,
|
||||
actorId: ActorId,
|
||||
|
|
|
@ -21,6 +21,7 @@ import dev.usbharu.hideout.core.domain.event.relationship.RelationshipEventFacto
|
|||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventStorable
|
||||
|
||||
@Suppress("TooManyFunctions")
|
||||
class Relationship(
|
||||
val actorId: ActorId,
|
||||
val targetActorId: ActorId,
|
||||
|
|
|
@ -35,17 +35,20 @@ class ActorQueryMapper(private val actorResultRowMapper: ResultRowMapper<Actor>)
|
|||
.first()
|
||||
.let(actorResultRowMapper::map)
|
||||
.apply {
|
||||
alsoKnownAs = it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow.getOrNull(
|
||||
ActorsAlsoKnownAs.alsoKnownAs
|
||||
)?.let { actorId ->
|
||||
ActorId(
|
||||
actorId
|
||||
)
|
||||
}
|
||||
}.toSet()
|
||||
alsoKnownAs = buildAlsoKnownAs(it)
|
||||
clearDomainEvents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildAlsoKnownAs(it: List<ResultRow>) =
|
||||
it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow.getOrNull(
|
||||
ActorsAlsoKnownAs.alsoKnownAs
|
||||
)?.let { actorId ->
|
||||
ActorId(
|
||||
actorId
|
||||
)
|
||||
}
|
||||
}.toSet()
|
||||
}
|
||||
|
|
|
@ -25,11 +25,13 @@ import org.springframework.stereotype.Component
|
|||
@Component
|
||||
class FilterResultRowMapper : ResultRowMapper<Filter> {
|
||||
override fun map(resultRow: ResultRow): Filter = Filter(
|
||||
FilterId(resultRow[Filters.id]),
|
||||
UserDetailId(resultRow[Filters.userId]),
|
||||
FilterName(resultRow[Filters.name]),
|
||||
resultRow[Filters.context].split(",").filter { it.isNotEmpty() }.map { FilterContext.valueOf(it) }.toSet(),
|
||||
FilterAction.valueOf(resultRow[Filters.filterAction]),
|
||||
emptySet()
|
||||
id = FilterId(resultRow[Filters.id]),
|
||||
userDetailId = UserDetailId(resultRow[Filters.userId]),
|
||||
name = FilterName(resultRow[Filters.name]),
|
||||
filterContext = resultRow[Filters.context].split(",").filter {
|
||||
it.isNotEmpty()
|
||||
}.map { FilterContext.valueOf(it) }.toSet(),
|
||||
filterAction = FilterAction.valueOf(resultRow[Filters.filterAction]),
|
||||
filterKeywords = emptySet()
|
||||
)
|
||||
}
|
||||
|
|
|
@ -39,25 +39,29 @@ class PostQueryMapper(private val postResultRowMapper: ResultRowMapper<Post>) :
|
|||
.first()
|
||||
.let(postResultRowMapper::map)
|
||||
.apply {
|
||||
reconstructWith(
|
||||
mediaIds = it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsMedia.mediaId)
|
||||
?.let { mediaId -> MediaId(mediaId) }
|
||||
},
|
||||
emojis = it
|
||||
.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsEmojis.emojiId)
|
||||
?.let { emojiId -> EmojiId(emojiId) }
|
||||
},
|
||||
visibleActors = it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsVisibleActors.actorId)
|
||||
?.let { actorId -> ActorId(actorId) }
|
||||
}.toSet()
|
||||
)
|
||||
buildPost(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Post.buildPost(it: List<ResultRow>) {
|
||||
reconstructWith(
|
||||
mediaIds = it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsMedia.mediaId)
|
||||
?.let { mediaId -> MediaId(mediaId) }
|
||||
},
|
||||
emojis = it
|
||||
.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsEmojis.emojiId)
|
||||
?.let { emojiId -> EmojiId(emojiId) }
|
||||
},
|
||||
visibleActors = it.mapNotNull { resultRow: ResultRow ->
|
||||
resultRow
|
||||
.getOrNull(PostsVisibleActors.actorId)
|
||||
?.let { actorId -> ActorId(actorId) }
|
||||
}.toSet()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,8 +107,8 @@ object Actors : Table("actors") {
|
|||
val id = long("id")
|
||||
val name = varchar("name", ActorName.LENGTH)
|
||||
val domain = varchar("domain", Domain.LENGTH)
|
||||
val screenName = varchar("screen_name", ActorScreenName.length)
|
||||
val description = varchar("description", ActorDescription.length)
|
||||
val screenName = varchar("screen_name", ActorScreenName.LENGTH)
|
||||
val description = varchar("description", ActorDescription.LENGTH)
|
||||
val inbox = varchar("inbox", 1000).uniqueIndex()
|
||||
val outbox = varchar("outbox", 1000).uniqueIndex()
|
||||
val url = varchar("url", 1000).uniqueIndex()
|
||||
|
|
|
@ -34,12 +34,12 @@ class ExposedFilterRepository(private val filterQueryMapper: QueryMapper<Filter>
|
|||
get() = Companion.logger
|
||||
|
||||
override suspend fun save(filter: Filter): Filter = query {
|
||||
Filters.upsert {
|
||||
it[id] = filter.id.id
|
||||
it[userId] = filter.userDetailId.id
|
||||
it[name] = filter.name.name
|
||||
it[context] = filter.filterContext.joinToString(",") { it.name }
|
||||
it[filterAction] = filter.filterAction.name
|
||||
Filters.upsert { upsertStatement ->
|
||||
upsertStatement[id] = filter.id.id
|
||||
upsertStatement[userId] = filter.userDetailId.id
|
||||
upsertStatement[name] = filter.name.name
|
||||
upsertStatement[context] = filter.filterContext.joinToString(",") { it.name }
|
||||
upsertStatement[filterAction] = filter.filterAction.name
|
||||
}
|
||||
FilterKeywords.deleteWhere {
|
||||
filterId eq filter.id.id
|
||||
|
|
|
@ -35,6 +35,7 @@ class PostFactoryImpl(
|
|||
private val postContentFactoryImpl: PostContentFactoryImpl,
|
||||
private val applicationConfig: ApplicationConfig,
|
||||
) {
|
||||
@Suppress("LongParameterList")
|
||||
suspend fun createLocal(
|
||||
actor: Actor,
|
||||
actorName: ActorName,
|
||||
|
|
|
@ -28,6 +28,7 @@ class FFmpegVideoProcessor(
|
|||
override fun isSupported(mimeType: MimeType): Boolean =
|
||||
mimeType.fileType == FileType.Video || mimeType.type == "video"
|
||||
|
||||
@Suppress("LongMethod", "CyclomaticComplexMethod", "CognitiveComplexMethod", "NestedBlockDepth")
|
||||
override suspend fun process(path: Path, filename: String, mimeType: MimeType?): ProcessedMedia {
|
||||
val tempFile = Files.createTempFile("hideout-movie-processor-", ".tmp")
|
||||
val thumbnailFile = Files.createTempFile("hideout-movie-thumbnail-generate-", ".tmp")
|
||||
|
|
|
@ -8,6 +8,6 @@ class ActorScreenNameTest {
|
|||
fun screenNameがlengthを超えると無視される() {
|
||||
val actorScreenName = ActorScreenName("a".repeat(1000))
|
||||
|
||||
assertEquals(ActorScreenName.length, actorScreenName.screenName.length)
|
||||
assertEquals(ActorScreenName.LENGTH, actorScreenName.screenName.length)
|
||||
}
|
||||
}
|
|
@ -2,5 +2,13 @@
|
|||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
],
|
||||
"autoApprove": true,
|
||||
"platformAutomerge": true,
|
||||
"prHourlyLimit": 0,
|
||||
"labels": [
|
||||
"dependencies",
|
||||
"renovate"
|
||||
],
|
||||
"prConcurrentLimit": 5
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue