[hw-8] add: comment service

This commit is contained in:
3ybacTuK
2025-07-26 23:47:18 +03:00
parent 6420eaf3d7
commit 6e0d90a6d5
29 changed files with 1249 additions and 725 deletions

View File

@@ -27,7 +27,7 @@
"paths": {
"/comment/add": {
"post": {
"operationId": "Comments_Add",
"operationId": "Comments_CommentAdd",
"responses": {
"200": {
"description": "A successful response.",
@@ -59,12 +59,13 @@
},
"/comment/edit": {
"post": {
"operationId": "Comments_Edit",
"operationId": "Comments_CommentEdit",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/UpdateCommentResponse"
"type": "object",
"properties": {}
}
},
"default": {
@@ -80,7 +81,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateCommentRequest"
"$ref": "#/definitions/EditCommentRequest"
}
}
],
@@ -91,7 +92,7 @@
},
"/comment/get-by-id": {
"post": {
"operationId": "Comments_GetById",
"operationId": "Comments_CommentGetByID",
"responses": {
"200": {
"description": "A successful response.",
@@ -123,7 +124,7 @@
},
"/comment/list-by-sku": {
"post": {
"operationId": "Comments_ListBySku",
"operationId": "Comments_CommentListBySKU",
"responses": {
"200": {
"description": "A successful response.",
@@ -155,7 +156,7 @@
},
"/comment/list-by-user": {
"post": {
"operationId": "Comments_ListByUser",
"operationId": "Comments_CommentListByUser",
"responses": {
"200": {
"description": "A successful response.",
@@ -207,7 +208,7 @@
},
"createdAt": {
"type": "string",
"title": "RFC3339 with ms"
"format": "date-time"
}
}
},
@@ -222,7 +223,7 @@
"type": "string",
"format": "int64"
},
"text": {
"comment": {
"type": "string"
}
}
@@ -230,8 +231,25 @@
"CreateCommentResponse": {
"type": "object",
"properties": {
"comment": {
"$ref": "#/definitions/Comment"
"id": {
"type": "string",
"format": "int64"
}
}
},
"EditCommentRequest": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"format": "int64"
},
"commentId": {
"type": "string",
"format": "int64"
},
"newComment": {
"type": "string"
}
}
},
@@ -294,30 +312,6 @@
}
}
},
"UpdateCommentRequest": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"userId": {
"type": "string",
"format": "int64"
},
"text": {
"type": "string"
}
}
},
"UpdateCommentResponse": {
"type": "object",
"properties": {
"comment": {
"$ref": "#/definitions/Comment"
}
}
},
"protobufAny": {
"type": "object",
"properties": {