1
1
import { ApiProperty } from '@nestjs/swagger' ;
2
2
import { Type } from 'class-transformer' ;
3
3
4
- export class PostMatchingResponse {
4
+ export class CreateMatchingResponse {
5
+ @ApiProperty ( { example : 1 , description : '매칭 ID' } )
6
+ matchingId : number ;
7
+
5
8
@ApiProperty ( { example : 1 , description : '채팅방 아이디' } )
6
9
chatRoomId : number ;
7
10
8
11
@ApiProperty ( { example : 1 , description : '신청한 유저 아이디' } )
9
- fromUserId : number ;
12
+ requesterId : number ;
10
13
11
14
@ApiProperty ( { example : 2 , description : '매칭 상대 유저 아이디' } )
12
- toUserId : number ;
15
+ targetId : number ;
13
16
}
14
17
15
18
export class PatchMatchingResponse {
@@ -33,16 +36,34 @@ export class PatchMatchingResponse {
33
36
chatRoomId ?: number ;
34
37
}
35
38
39
+ class RepresentativePost {
40
+ @ApiProperty ( {
41
+ description : '매칭 요청자의 게시물 이미지 목록' ,
42
+ type : [ String ] ,
43
+ example : [
44
+ { url : 'https://example.com/image1.jpg' , orderNum : 1 } ,
45
+ { url : 'https://example.com/image2.jpg' , orderNum : 2 } ,
46
+ ] ,
47
+ } )
48
+ postImages : { url : string ; orderNum : number } [ ] ;
49
+
50
+ @ApiProperty ( {
51
+ description : '매칭 요청자의 게시물 스타일 태그 목록' ,
52
+ type : [ String ] ,
53
+ example : [ 'classic' , 'basic' ] ,
54
+ } )
55
+ styleTags : string [ ] ;
56
+ }
36
57
class RequesterResponse {
37
58
@ApiProperty ( {
38
59
description : '매칭 요청자의 ID' ,
39
60
example : 19 ,
40
61
} )
41
- requesterId : number ;
62
+ id : number ;
42
63
43
64
@ApiProperty ( {
44
65
description : '매칭 요청자의 닉네임' ,
45
- example : '1d1d1d ' ,
66
+ example : '러러 ' ,
46
67
} )
47
68
nickname : string ;
48
69
@@ -51,44 +72,25 @@ class RequesterResponse {
51
72
example : 'https://example.com/image1.jpg' ,
52
73
} )
53
74
profilePictureUrl : string ;
54
- }
55
-
56
- class RequesterPostResponse {
57
- @ApiProperty ( {
58
- description : '매칭 요청자의 게시물 이미지 목록' ,
59
- type : [ String ] ,
60
- example : [
61
- { url : 'https://example.com/image1.jpg' , orderNum : 1 } ,
62
- { url : 'https://example.com/image2.jpg' , orderNum : 2 } ,
63
- ] ,
64
- } )
65
- postImages : { url : string ; orderNum : number } [ ] ;
66
75
67
76
@ApiProperty ( {
68
- description : '매칭 요청자의 게시물 스타일 태그 목록' ,
69
- type : [ String ] ,
70
- example : [ 'classic' , 'basic' ] ,
77
+ description : '매칭 요청자의 대표 게시물이 없을 경우, 가장 최근 게시물 정보' ,
78
+ type : RepresentativePost ,
71
79
} )
72
- styleTags : string [ ] ;
80
+ @Type ( ( ) => RepresentativePost )
81
+ representativePost : RepresentativePost ;
73
82
}
74
83
75
- class MatchingResponse {
84
+ class Matching {
76
85
@ApiProperty ( { example : 1 , description : '매칭 ID' } )
77
- matchingId : number ;
86
+ id : number ;
78
87
79
88
@ApiProperty ( {
80
89
description : '매칭 요청자 정보' ,
81
90
type : RequesterResponse ,
82
91
} )
83
92
@Type ( ( ) => RequesterResponse )
84
93
requester : RequesterResponse ;
85
-
86
- @ApiProperty ( {
87
- description : '매칭 요청자의 대표 게시물이 없을 경우, 가장 최근 게시물 정보' ,
88
- type : RequesterPostResponse ,
89
- } )
90
- @Type ( ( ) => RequesterPostResponse )
91
- requesterPost : RequesterPostResponse ;
92
94
}
93
95
94
96
export class GetMatchingsResponse {
@@ -106,8 +108,8 @@ export class GetMatchingsResponse {
106
108
107
109
@ApiProperty ( {
108
110
description : '매칭 정보' ,
109
- type : [ MatchingResponse ] ,
111
+ type : [ Matching ] ,
110
112
} )
111
- @Type ( ( ) => MatchingResponse )
112
- matching : MatchingResponse [ ] ;
113
+ @Type ( ( ) => Matching )
114
+ matching : Matching [ ] ;
113
115
}
0 commit comments