@@ -32,7 +32,7 @@ import { plainToInstance } from 'class-transformer';
32
32
33
33
@ApiTags ( 'free-post-reply-comment' )
34
34
@ApiCommonResponse ( [ HttpStatus . INTERNAL_SERVER_ERROR ] )
35
- @Controller ( 'free-posts/:freePostId /comments/:freePostCommentId /reply' )
35
+ @Controller ( 'free-posts/:postId /comments/:commentId /reply' )
36
36
export class FreePostReplyCommentsController {
37
37
constructor (
38
38
private readonly freePostReplyCommentsService : FreePostReplyCommentsService ,
@@ -46,14 +46,14 @@ export class FreePostReplyCommentsController {
46
46
@Post ( )
47
47
create (
48
48
@User ( ) user : UserDto ,
49
- @Param ( 'freePostId ' , ParsePositiveIntPipe ) freePostId : number ,
50
- @Param ( 'freePostCommentId ' , ParsePositiveIntPipe ) freePostCommentId : number ,
49
+ @Param ( 'postId ' , ParsePositiveIntPipe ) postId : number ,
50
+ @Param ( 'commentId ' , ParsePositiveIntPipe ) commentId : number ,
51
51
@Body ( ) createFreePostReplyCommentDto : CreateFreePostReplyCommentDto ,
52
52
) : Promise < FreePostReplyCommentDto > {
53
53
return this . freePostReplyCommentsService . create (
54
54
user . id ,
55
- freePostId ,
56
- freePostCommentId ,
55
+ postId ,
56
+ commentId ,
57
57
createFreePostReplyCommentDto ,
58
58
) ;
59
59
}
@@ -64,15 +64,15 @@ export class FreePostReplyCommentsController {
64
64
@SetResponse ( { type : ResponseType . Pagination , key : 'freePostReplyComments' } )
65
65
@Get ( )
66
66
async findAllAndCount (
67
- @Param ( 'freePostId ' , ParsePositiveIntPipe ) freePostId : number ,
68
- @Param ( 'freePostCommentId ' , ParsePositiveIntPipe ) freePostCommentId : number ,
67
+ @Param ( 'postId ' , ParsePositiveIntPipe ) postId : number ,
68
+ @Param ( 'commentId ' , ParsePositiveIntPipe ) commentId : number ,
69
69
@Query ( )
70
70
findFreePostReplyCommentListQueryDto : FindFreePostReplyCommentListQueryDto ,
71
71
) : Promise < [ FreePostReplyCommentsItemDto [ ] , number ] > {
72
72
const [ freePosts , count ] =
73
73
await this . freePostReplyCommentsService . findAllAndCount (
74
- freePostId ,
75
- freePostCommentId ,
74
+ postId ,
75
+ commentId ,
76
76
findFreePostReplyCommentListQueryDto ,
77
77
) ;
78
78
@@ -84,20 +84,19 @@ export class FreePostReplyCommentsController {
84
84
} )
85
85
@SetResponse ( { type : ResponseType . Detail , key : 'freePostReplyComment' } )
86
86
@UseGuards ( JwtAuthGuard )
87
- @Put ( ':freePostReplyCommentId ' )
87
+ @Put ( ':replyId ' )
88
88
putUpdate (
89
89
@User ( ) user : UserDto ,
90
- @Param ( 'freePostId' , ParsePositiveIntPipe ) freePostId : number ,
91
- @Param ( 'freePostCommentId' , ParsePositiveIntPipe ) freePostCommentId : number ,
92
- @Param ( 'freePostReplyCommentId' , ParsePositiveIntPipe )
93
- freePostReplyCommentId : number ,
90
+ @Param ( 'postId' , ParsePositiveIntPipe ) postId : number ,
91
+ @Param ( 'commentId' , ParsePositiveIntPipe ) commentId : number ,
92
+ @Param ( 'replyId' , ParsePositiveIntPipe ) replyId : number ,
94
93
@Body ( ) putUpdateFreePostReplyCommentDto : PutUpdateFreePostReplyCommentDto ,
95
94
) : Promise < FreePostReplyCommentDto > {
96
95
return this . freePostReplyCommentsService . putUpdate (
97
96
user . id ,
98
- freePostId ,
99
- freePostCommentId ,
100
- freePostReplyCommentId ,
97
+ postId ,
98
+ commentId ,
99
+ replyId ,
101
100
putUpdateFreePostReplyCommentDto ,
102
101
) ;
103
102
}
@@ -107,19 +106,18 @@ export class FreePostReplyCommentsController {
107
106
} )
108
107
@SetResponse ( { type : ResponseType . Delete } )
109
108
@UseGuards ( JwtAuthGuard )
110
- @Delete ( ':freePostReplyCommentId ' )
109
+ @Delete ( ':replyId ' )
111
110
remove (
112
111
@User ( ) user : UserDto ,
113
- @Param ( 'freePostId' ) freePostId : number ,
114
- @Param ( 'freePostCommentId' , ParsePositiveIntPipe ) freePostCommentId : number ,
115
- @Param ( 'freePostReplyCommentId' , ParsePositiveIntPipe )
116
- freePostReplyCommentId : number ,
112
+ @Param ( 'postId' , ParsePositiveIntPipe ) postId : number ,
113
+ @Param ( 'commentId' , ParsePositiveIntPipe ) commentId : number ,
114
+ @Param ( 'replyId' , ParsePositiveIntPipe ) replyId : number ,
117
115
) : Promise < number > {
118
116
return this . freePostReplyCommentsService . remove (
119
117
user . id ,
120
- freePostId ,
121
- freePostCommentId ,
122
- freePostReplyCommentId ,
118
+ postId ,
119
+ commentId ,
120
+ replyId ,
123
121
) ;
124
122
}
125
123
@@ -128,20 +126,19 @@ export class FreePostReplyCommentsController {
128
126
} )
129
127
@HttpCode ( HttpStatus . NO_CONTENT )
130
128
@UseGuards ( JwtAuthGuard )
131
- @Post ( ':freePostReplyCommentId /reaction' )
129
+ @Post ( ':replyId /reaction' )
132
130
createReaction (
133
131
@User ( ) user : UserDto ,
134
- @Param ( 'freePostId' , ParsePositiveIntPipe ) freePostId : number ,
135
- @Param ( 'freePostCommentId' , ParsePositiveIntPipe ) freePostCommentId : number ,
136
- @Param ( 'freePostReplyCommentId' , ParsePositiveIntPipe )
137
- freePostReplyCommentId : number ,
132
+ @Param ( 'postId' , ParsePositiveIntPipe ) postId : number ,
133
+ @Param ( 'commentId' , ParsePositiveIntPipe ) commentId : number ,
134
+ @Param ( 'replyId' , ParsePositiveIntPipe ) replyId : number ,
138
135
@Body ( ) createReactionDto : CreateReactionDto ,
139
136
) : Promise < void > {
140
137
return this . freePostReplyCommentsService . createReaction (
141
138
user . id ,
142
- freePostId ,
143
- freePostCommentId ,
144
- freePostReplyCommentId ,
139
+ postId ,
140
+ commentId ,
141
+ replyId ,
145
142
createReactionDto ,
146
143
) ;
147
144
}
@@ -151,20 +148,19 @@ export class FreePostReplyCommentsController {
151
148
} )
152
149
@HttpCode ( HttpStatus . NO_CONTENT )
153
150
@UseGuards ( JwtAuthGuard )
154
- @Delete ( ':freePostReplyCommentId /reaction' )
151
+ @Delete ( ':replyId /reaction' )
155
152
removeReaction (
156
153
@User ( ) user : UserDto ,
157
- @Param ( 'freePostId' , ParsePositiveIntPipe ) freePostId : number ,
158
- @Param ( 'freePostCommentId' , ParsePositiveIntPipe ) freePostCommentId : number ,
159
- @Param ( 'freePostReplyCommentId' , ParsePositiveIntPipe )
160
- freePostReplyCommentId : number ,
154
+ @Param ( 'postId' , ParsePositiveIntPipe ) postId : number ,
155
+ @Param ( 'commentId' , ParsePositiveIntPipe ) commentId : number ,
156
+ @Param ( 'replyId' , ParsePositiveIntPipe ) replyId : number ,
161
157
@Body ( ) removeReactionDto : RemoveReactionDto ,
162
158
) : Promise < void > {
163
159
return this . freePostReplyCommentsService . removeReaction (
164
160
user . id ,
165
- freePostId ,
166
- freePostCommentId ,
167
- freePostReplyCommentId ,
161
+ postId ,
162
+ commentId ,
163
+ replyId ,
168
164
removeReactionDto ,
169
165
) ;
170
166
}
0 commit comments