|
| 1 | +import { Type } from 'class-transformer'; |
| 2 | +import { ApiProperty } from '@nestjs/swagger'; |
| 3 | + |
| 4 | +class RequesterResponse { |
| 5 | + @ApiProperty({ |
| 6 | + description: '매칭 요청자의 ID', |
| 7 | + example: '19', |
| 8 | + }) |
| 9 | + requesterId: number; |
| 10 | + |
| 11 | + @ApiProperty({ |
| 12 | + description: '매칭 요청자의 닉네임', |
| 13 | + example: '1d1d1d', |
| 14 | + }) |
| 15 | + nickname: string; |
| 16 | + |
| 17 | + @ApiProperty({ |
| 18 | + description: '매칭 요청자의 프로필 이미지 url', |
| 19 | + example: 'https://example.com/image1.jpg', |
| 20 | + }) |
| 21 | + profilePictureUrl: string; |
| 22 | +} |
| 23 | + |
| 24 | +class RequesterPostResponse { |
| 25 | + @ApiProperty({ |
| 26 | + description: '매칭 요청자의 게시물 이미지 목록', |
| 27 | + type: [String], |
| 28 | + example: [ |
| 29 | + { url: 'https://example.com/image1.jpg', orderNum: 1 }, |
| 30 | + { url: 'https://example.com/image2.jpg', orderNum: 2 }, |
| 31 | + ], |
| 32 | + }) |
| 33 | + postImages: { url: string; orderNum: number }[]; |
| 34 | + |
| 35 | + @ApiProperty({ |
| 36 | + description: '매칭 요청자의 게시물 스타일 태그 목록', |
| 37 | + type: [String], |
| 38 | + example: ['classic', 'basic'], |
| 39 | + }) |
| 40 | + styleTags: string[]; |
| 41 | +} |
| 42 | + |
| 43 | +class MatchingResponse { |
| 44 | + @ApiProperty({ |
| 45 | + description: '매칭 요청자 정보', |
| 46 | + type: RequesterResponse, |
| 47 | + }) |
| 48 | + @Type(() => RequesterResponse) |
| 49 | + requester: RequesterResponse; |
| 50 | + |
| 51 | + @ApiProperty({ |
| 52 | + description: '매칭 요청자의 대표 게시물이 없을 경우, 가장 최근 게시물 정보', |
| 53 | + type: RequesterPostResponse, |
| 54 | + }) |
| 55 | + @Type(() => RequesterPostResponse) |
| 56 | + requesterPost: RequesterPostResponse; |
| 57 | +} |
| 58 | + |
| 59 | +export class GetMatchingsResponse { |
| 60 | + @ApiProperty({ |
| 61 | + description: '매칭 존재 여부', |
| 62 | + example: true, |
| 63 | + }) |
| 64 | + isMatching: boolean; |
| 65 | + |
| 66 | + @ApiProperty({ |
| 67 | + description: '받은 매칭 수', |
| 68 | + example: 10, |
| 69 | + }) |
| 70 | + matchingCount: number; |
| 71 | + |
| 72 | + @ApiProperty({ |
| 73 | + description: '매칭 정보', |
| 74 | + type: [MatchingResponse], |
| 75 | + }) |
| 76 | + @Type(() => MatchingResponse) |
| 77 | + matching: MatchingResponse[]; |
| 78 | +} |
0 commit comments