feat: 実装を忘れていたエンドポイントを実装

This commit is contained in:
usbharu 2024-02-13 14:06:58 +09:00
parent d67a71dd57
commit 70deaa92c6
1 changed files with 26 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import dev.usbharu.hideout.controller.mastodon.generated.FilterApi
import dev.usbharu.hideout.core.infrastructure.springframework.security.LoginUserContextHolder
import dev.usbharu.hideout.domain.mastodon.model.generated.*
import dev.usbharu.hideout.mastodon.service.filter.MastodonFilterApiService
import kotlinx.coroutines.flow.Flow
import org.springframework.http.ResponseEntity
import org.springframework.stereotype.Controller
@ -70,6 +71,31 @@ class MastodonFilterApiController(
)
}
override fun apiV1FiltersGet(): ResponseEntity<Flow<V1Filter>> =
ResponseEntity.ok(mastodonFilterApiService.v1Filters(loginUserContextHolder.getLoginUserId()))
override fun apiV2FiltersFilterIdKeywordsGet(filterId: String): ResponseEntity<Flow<FilterKeyword>> {
return ResponseEntity.ok(
mastodonFilterApiService.filterKeywords(
loginUserContextHolder.getLoginUserId(),
filterId.toLong()
)
)
}
override fun apiV2FiltersFilterIdStatusesGet(filterId: String): ResponseEntity<Flow<FilterStatus>> {
return ResponseEntity.ok(
mastodonFilterApiService.filterStatuses(
loginUserContextHolder.getLoginUserId(),
filterId.toLong()
)
)
}
override fun apiV2FiltersGet(): ResponseEntity<Flow<Filter>> {
return ResponseEntity.ok(mastodonFilterApiService.filters(loginUserContextHolder.getLoginUserId()))
}
override suspend fun apiV2FiltersIdDelete(id: String): ResponseEntity<Any> {
mastodonFilterApiService.deleteById(loginUserContextHolder.getLoginUserId(), id.toLong())
return ResponseEntity.ok().build()