From dbbadd2a607df9c618bdc667a0a8f1edf9420e50 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Sat, 29 Nov 2025 19:16:06 +0900 Subject: [PATCH 1/4] dto 1.0.30 --- share/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/package.json b/share/package.json index afc3167..d4c3658 100644 --- a/share/package.json +++ b/share/package.json @@ -1,6 +1,6 @@ { "name": "@grimity/dto", - "version": "1.0.29", + "version": "1.0.30", "types": "dist/share/index.d.ts", "exports": { ".": { From 3a381720a9faf7e09e374d860518f0e865a812f5 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Tue, 2 Dec 2025 18:34:40 +0900 Subject: [PATCH 2/4] dd --- src/module/album/album.controller.ts | 2 +- ...{album.request.ts => album.api.request.ts} | 0 ...bum.response.ts => album.base.response.ts} | 0 src/module/album/dto/index.ts | 4 +-- src/module/auth/auth.controller.ts | 4 +-- .../{auth.request.ts => auth.api.request.ts} | 0 ...{auth.response.ts => auth.api.response.ts} | 0 src/module/auth/dto/index.ts | 4 +-- src/module/chat/chat-message.controller.ts | 4 +-- src/module/chat/chat.controller.ts | 4 +-- ...request.ts => chat-message.api.request.ts} | 0 ...sponse.ts => chat-message.api.response.ts} | 21 ++--------- .../chat/dto/chat-message.base.response.ts | 19 ++++++++++ .../{chat.request.ts => chat.api.request.ts} | 0 ...{chat.response.ts => chat.api.response.ts} | 4 +-- src/module/chat/dto/index.ts | 9 ++--- ...request.ts => feed-comment.api.request.ts} | 0 ...sponse.ts => feed-comment.api.response.ts} | 21 +++-------- .../dto/feed-comment.base.response.ts | 15 ++++++++ src/module/feed-comment/dto/index.ts | 6 ++-- .../feed-comment/feed-comment.controller.ts | 4 +-- .../{feed.request.ts => feed.api.request.ts} | 0 ...{feed.response.ts => feed.api.response.ts} | 36 ++----------------- src/module/feed/dto/feed.base.response.ts | 32 +++++++++++++++++ src/module/feed/dto/index.ts | 6 ++-- src/module/feed/feed.controller.ts | 6 ++-- .../post-comment/dto/post-comment.response.ts | 2 +- src/module/post/dto/index.ts | 4 +-- .../{post.request.ts => post.api.request.ts} | 0 ...{post.response.ts => post.api.response.ts} | 30 ++++------------ src/module/post/dto/post.base.response.ts | 30 ++++++++++++++++ src/module/post/post.controller.ts | 4 +-- src/module/user/dto/index.ts | 6 ++-- .../{user.request.ts => user.api.request.ts} | 0 ...{user.response.ts => user.api.response.ts} | 4 +-- ....dto.response.ts => user.base.response.ts} | 0 src/module/user/me.controller.ts | 10 +++--- src/module/user/user.controller.ts | 8 ++--- 38 files changed, 162 insertions(+), 137 deletions(-) rename src/module/album/dto/{album.request.ts => album.api.request.ts} (100%) rename src/module/album/dto/{album.response.ts => album.base.response.ts} (100%) rename src/module/auth/dto/{auth.request.ts => auth.api.request.ts} (100%) rename src/module/auth/dto/{auth.response.ts => auth.api.response.ts} (100%) rename src/module/chat/dto/{chat-message.request.ts => chat-message.api.request.ts} (100%) rename src/module/chat/dto/{chat-message.response.ts => chat-message.api.response.ts} (76%) create mode 100644 src/module/chat/dto/chat-message.base.response.ts rename src/module/chat/dto/{chat.request.ts => chat.api.request.ts} (100%) rename src/module/chat/dto/{chat.response.ts => chat.api.response.ts} (87%) rename src/module/feed-comment/dto/{feed-comment.request.ts => feed-comment.api.request.ts} (100%) rename src/module/feed-comment/dto/{feed-comment.response.ts => feed-comment.api.response.ts} (50%) create mode 100644 src/module/feed-comment/dto/feed-comment.base.response.ts rename src/module/feed/dto/{feed.request.ts => feed.api.request.ts} (100%) rename src/module/feed/dto/{feed.response.ts => feed.api.response.ts} (83%) create mode 100644 src/module/feed/dto/feed.base.response.ts rename src/module/post/dto/{post.request.ts => post.api.request.ts} (100%) rename src/module/post/dto/{post.response.ts => post.api.response.ts} (63%) create mode 100644 src/module/post/dto/post.base.response.ts rename src/module/user/dto/{user.request.ts => user.api.request.ts} (100%) rename src/module/user/dto/{user.response.ts => user.api.response.ts} (97%) rename src/module/user/dto/{user.dto.response.ts => user.base.response.ts} (100%) diff --git a/src/module/album/album.controller.ts b/src/module/album/album.controller.ts index 3e5a17e..fdea591 100644 --- a/src/module/album/album.controller.ts +++ b/src/module/album/album.controller.ts @@ -17,7 +17,7 @@ import { UpdateAlbumOrderRequest, InsertFeedsRequest, RemoveFeedsAlbumRequest, -} from './dto/album.request'; +} from './dto/album.api.request'; import { ApiTags, ApiResponse, diff --git a/src/module/album/dto/album.request.ts b/src/module/album/dto/album.api.request.ts similarity index 100% rename from src/module/album/dto/album.request.ts rename to src/module/album/dto/album.api.request.ts diff --git a/src/module/album/dto/album.response.ts b/src/module/album/dto/album.base.response.ts similarity index 100% rename from src/module/album/dto/album.response.ts rename to src/module/album/dto/album.base.response.ts diff --git a/src/module/album/dto/index.ts b/src/module/album/dto/index.ts index 80f1d38..843f7a0 100644 --- a/src/module/album/dto/index.ts +++ b/src/module/album/dto/index.ts @@ -1,2 +1,2 @@ -export * from './album.request'; -export * from './album.response'; +export * from './album.api.request'; +export * from './album.base.response'; diff --git a/src/module/auth/auth.controller.ts b/src/module/auth/auth.controller.ts index 16829a2..015cd5d 100644 --- a/src/module/auth/auth.controller.ts +++ b/src/module/auth/auth.controller.ts @@ -15,12 +15,12 @@ import { ApiHeader, } from '@nestjs/swagger'; import { AuthService } from 'src/module/auth/auth.service'; -import { LoginRequest, RegisterRequest } from './dto/auth.request'; +import { LoginRequest, RegisterRequest } from './dto/auth.api.request'; import { LoginResponse, JwtResponse, Register409Response, -} from './dto/auth.response'; +} from './dto/auth.api.response'; import { GetClientInfo, GetRefreshToken, diff --git a/src/module/auth/dto/auth.request.ts b/src/module/auth/dto/auth.api.request.ts similarity index 100% rename from src/module/auth/dto/auth.request.ts rename to src/module/auth/dto/auth.api.request.ts diff --git a/src/module/auth/dto/auth.response.ts b/src/module/auth/dto/auth.api.response.ts similarity index 100% rename from src/module/auth/dto/auth.response.ts rename to src/module/auth/dto/auth.api.response.ts diff --git a/src/module/auth/dto/index.ts b/src/module/auth/dto/index.ts index 841c9ae..9b2c200 100644 --- a/src/module/auth/dto/index.ts +++ b/src/module/auth/dto/index.ts @@ -1,2 +1,2 @@ -export * from './auth.request'; -export * from './auth.response'; +export * from './auth.api.request'; +export * from './auth.api.response'; diff --git a/src/module/chat/chat-message.controller.ts b/src/module/chat/chat-message.controller.ts index 77a3f48..ede203e 100644 --- a/src/module/chat/chat-message.controller.ts +++ b/src/module/chat/chat-message.controller.ts @@ -22,8 +22,8 @@ import { JwtGuard } from 'src/core/guard'; import { CreateChatMessageRequest, GetChatMessagesRequest, -} from './dto/chat-message.request'; -import { ChatMessagesResponse } from './dto/chat-message.response'; +} from './dto/chat-message.api.request'; +import { ChatMessagesResponse } from './dto/chat-message.api.response'; import { ChatMessageService } from './chat-message.service'; import { CurrentUser } from 'src/core/decorator'; diff --git a/src/module/chat/chat.controller.ts b/src/module/chat/chat.controller.ts index eb8cf64..2e1d931 100644 --- a/src/module/chat/chat.controller.ts +++ b/src/module/chat/chat.controller.ts @@ -23,12 +23,12 @@ import { JoinChatRequest, LeaveChatRequest, BatchDeleteChatsRequest, -} from './dto/chat.request'; +} from './dto/chat.api.request'; import { JwtGuard } from 'src/core/guard'; import { CurrentUser } from 'src/core/decorator'; import { ChatService } from './chat.service'; import { IdResponse } from 'src/shared/response'; -import { ChatsResponse } from './dto/chat.response'; +import { ChatsResponse } from './dto/chat.api.response'; import { UserBaseResponse, UserBaseWithBlockedResponse } from '../user/dto'; @ApiTags('/chats') diff --git a/src/module/chat/dto/chat-message.request.ts b/src/module/chat/dto/chat-message.api.request.ts similarity index 100% rename from src/module/chat/dto/chat-message.request.ts rename to src/module/chat/dto/chat-message.api.request.ts diff --git a/src/module/chat/dto/chat-message.response.ts b/src/module/chat/dto/chat-message.api.response.ts similarity index 76% rename from src/module/chat/dto/chat-message.response.ts rename to src/module/chat/dto/chat-message.api.response.ts index 9b18639..2373a30 100644 --- a/src/module/chat/dto/chat-message.response.ts +++ b/src/module/chat/dto/chat-message.api.response.ts @@ -1,24 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { CursorResponse } from '../../../shared/response'; -import { UserBaseResponse } from '../../../module/user/dto'; - -export class ChatMessageBaseResponse { - @ApiProperty() - id: string; - - @ApiProperty({ type: 'string', nullable: true }) - content: string | null; - - @ApiProperty({ - type: 'string', - nullable: true, - example: 'https://image.grimity.com/chat/123.webp', - }) - image: string | null; - - @ApiProperty() - createdAt: Date; -} +import { UserBaseResponse } from '../../user/dto'; +import { ChatMessageBaseResponse } from './chat-message.base.response'; export class ReplyToResponse extends ChatMessageBaseResponse {} diff --git a/src/module/chat/dto/chat-message.base.response.ts b/src/module/chat/dto/chat-message.base.response.ts new file mode 100644 index 0000000..5ed9007 --- /dev/null +++ b/src/module/chat/dto/chat-message.base.response.ts @@ -0,0 +1,19 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class ChatMessageBaseResponse { + @ApiProperty() + id: string; + + @ApiProperty({ type: 'string', nullable: true }) + content: string | null; + + @ApiProperty({ + type: 'string', + nullable: true, + example: 'https://image.grimity.com/chat/123.webp', + }) + image: string | null; + + @ApiProperty() + createdAt: Date; +} diff --git a/src/module/chat/dto/chat.request.ts b/src/module/chat/dto/chat.api.request.ts similarity index 100% rename from src/module/chat/dto/chat.request.ts rename to src/module/chat/dto/chat.api.request.ts diff --git a/src/module/chat/dto/chat.response.ts b/src/module/chat/dto/chat.api.response.ts similarity index 87% rename from src/module/chat/dto/chat.response.ts rename to src/module/chat/dto/chat.api.response.ts index 6239fd0..47af0bf 100644 --- a/src/module/chat/dto/chat.response.ts +++ b/src/module/chat/dto/chat.api.response.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { CursorResponse } from '../../../shared/response'; -import { UserBaseResponse } from '../../../module/user/dto'; -import { ChatMessageBaseResponse } from './chat-message.response'; +import { UserBaseResponse } from '../../user/dto'; +import { ChatMessageBaseResponse } from './chat-message.base.response'; export class LastChatMessageResponse extends ChatMessageBaseResponse { @ApiProperty({ diff --git a/src/module/chat/dto/index.ts b/src/module/chat/dto/index.ts index 2691669..5309d58 100644 --- a/src/module/chat/dto/index.ts +++ b/src/module/chat/dto/index.ts @@ -1,5 +1,6 @@ -export * from './chat.request'; -export * from './chat.response'; +export * from './chat.api.request'; +export * from './chat.api.response'; -export * from './chat-message.request'; -export * from './chat-message.response'; +export * from './chat-message.base.response'; +export * from './chat-message.api.request'; +export * from './chat-message.api.response'; diff --git a/src/module/feed-comment/dto/feed-comment.request.ts b/src/module/feed-comment/dto/feed-comment.api.request.ts similarity index 100% rename from src/module/feed-comment/dto/feed-comment.request.ts rename to src/module/feed-comment/dto/feed-comment.api.request.ts diff --git a/src/module/feed-comment/dto/feed-comment.response.ts b/src/module/feed-comment/dto/feed-comment.api.response.ts similarity index 50% rename from src/module/feed-comment/dto/feed-comment.response.ts rename to src/module/feed-comment/dto/feed-comment.api.response.ts index 13e2783..dfd1602 100644 --- a/src/module/feed-comment/dto/feed-comment.response.ts +++ b/src/module/feed-comment/dto/feed-comment.api.response.ts @@ -1,24 +1,13 @@ import { ApiProperty } from '@nestjs/swagger'; -import { UserBaseResponse } from '../../user/dto/user.dto.response'; - -export class FeedCommentBaseResponse { - @ApiProperty() - id: string; - - @ApiProperty() - content: string; - - @ApiProperty() - createdAt: Date; - - @ApiProperty() - likeCount: number; +import { UserBaseResponse } from '../../user/dto/user.base.response'; +import { FeedCommentBaseResponse } from './feed-comment.base.response'; +export class FeedCommentWithWriterResponse extends FeedCommentBaseResponse { @ApiProperty({ type: UserBaseResponse }) writer: UserBaseResponse; } -export class ChildFeedCommentResponse extends FeedCommentBaseResponse { +export class ChildFeedCommentResponse extends FeedCommentWithWriterResponse { @ApiProperty({ type: UserBaseResponse, nullable: true }) mentionedUser: UserBaseResponse | null; @@ -26,7 +15,7 @@ export class ChildFeedCommentResponse extends FeedCommentBaseResponse { isLike: boolean; } -export class ParentFeedCommentResponse extends FeedCommentBaseResponse { +export class ParentFeedCommentResponse extends FeedCommentWithWriterResponse { @ApiProperty({ type: ChildFeedCommentResponse, isArray: true }) childComments: ChildFeedCommentResponse[]; diff --git a/src/module/feed-comment/dto/feed-comment.base.response.ts b/src/module/feed-comment/dto/feed-comment.base.response.ts new file mode 100644 index 0000000..e33dc56 --- /dev/null +++ b/src/module/feed-comment/dto/feed-comment.base.response.ts @@ -0,0 +1,15 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class FeedCommentBaseResponse { + @ApiProperty() + id: string; + + @ApiProperty() + content: string; + + @ApiProperty() + createdAt: Date; + + @ApiProperty() + likeCount: number; +} diff --git a/src/module/feed-comment/dto/index.ts b/src/module/feed-comment/dto/index.ts index 28e028d..823f3ce 100644 --- a/src/module/feed-comment/dto/index.ts +++ b/src/module/feed-comment/dto/index.ts @@ -1,2 +1,4 @@ -export * from './feed-comment.request'; -export * from './feed-comment.response'; +export * from './feed-comment.base.response'; + +export * from './feed-comment.api.request'; +export * from './feed-comment.api.response'; diff --git a/src/module/feed-comment/feed-comment.controller.ts b/src/module/feed-comment/feed-comment.controller.ts index a30fd61..acffb6a 100644 --- a/src/module/feed-comment/feed-comment.controller.ts +++ b/src/module/feed-comment/feed-comment.controller.ts @@ -24,8 +24,8 @@ import { CurrentUser } from 'src/core/decorator'; import { CreateFeedCommentRequest, GetFeedCommentRequest, -} from './dto/feed-comment.request'; -import { ParentFeedCommentResponse } from './dto/feed-comment.response'; +} from './dto/feed-comment.api.request'; +import { ParentFeedCommentResponse } from './dto/feed-comment.api.response'; @ApiTags('/feed-comments') @ApiResponse({ status: 400, description: '유효성 검사 실패' }) diff --git a/src/module/feed/dto/feed.request.ts b/src/module/feed/dto/feed.api.request.ts similarity index 100% rename from src/module/feed/dto/feed.request.ts rename to src/module/feed/dto/feed.api.request.ts diff --git a/src/module/feed/dto/feed.response.ts b/src/module/feed/dto/feed.api.response.ts similarity index 83% rename from src/module/feed/dto/feed.response.ts rename to src/module/feed/dto/feed.api.response.ts index acbdc2d..61742ca 100644 --- a/src/module/feed/dto/feed.response.ts +++ b/src/module/feed/dto/feed.api.response.ts @@ -2,45 +2,13 @@ import { ApiProperty } from '@nestjs/swagger'; import { UserBaseResponse, UserBaseWithBlockedResponse, -} from '../../user/dto/user.dto.response'; +} from '../../user/dto/user.base.response'; import { CursorAndCountResponse, CursorResponse, } from '../../../shared/response/cursor.response'; -import { AlbumBaseResponse } from '../../album/dto/album.response'; import { FeedCommentBaseResponse } from 'src/module/feed-comment/dto'; - -// 최소단위 -export class FeedBaseResponse { - @ApiProperty() - id: string; - - @ApiProperty() - title: string; - - @ApiProperty({ example: 'feed/UUID.webp' }) - thumbnail: string; - - @ApiProperty() - likeCount: number; - - @ApiProperty() - viewCount: number; -} - -export class FeedResponse extends FeedBaseResponse { - @ApiProperty({ type: 'string', isArray: true, example: ['feed/UUID.webp'] }) - cards: string[]; - - @ApiProperty() - createdAt: Date; - - @ApiProperty() - content: string; - - @ApiProperty() - tags: string[]; -} +import { FeedBaseResponse, FeedResponse } from './feed.base.response'; export class SearchedFeedResponse extends FeedBaseResponse { @ApiProperty({ type: UserBaseResponse }) diff --git a/src/module/feed/dto/feed.base.response.ts b/src/module/feed/dto/feed.base.response.ts new file mode 100644 index 0000000..0d0665b --- /dev/null +++ b/src/module/feed/dto/feed.base.response.ts @@ -0,0 +1,32 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class FeedBaseResponse { + @ApiProperty() + id: string; + + @ApiProperty() + title: string; + + @ApiProperty({ example: 'feed/UUID.webp' }) + thumbnail: string; + + @ApiProperty() + likeCount: number; + + @ApiProperty() + viewCount: number; +} + +export class FeedResponse extends FeedBaseResponse { + @ApiProperty({ type: 'string', isArray: true, example: ['feed/UUID.webp'] }) + cards: string[]; + + @ApiProperty() + createdAt: Date; + + @ApiProperty() + content: string; + + @ApiProperty() + tags: string[]; +} diff --git a/src/module/feed/dto/index.ts b/src/module/feed/dto/index.ts index 8738191..cecdc2f 100644 --- a/src/module/feed/dto/index.ts +++ b/src/module/feed/dto/index.ts @@ -1,2 +1,4 @@ -export * from './feed.request'; -export * from './feed.response'; +export * from './feed.base.response'; + +export * from './feed.api.request'; +export * from './feed.api.response'; diff --git a/src/module/feed/feed.controller.ts b/src/module/feed/feed.controller.ts index cb466ec..e077fd4 100644 --- a/src/module/feed/feed.controller.ts +++ b/src/module/feed/feed.controller.ts @@ -26,7 +26,7 @@ import { UpdateFeedRequest, DeleteFeedsRequest, GetRankingsRequest, -} from './dto/feed.request'; +} from './dto/feed.api.request'; import { IdResponse } from 'src/shared/response/id.response'; import { SearchedFeedsResponse, @@ -35,8 +35,8 @@ import { FeedDetailResponse, FeedMetaResponse, FeedRankingsResponse, -} from './dto/feed.response'; -import { FeedLikedUserResponse } from '../user/dto/user.response'; +} from './dto/feed.api.response'; +import { FeedLikedUserResponse } from '../user/dto/user.api.response'; import { JwtGuard, OptionalJwtGuard } from 'src/core/guard'; import { CurrentUser } from 'src/core/decorator'; diff --git a/src/module/post-comment/dto/post-comment.response.ts b/src/module/post-comment/dto/post-comment.response.ts index bbd890e..147cfde 100644 --- a/src/module/post-comment/dto/post-comment.response.ts +++ b/src/module/post-comment/dto/post-comment.response.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { UserBaseResponse } from '../../user/dto/user.dto.response'; +import { UserBaseResponse } from '../../user/dto/user.base.response'; export class PostCommentBaseResponse { @ApiProperty() diff --git a/src/module/post/dto/index.ts b/src/module/post/dto/index.ts index 05f69a3..75c028a 100644 --- a/src/module/post/dto/index.ts +++ b/src/module/post/dto/index.ts @@ -1,2 +1,2 @@ -export * from './post.request'; -export * from './post.response'; +export * from './post.api.request'; +export * from './post.api.response'; diff --git a/src/module/post/dto/post.request.ts b/src/module/post/dto/post.api.request.ts similarity index 100% rename from src/module/post/dto/post.request.ts rename to src/module/post/dto/post.api.request.ts diff --git a/src/module/post/dto/post.response.ts b/src/module/post/dto/post.api.response.ts similarity index 63% rename from src/module/post/dto/post.response.ts rename to src/module/post/dto/post.api.response.ts index 2ab2b0b..77aaf80 100644 --- a/src/module/post/dto/post.response.ts +++ b/src/module/post/dto/post.api.response.ts @@ -2,25 +2,9 @@ import { ApiProperty } from '@nestjs/swagger'; import { UserBaseResponse } from '../../user/dto'; import { TotalCountResponse } from '../../../shared/response/total-count.response'; import { postTypes } from '../../../common/constants/post.constant'; +import { PostBaseResponse, PostResponse } from './post.base.response'; -export class PostBaseResponse { - @ApiProperty() - id: string; - - @ApiProperty() - title: string; - - @ApiProperty() - content: string; - - @ApiProperty({ type: 'string', nullable: true, description: 'FULL URL' }) - thumbnail: string | null; - - @ApiProperty() - createdAt: Date; -} - -export class PostResponse extends PostBaseResponse { +export class PostWithAuthorResponse extends PostResponse { @ApiProperty({ enum: postTypes }) type: (typeof postTypes)[number]; @@ -35,11 +19,11 @@ export class PostResponse extends PostBaseResponse { } export class PostsResponse extends TotalCountResponse { - @ApiProperty({ type: PostResponse, isArray: true }) - posts: PostResponse[]; + @ApiProperty({ type: PostWithAuthorResponse, isArray: true }) + posts: PostWithAuthorResponse[]; } -export class PostDetailResponse extends PostResponse { +export class PostDetailResponse extends PostWithAuthorResponse { @ApiProperty() likeCount: number; @@ -51,8 +35,8 @@ export class PostDetailResponse extends PostResponse { } export class MySavePostsResponse extends TotalCountResponse { - @ApiProperty({ type: PostResponse, isArray: true }) - posts: PostResponse[]; + @ApiProperty({ type: PostWithAuthorResponse, isArray: true }) + posts: PostWithAuthorResponse[]; } export class MyPostResponse extends PostBaseResponse { diff --git a/src/module/post/dto/post.base.response.ts b/src/module/post/dto/post.base.response.ts new file mode 100644 index 0000000..67c8a27 --- /dev/null +++ b/src/module/post/dto/post.base.response.ts @@ -0,0 +1,30 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { postTypes } from '../../../common/constants/post.constant'; + +export class PostBaseResponse { + @ApiProperty() + id: string; + + @ApiProperty() + title: string; + + @ApiProperty() + content: string; + + @ApiProperty({ type: 'string', nullable: true, description: 'FULL URL' }) + thumbnail: string | null; + + @ApiProperty() + createdAt: Date; +} + +export class PostResponse extends PostBaseResponse { + @ApiProperty({ enum: postTypes }) + type: (typeof postTypes)[number]; + + @ApiProperty() + viewCount: number; + + @ApiProperty() + commentCount: number; +} diff --git a/src/module/post/post.controller.ts b/src/module/post/post.controller.ts index 6da5fff..f6b35ef 100644 --- a/src/module/post/post.controller.ts +++ b/src/module/post/post.controller.ts @@ -25,14 +25,14 @@ import { CreatePostRequest, GetPostsRequest, SearchPostRequest, -} from './dto/post.request'; +} from './dto/post.api.request'; import { IdResponse } from 'src/shared/response/id.response'; import { PostBaseResponse, PostResponse, PostsResponse, PostDetailResponse, -} from './dto/post.response'; +} from './dto/post.api.response'; @ApiTags('/posts') @ApiResponse({ status: 401, description: 'Unauthorized' }) diff --git a/src/module/user/dto/index.ts b/src/module/user/dto/index.ts index 4c4d935..691c818 100644 --- a/src/module/user/dto/index.ts +++ b/src/module/user/dto/index.ts @@ -1,4 +1,4 @@ -export * from './user.dto.response'; +export * from './user.base.response'; -export * from './user.request'; -export * from './user.response'; +export * from './user.api.request'; +export * from './user.api.response'; diff --git a/src/module/user/dto/user.request.ts b/src/module/user/dto/user.api.request.ts similarity index 100% rename from src/module/user/dto/user.request.ts rename to src/module/user/dto/user.api.request.ts diff --git a/src/module/user/dto/user.response.ts b/src/module/user/dto/user.api.response.ts similarity index 97% rename from src/module/user/dto/user.response.ts rename to src/module/user/dto/user.api.response.ts index e4762a0..4cf1378 100644 --- a/src/module/user/dto/user.response.ts +++ b/src/module/user/dto/user.api.response.ts @@ -5,11 +5,11 @@ import { CursorAndCountResponse, } from '../../../shared/response/cursor.response'; import { ConflictResponse } from '../../../shared/response/conflict.response'; -import { AlbumBaseResponse } from '../../album/dto/album.response'; +import { AlbumBaseResponse } from '../../album/dto/album.base.response'; import { UserBaseResponse, UserBaseWithBlockedResponse, -} from './user.dto.response'; +} from './user.base.response'; export class LinkResponse { @ApiProperty({ example: '인스타그램' }) diff --git a/src/module/user/dto/user.dto.response.ts b/src/module/user/dto/user.base.response.ts similarity index 100% rename from src/module/user/dto/user.dto.response.ts rename to src/module/user/dto/user.base.response.ts diff --git a/src/module/user/me.controller.ts b/src/module/user/me.controller.ts index e09afd6..1b91808 100644 --- a/src/module/user/me.controller.ts +++ b/src/module/user/me.controller.ts @@ -28,8 +28,8 @@ import { UpdateSubscriptionRequest, GetFollowingRequest, RegisterPushTokenRequest, -} from './dto/user.request'; -import { AlbumBaseResponse } from '../album/dto/album.response'; +} from './dto/user.api.request'; +import { AlbumBaseResponse } from '../album/dto/album.base.response'; import { MyProfileResponse, UpdateProfileConflictResponse, @@ -37,9 +37,9 @@ import { MyFollowersResponse, MyFollowingsResponse, MyBlockingsResponse, -} from './dto/user.response'; -import { MyLikeFeedsResponse } from '../feed/dto/feed.response'; -import { MySavePostsResponse } from '../post/dto/post.response'; +} from './dto/user.api.response'; +import { MyLikeFeedsResponse } from '../feed/dto/feed.api.response'; +import { MySavePostsResponse } from '../post/dto/post.api.response'; @ApiTags('/me') @ApiBearerAuth() diff --git a/src/module/user/user.controller.ts b/src/module/user/user.controller.ts index 5aa2e97..ba8e8af 100644 --- a/src/module/user/user.controller.ts +++ b/src/module/user/user.controller.ts @@ -25,16 +25,16 @@ import { SearchUserRequest, GetFeedsByUserRequest, CheckNameRequest, -} from './dto/user.request'; +} from './dto/user.api.request'; import { PageRequest } from 'src/shared/request/page.request'; import { SearchedUsersResponse, PopularUserResponse, UserProfileResponse, UserMetaResponse, -} from './dto/user.response'; -import { UserFeedsResponse } from '../feed/dto/feed.response'; -import { MyPostResponse } from '../post/dto/post.response'; +} from './dto/user.api.response'; +import { UserFeedsResponse } from '../feed/dto/feed.api.response'; +import { MyPostResponse } from '../post/dto/post.api.response'; @ApiTags('/users') @ApiResponse({ status: 401, description: 'Unauthorized' }) From a0b0e47e93c1c167c88b708a950fc6a16f84a203 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Wed, 3 Dec 2025 10:50:22 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20dto=20=ED=83=80=EC=9E=85=20base?= =?UTF-8?q?.response=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/module/album/album.controller.ts | 2 +- ...{album.api.request.ts => album.request.ts} | 0 src/module/album/dto/index.ts | 2 +- src/module/auth/auth.controller.ts | 4 ++-- .../{auth.api.request.ts => auth.request.ts} | 0 ...{auth.api.response.ts => auth.response.ts} | 0 src/module/auth/dto/index.ts | 4 ++-- src/module/chat/chat-message.controller.ts | 4 ++-- src/module/chat/chat.controller.ts | 4 ++-- ...api.request.ts => chat-message.request.ts} | 0 ...i.response.ts => chat-message.response.ts} | 0 .../{chat.api.request.ts => chat.request.ts} | 0 ...{chat.api.response.ts => chat.response.ts} | 0 src/module/chat/dto/index.ts | 8 +++---- ...api.request.ts => feed-comment.request.ts} | 0 ...i.response.ts => feed-comment.response.ts} | 0 src/module/feed-comment/dto/index.ts | 4 ++-- .../feed-comment/feed-comment.controller.ts | 4 ++-- .../{feed.api.request.ts => feed.request.ts} | 0 ...{feed.api.response.ts => feed.response.ts} | 0 src/module/feed/dto/index.ts | 4 ++-- src/module/feed/feed.controller.ts | 6 ++--- src/module/post-comment/dto/index.ts | 2 ++ .../dto/post-comment.base.response.ts | 18 +++++++++++++++ .../post-comment/dto/post-comment.response.ts | 22 ++++--------------- src/module/post/dto/index.ts | 6 +++-- .../{post.api.request.ts => post.request.ts} | 0 ...{post.api.response.ts => post.response.ts} | 9 -------- src/module/post/post.controller.ts | 12 +++++----- src/module/user/dto/index.ts | 4 ++-- .../{user.api.request.ts => user.request.ts} | 0 ...{user.api.response.ts => user.response.ts} | 0 src/module/user/me.controller.ts | 8 +++---- src/module/user/user.controller.ts | 8 +++---- 34 files changed, 67 insertions(+), 68 deletions(-) rename src/module/album/dto/{album.api.request.ts => album.request.ts} (100%) rename src/module/auth/dto/{auth.api.request.ts => auth.request.ts} (100%) rename src/module/auth/dto/{auth.api.response.ts => auth.response.ts} (100%) rename src/module/chat/dto/{chat-message.api.request.ts => chat-message.request.ts} (100%) rename src/module/chat/dto/{chat-message.api.response.ts => chat-message.response.ts} (100%) rename src/module/chat/dto/{chat.api.request.ts => chat.request.ts} (100%) rename src/module/chat/dto/{chat.api.response.ts => chat.response.ts} (100%) rename src/module/feed-comment/dto/{feed-comment.api.request.ts => feed-comment.request.ts} (100%) rename src/module/feed-comment/dto/{feed-comment.api.response.ts => feed-comment.response.ts} (100%) rename src/module/feed/dto/{feed.api.request.ts => feed.request.ts} (100%) rename src/module/feed/dto/{feed.api.response.ts => feed.response.ts} (100%) create mode 100644 src/module/post-comment/dto/post-comment.base.response.ts rename src/module/post/dto/{post.api.request.ts => post.request.ts} (100%) rename src/module/post/dto/{post.api.response.ts => post.response.ts} (88%) rename src/module/user/dto/{user.api.request.ts => user.request.ts} (100%) rename src/module/user/dto/{user.api.response.ts => user.response.ts} (100%) diff --git a/src/module/album/album.controller.ts b/src/module/album/album.controller.ts index fdea591..3e5a17e 100644 --- a/src/module/album/album.controller.ts +++ b/src/module/album/album.controller.ts @@ -17,7 +17,7 @@ import { UpdateAlbumOrderRequest, InsertFeedsRequest, RemoveFeedsAlbumRequest, -} from './dto/album.api.request'; +} from './dto/album.request'; import { ApiTags, ApiResponse, diff --git a/src/module/album/dto/album.api.request.ts b/src/module/album/dto/album.request.ts similarity index 100% rename from src/module/album/dto/album.api.request.ts rename to src/module/album/dto/album.request.ts diff --git a/src/module/album/dto/index.ts b/src/module/album/dto/index.ts index 843f7a0..6ae0da2 100644 --- a/src/module/album/dto/index.ts +++ b/src/module/album/dto/index.ts @@ -1,2 +1,2 @@ -export * from './album.api.request'; +export * from './album.request'; export * from './album.base.response'; diff --git a/src/module/auth/auth.controller.ts b/src/module/auth/auth.controller.ts index 015cd5d..16829a2 100644 --- a/src/module/auth/auth.controller.ts +++ b/src/module/auth/auth.controller.ts @@ -15,12 +15,12 @@ import { ApiHeader, } from '@nestjs/swagger'; import { AuthService } from 'src/module/auth/auth.service'; -import { LoginRequest, RegisterRequest } from './dto/auth.api.request'; +import { LoginRequest, RegisterRequest } from './dto/auth.request'; import { LoginResponse, JwtResponse, Register409Response, -} from './dto/auth.api.response'; +} from './dto/auth.response'; import { GetClientInfo, GetRefreshToken, diff --git a/src/module/auth/dto/auth.api.request.ts b/src/module/auth/dto/auth.request.ts similarity index 100% rename from src/module/auth/dto/auth.api.request.ts rename to src/module/auth/dto/auth.request.ts diff --git a/src/module/auth/dto/auth.api.response.ts b/src/module/auth/dto/auth.response.ts similarity index 100% rename from src/module/auth/dto/auth.api.response.ts rename to src/module/auth/dto/auth.response.ts diff --git a/src/module/auth/dto/index.ts b/src/module/auth/dto/index.ts index 9b2c200..841c9ae 100644 --- a/src/module/auth/dto/index.ts +++ b/src/module/auth/dto/index.ts @@ -1,2 +1,2 @@ -export * from './auth.api.request'; -export * from './auth.api.response'; +export * from './auth.request'; +export * from './auth.response'; diff --git a/src/module/chat/chat-message.controller.ts b/src/module/chat/chat-message.controller.ts index ede203e..77a3f48 100644 --- a/src/module/chat/chat-message.controller.ts +++ b/src/module/chat/chat-message.controller.ts @@ -22,8 +22,8 @@ import { JwtGuard } from 'src/core/guard'; import { CreateChatMessageRequest, GetChatMessagesRequest, -} from './dto/chat-message.api.request'; -import { ChatMessagesResponse } from './dto/chat-message.api.response'; +} from './dto/chat-message.request'; +import { ChatMessagesResponse } from './dto/chat-message.response'; import { ChatMessageService } from './chat-message.service'; import { CurrentUser } from 'src/core/decorator'; diff --git a/src/module/chat/chat.controller.ts b/src/module/chat/chat.controller.ts index 2e1d931..eb8cf64 100644 --- a/src/module/chat/chat.controller.ts +++ b/src/module/chat/chat.controller.ts @@ -23,12 +23,12 @@ import { JoinChatRequest, LeaveChatRequest, BatchDeleteChatsRequest, -} from './dto/chat.api.request'; +} from './dto/chat.request'; import { JwtGuard } from 'src/core/guard'; import { CurrentUser } from 'src/core/decorator'; import { ChatService } from './chat.service'; import { IdResponse } from 'src/shared/response'; -import { ChatsResponse } from './dto/chat.api.response'; +import { ChatsResponse } from './dto/chat.response'; import { UserBaseResponse, UserBaseWithBlockedResponse } from '../user/dto'; @ApiTags('/chats') diff --git a/src/module/chat/dto/chat-message.api.request.ts b/src/module/chat/dto/chat-message.request.ts similarity index 100% rename from src/module/chat/dto/chat-message.api.request.ts rename to src/module/chat/dto/chat-message.request.ts diff --git a/src/module/chat/dto/chat-message.api.response.ts b/src/module/chat/dto/chat-message.response.ts similarity index 100% rename from src/module/chat/dto/chat-message.api.response.ts rename to src/module/chat/dto/chat-message.response.ts diff --git a/src/module/chat/dto/chat.api.request.ts b/src/module/chat/dto/chat.request.ts similarity index 100% rename from src/module/chat/dto/chat.api.request.ts rename to src/module/chat/dto/chat.request.ts diff --git a/src/module/chat/dto/chat.api.response.ts b/src/module/chat/dto/chat.response.ts similarity index 100% rename from src/module/chat/dto/chat.api.response.ts rename to src/module/chat/dto/chat.response.ts diff --git a/src/module/chat/dto/index.ts b/src/module/chat/dto/index.ts index 5309d58..637ca25 100644 --- a/src/module/chat/dto/index.ts +++ b/src/module/chat/dto/index.ts @@ -1,6 +1,6 @@ -export * from './chat.api.request'; -export * from './chat.api.response'; +export * from './chat.request'; +export * from './chat.response'; export * from './chat-message.base.response'; -export * from './chat-message.api.request'; -export * from './chat-message.api.response'; +export * from './chat-message.request'; +export * from './chat-message.response'; diff --git a/src/module/feed-comment/dto/feed-comment.api.request.ts b/src/module/feed-comment/dto/feed-comment.request.ts similarity index 100% rename from src/module/feed-comment/dto/feed-comment.api.request.ts rename to src/module/feed-comment/dto/feed-comment.request.ts diff --git a/src/module/feed-comment/dto/feed-comment.api.response.ts b/src/module/feed-comment/dto/feed-comment.response.ts similarity index 100% rename from src/module/feed-comment/dto/feed-comment.api.response.ts rename to src/module/feed-comment/dto/feed-comment.response.ts diff --git a/src/module/feed-comment/dto/index.ts b/src/module/feed-comment/dto/index.ts index 823f3ce..a9d31e1 100644 --- a/src/module/feed-comment/dto/index.ts +++ b/src/module/feed-comment/dto/index.ts @@ -1,4 +1,4 @@ export * from './feed-comment.base.response'; -export * from './feed-comment.api.request'; -export * from './feed-comment.api.response'; +export * from './feed-comment.request'; +export * from './feed-comment.response'; diff --git a/src/module/feed-comment/feed-comment.controller.ts b/src/module/feed-comment/feed-comment.controller.ts index acffb6a..a30fd61 100644 --- a/src/module/feed-comment/feed-comment.controller.ts +++ b/src/module/feed-comment/feed-comment.controller.ts @@ -24,8 +24,8 @@ import { CurrentUser } from 'src/core/decorator'; import { CreateFeedCommentRequest, GetFeedCommentRequest, -} from './dto/feed-comment.api.request'; -import { ParentFeedCommentResponse } from './dto/feed-comment.api.response'; +} from './dto/feed-comment.request'; +import { ParentFeedCommentResponse } from './dto/feed-comment.response'; @ApiTags('/feed-comments') @ApiResponse({ status: 400, description: '유효성 검사 실패' }) diff --git a/src/module/feed/dto/feed.api.request.ts b/src/module/feed/dto/feed.request.ts similarity index 100% rename from src/module/feed/dto/feed.api.request.ts rename to src/module/feed/dto/feed.request.ts diff --git a/src/module/feed/dto/feed.api.response.ts b/src/module/feed/dto/feed.response.ts similarity index 100% rename from src/module/feed/dto/feed.api.response.ts rename to src/module/feed/dto/feed.response.ts diff --git a/src/module/feed/dto/index.ts b/src/module/feed/dto/index.ts index cecdc2f..bd36f78 100644 --- a/src/module/feed/dto/index.ts +++ b/src/module/feed/dto/index.ts @@ -1,4 +1,4 @@ export * from './feed.base.response'; -export * from './feed.api.request'; -export * from './feed.api.response'; +export * from './feed.request'; +export * from './feed.response'; diff --git a/src/module/feed/feed.controller.ts b/src/module/feed/feed.controller.ts index e077fd4..cb466ec 100644 --- a/src/module/feed/feed.controller.ts +++ b/src/module/feed/feed.controller.ts @@ -26,7 +26,7 @@ import { UpdateFeedRequest, DeleteFeedsRequest, GetRankingsRequest, -} from './dto/feed.api.request'; +} from './dto/feed.request'; import { IdResponse } from 'src/shared/response/id.response'; import { SearchedFeedsResponse, @@ -35,8 +35,8 @@ import { FeedDetailResponse, FeedMetaResponse, FeedRankingsResponse, -} from './dto/feed.api.response'; -import { FeedLikedUserResponse } from '../user/dto/user.api.response'; +} from './dto/feed.response'; +import { FeedLikedUserResponse } from '../user/dto/user.response'; import { JwtGuard, OptionalJwtGuard } from 'src/core/guard'; import { CurrentUser } from 'src/core/decorator'; diff --git a/src/module/post-comment/dto/index.ts b/src/module/post-comment/dto/index.ts index bd46718..0ea67bd 100644 --- a/src/module/post-comment/dto/index.ts +++ b/src/module/post-comment/dto/index.ts @@ -1,2 +1,4 @@ +export * from './post-comment.base.response'; + export * from './post-comment.request'; export * from './post-comment.response'; diff --git a/src/module/post-comment/dto/post-comment.base.response.ts b/src/module/post-comment/dto/post-comment.base.response.ts new file mode 100644 index 0000000..f3c78e2 --- /dev/null +++ b/src/module/post-comment/dto/post-comment.base.response.ts @@ -0,0 +1,18 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class PostCommentBaseResponse { + @ApiProperty() + id: string; + + @ApiProperty() + content: string; + + @ApiProperty() + createdAt: Date; + + @ApiProperty() + likeCount: number; + + @ApiProperty() + isLike: boolean; +} diff --git a/src/module/post-comment/dto/post-comment.response.ts b/src/module/post-comment/dto/post-comment.response.ts index 147cfde..f13d6b3 100644 --- a/src/module/post-comment/dto/post-comment.response.ts +++ b/src/module/post-comment/dto/post-comment.response.ts @@ -1,36 +1,22 @@ import { ApiProperty } from '@nestjs/swagger'; import { UserBaseResponse } from '../../user/dto/user.base.response'; +import { PostCommentBaseResponse } from './post-comment.base.response'; -export class PostCommentBaseResponse { - @ApiProperty() - id: string; - - @ApiProperty() - content: string; - - @ApiProperty() - createdAt: Date; - - @ApiProperty() - likeCount: number; - +export class PostCommentWithWriterResponse extends PostCommentBaseResponse { @ApiProperty({ type: UserBaseResponse, nullable: true, description: 'null이면 익명화', }) writer: UserBaseResponse | null; - - @ApiProperty() - isLike: boolean; } -export class ChildPostCommentResponse extends PostCommentBaseResponse { +export class ChildPostCommentResponse extends PostCommentWithWriterResponse { @ApiProperty({ type: UserBaseResponse, nullable: true }) mentionedUser: UserBaseResponse | null; } -export class ParentPostCommentResponse extends PostCommentBaseResponse { +export class ParentPostCommentResponse extends PostCommentWithWriterResponse { @ApiProperty() isDeleted: boolean; diff --git a/src/module/post/dto/index.ts b/src/module/post/dto/index.ts index 75c028a..e0887bb 100644 --- a/src/module/post/dto/index.ts +++ b/src/module/post/dto/index.ts @@ -1,2 +1,4 @@ -export * from './post.api.request'; -export * from './post.api.response'; +export * from './post.base.response'; + +export * from './post.request'; +export * from './post.response'; diff --git a/src/module/post/dto/post.api.request.ts b/src/module/post/dto/post.request.ts similarity index 100% rename from src/module/post/dto/post.api.request.ts rename to src/module/post/dto/post.request.ts diff --git a/src/module/post/dto/post.api.response.ts b/src/module/post/dto/post.response.ts similarity index 88% rename from src/module/post/dto/post.api.response.ts rename to src/module/post/dto/post.response.ts index 77aaf80..b2813e6 100644 --- a/src/module/post/dto/post.api.response.ts +++ b/src/module/post/dto/post.response.ts @@ -5,15 +5,6 @@ import { postTypes } from '../../../common/constants/post.constant'; import { PostBaseResponse, PostResponse } from './post.base.response'; export class PostWithAuthorResponse extends PostResponse { - @ApiProperty({ enum: postTypes }) - type: (typeof postTypes)[number]; - - @ApiProperty() - viewCount: number; - - @ApiProperty() - commentCount: number; - @ApiProperty({ type: UserBaseResponse }) author: UserBaseResponse; } diff --git a/src/module/post/post.controller.ts b/src/module/post/post.controller.ts index f6b35ef..c7d82a4 100644 --- a/src/module/post/post.controller.ts +++ b/src/module/post/post.controller.ts @@ -25,14 +25,14 @@ import { CreatePostRequest, GetPostsRequest, SearchPostRequest, -} from './dto/post.api.request'; +} from './dto/post.request'; import { IdResponse } from 'src/shared/response/id.response'; import { - PostBaseResponse, - PostResponse, PostsResponse, PostDetailResponse, -} from './dto/post.api.response'; + PostWithAuthorResponse, +} from './dto/post.response'; +import { PostBaseResponse } from './dto'; @ApiTags('/posts') @ApiResponse({ status: 401, description: 'Unauthorized' }) @@ -67,9 +67,9 @@ export class PostController { } @ApiOperation({ summary: '공지사항 조회' }) - @ApiResponse({ status: 200, type: [PostResponse] }) + @ApiResponse({ status: 200, type: [PostWithAuthorResponse] }) @Get('notices') - async getNotices(): Promise { + async getNotices(): Promise { return await this.postService.getNotices(); } diff --git a/src/module/user/dto/index.ts b/src/module/user/dto/index.ts index 691c818..81cd4d7 100644 --- a/src/module/user/dto/index.ts +++ b/src/module/user/dto/index.ts @@ -1,4 +1,4 @@ export * from './user.base.response'; -export * from './user.api.request'; -export * from './user.api.response'; +export * from './user.request'; +export * from './user.response'; diff --git a/src/module/user/dto/user.api.request.ts b/src/module/user/dto/user.request.ts similarity index 100% rename from src/module/user/dto/user.api.request.ts rename to src/module/user/dto/user.request.ts diff --git a/src/module/user/dto/user.api.response.ts b/src/module/user/dto/user.response.ts similarity index 100% rename from src/module/user/dto/user.api.response.ts rename to src/module/user/dto/user.response.ts diff --git a/src/module/user/me.controller.ts b/src/module/user/me.controller.ts index 1b91808..96447f8 100644 --- a/src/module/user/me.controller.ts +++ b/src/module/user/me.controller.ts @@ -28,7 +28,7 @@ import { UpdateSubscriptionRequest, GetFollowingRequest, RegisterPushTokenRequest, -} from './dto/user.api.request'; +} from './dto/user.request'; import { AlbumBaseResponse } from '../album/dto/album.base.response'; import { MyProfileResponse, @@ -37,9 +37,9 @@ import { MyFollowersResponse, MyFollowingsResponse, MyBlockingsResponse, -} from './dto/user.api.response'; -import { MyLikeFeedsResponse } from '../feed/dto/feed.api.response'; -import { MySavePostsResponse } from '../post/dto/post.api.response'; +} from './dto/user.response'; +import { MyLikeFeedsResponse } from '../feed/dto/feed.response'; +import { MySavePostsResponse } from '../post/dto/post.response'; @ApiTags('/me') @ApiBearerAuth() diff --git a/src/module/user/user.controller.ts b/src/module/user/user.controller.ts index ba8e8af..5aa2e97 100644 --- a/src/module/user/user.controller.ts +++ b/src/module/user/user.controller.ts @@ -25,16 +25,16 @@ import { SearchUserRequest, GetFeedsByUserRequest, CheckNameRequest, -} from './dto/user.api.request'; +} from './dto/user.request'; import { PageRequest } from 'src/shared/request/page.request'; import { SearchedUsersResponse, PopularUserResponse, UserProfileResponse, UserMetaResponse, -} from './dto/user.api.response'; -import { UserFeedsResponse } from '../feed/dto/feed.api.response'; -import { MyPostResponse } from '../post/dto/post.api.response'; +} from './dto/user.response'; +import { UserFeedsResponse } from '../feed/dto/feed.response'; +import { MyPostResponse } from '../post/dto/post.response'; @ApiTags('/users') @ApiResponse({ status: 401, description: 'Unauthorized' }) From 3855382e2882a0e1cc4df917a0dc4f1fd16a5c57 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Wed, 3 Dec 2025 13:29:55 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20apns-collapse-id=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/module/push/push.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/module/push/push.service.ts b/src/module/push/push.service.ts index 5835887..3e56dfc 100644 --- a/src/module/push/push.service.ts +++ b/src/module/push/push.service.ts @@ -79,12 +79,13 @@ export class PushService implements OnModuleInit { fcmOptions: { ...(data.imageUrl && { imageUrl: data.imageUrl }), // 여기에 이미지 URL }, - ...(data.silent && { - headers: { + headers: { + ...(data.silent && { 'apns-priority': '5', // silent 푸시를 위한 우선순위 설정 'apns-push-type': 'background', - }, - }), + }), + ...(data.key && { 'apns-collapse-id': data.key }), // 같은 key면 기존 알림 덮어씀 + }, }; try {