mirror of https://github.com/usbharu/Hideout.git
style: fix lint
This commit is contained in:
parent
41d1e59322
commit
7189159cb0
|
@ -3,4 +3,4 @@ package dev.usbharu.hideout.core.domain.model.filter
|
|||
enum class FilterAction {
|
||||
warn,
|
||||
hide
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,4 +4,4 @@ enum class FilterMode {
|
|||
WHOLE_WORD,
|
||||
REGEX,
|
||||
NONE
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,4 +11,4 @@ interface FilterRepository {
|
|||
suspend fun deleteById(id: Long)
|
||||
|
||||
suspend fun deleteByUserIdAndId(userId: Long, id: Long)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,4 @@ enum class FilterType {
|
|||
public,
|
||||
thread,
|
||||
account
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ data class FilterKeyword(
|
|||
val filterId: Long,
|
||||
val keyword: String,
|
||||
val mode: FilterMode
|
||||
)
|
||||
)
|
||||
|
|
|
@ -7,4 +7,4 @@ interface FilterKeywordRepository {
|
|||
suspend fun findById(id: Long): FilterKeyword?
|
||||
suspend fun deleteById(id: Long)
|
||||
suspend fun deleteByFilterId(filterId: Long)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,4 +79,4 @@ object FilterKeywords : Table() {
|
|||
val mode = varchar("mode", 100)
|
||||
|
||||
override val primaryKey: PrimaryKey = PrimaryKey(id)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,4 +23,4 @@ data class FilterQueryModel(
|
|||
keywords
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ interface FilterQueryService {
|
|||
suspend fun findByUserId(userId: Long): List<FilterQueryModel>
|
||||
suspend fun findByUserIdAndId(userId: Long, id: Long): FilterQueryModel?
|
||||
suspend fun findByUserIdAndKeywordId(userId: Long, keywordId: Long): FilterQueryModel?
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,4 +11,4 @@ interface MuteProcessService {
|
|||
context: List<FilterType>,
|
||||
filters: List<FilterQueryModel>
|
||||
): Map<Post, FilterResult>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ class MuteProcessServiceImpl : MuteProcessService {
|
|||
it,
|
||||
precompileRegex(it)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
return filterQueryModelList
|
||||
|
@ -93,11 +92,9 @@ class MuteProcessServiceImpl : MuteProcessService {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
val noneRegex = noneRegexStrings.joinToString("|", "(", ")")
|
||||
val wholeRegex = wholeRegexStrings.joinToString("|", "\\b(", ")\\b")
|
||||
|
||||
|
||||
val regex = if (noneRegexStrings.isNotEmpty() && wholeRegexStrings.isNotEmpty()) {
|
||||
Regex("$noneRegex|$wholeRegex")
|
||||
} else if (noneRegexStrings.isNotEmpty()) {
|
||||
|
@ -123,4 +120,4 @@ class MuteProcessServiceImpl : MuteProcessService {
|
|||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(MuteProcessServiceImpl::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,4 +16,4 @@ interface MuteService {
|
|||
suspend fun getFilters(userId: Long, types: List<FilterType> = emptyList()): List<FilterQueryModel>
|
||||
|
||||
suspend fun deleteFilter(filterId: Long)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,4 +52,4 @@ class MuteServiceImpl(
|
|||
filterKeywordRepository.deleteByFilterId(filterId)
|
||||
filterRepository.deleteById(filterId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package dev.usbharu.hideout.mastodon.interfaces.api.filter
|
|||
|
||||
import dev.usbharu.hideout.controller.mastodon.generated.FilterApi
|
||||
import dev.usbharu.hideout.domain.mastodon.model.generated.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.stereotype.Controller
|
||||
|
||||
|
@ -95,4 +94,4 @@ class MastodonFilterApiController : FilterApi {
|
|||
override suspend fun apiV2FiltersStatusesIdGet(id: String): ResponseEntity<FilterStatus> {
|
||||
return super.apiV2FiltersStatusesIdGet(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -285,4 +285,4 @@ class MastodonFilterApiServiceImpl(
|
|||
override suspend fun getFilterStatusById(userId: Long, filterPostsId: Long): FilterStatus? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue