fix: JavaScriptがBigIntを扱えない問題を修正

This commit is contained in:
usbharu 2023-08-08 17:37:40 +09:00
parent c02dee4096
commit 58e301cf71
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
6 changed files with 15 additions and 22 deletions

View File

@ -59,7 +59,7 @@ kotlin {
} }
sourceSets.main { sourceSets.main {
java.srcDirs("build/generated/ksp/main/kotlin") kotlin.srcDirs("$buildDir/generated/ksp/main")
} }
dependencies { dependencies {

View File

@ -5,7 +5,7 @@ import dev.usbharu.hideout.domain.model.hideout.entity.User
import dev.usbharu.hideout.domain.model.hideout.entity.Visibility import dev.usbharu.hideout.domain.model.hideout.entity.Visibility
data class PostResponse( data class PostResponse(
val id: Long, val id: String,
val user: UserResponse, val user: UserResponse,
val overview: String? = null, val overview: String? = null,
val text: String? = null, val text: String? = null,
@ -17,7 +17,7 @@ data class PostResponse(
companion object { companion object {
fun from(post: Post, user: User): PostResponse { fun from(post: Post, user: User): PostResponse {
return PostResponse( return PostResponse(
id = post.id, id = post.id.toString(),
user = UserResponse.from(user), user = UserResponse.from(user),
overview = post.overview, overview = post.overview,
text = post.text, text = post.text,

View File

@ -3,7 +3,7 @@ package dev.usbharu.hideout.domain.model.hideout.dto
import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.domain.model.hideout.entity.User
data class UserResponse( data class UserResponse(
val id: Long, val id: String,
val name: String, val name: String,
val domain: String, val domain: String,
val screenName: String, val screenName: String,
@ -14,7 +14,7 @@ data class UserResponse(
companion object { companion object {
fun from(user: User): UserResponse { fun from(user: User): UserResponse {
return UserResponse( return UserResponse(
id = user.id, id = user.id.toString(),
name = user.name, name = user.name,
domain = user.domain, domain = user.domain,
screenName = user.screenName, screenName = user.screenName,

View File

@ -13,9 +13,9 @@ import dev.usbharu.hideout.service.activitypub.ActivityPubUserService
import dev.usbharu.hideout.service.api.IPostApiService import dev.usbharu.hideout.service.api.IPostApiService
import dev.usbharu.hideout.service.api.IUserApiService import dev.usbharu.hideout.service.api.IUserApiService
import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService
import dev.usbharu.hideout.service.reaction.IReactionService
import dev.usbharu.hideout.service.auth.IJwtService import dev.usbharu.hideout.service.auth.IJwtService
import dev.usbharu.hideout.service.core.IMetaService import dev.usbharu.hideout.service.core.IMetaService
import dev.usbharu.hideout.service.reaction.IReactionService
import dev.usbharu.hideout.service.user.IUserAuthService import dev.usbharu.hideout.service.user.IUserAuthService
import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.service.user.IUserService
import io.ktor.server.application.* import io.ktor.server.application.*

View File

@ -81,7 +81,7 @@ fun Route.users(userService: IUserService, userApiService: IUserApiService) {
} }
val acct = AcctUtil.parse(userParameter) val acct = AcctUtil.parse(userParameter)
val targetUser = userApiService.findByAcct(acct) val targetUser = userApiService.findByAcct(acct)
if (userService.followRequest(targetUser.id, userId)) { if (userService.followRequest(targetUser.id.toLong(), userId)) {
return@post call.respond(HttpStatusCode.OK) return@post call.respond(HttpStatusCode.OK)
} else { } else {
return@post call.respond(HttpStatusCode.Accepted) return@post call.respond(HttpStatusCode.Accepted)

View File

@ -355,8 +355,7 @@ components:
description: 投稿ID description: 投稿ID
required: true required: true
schema: schema:
type: integer type: string
format: int64
userName: userName:
name: userName name: userName
in: path in: path
@ -385,8 +384,7 @@ components:
- createdAt - createdAt
properties: properties:
id: id:
type: number type: string
format: int64
readOnly: true readOnly: true
name: name:
type: string type: string
@ -402,7 +400,7 @@ components:
type: string type: string
readOnly: true readOnly: true
createdAt: createdAt:
type: number type: integer
readOnly: true readOnly: true
PostResponse: PostResponse:
type: object type: object
@ -416,8 +414,7 @@ components:
- sensitive - sensitive
properties: properties:
id: id:
type: integer type: string
format: int64
readOnly: true readOnly: true
user: user:
$ref: "#/components/schemas/UserResponse" $ref: "#/components/schemas/UserResponse"
@ -436,12 +433,10 @@ components:
format: uri format: uri
readOnly: true readOnly: true
repostId: repostId:
type: integer type: string
format: int64
readOnly: true readOnly: true
replyId: replyId:
type: integer type: string
format: int64
readOnly: true readOnly: true
sensitive: sensitive:
type: boolean type: boolean
@ -456,11 +451,9 @@ components:
visibility: visibility:
$ref: "#/components/schemas/Visibility" $ref: "#/components/schemas/Visibility"
repostId: repostId:
type: integer type: string
format: int64
replyId: replyId:
type: integer type: string
format: int64
sensitive: sensitive:
type: boolean type: boolean