mirror of
				https://github.com/3ybactuk/marketplace-go-service-project.git
				synced 2025-10-30 14:03:45 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			345 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
			
		
		
	
	
			345 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			JSON
		
	
	
	
	
	
| {
 | |
|   "swagger": "2.0",
 | |
|   "info": {
 | |
|     "title": "Comments Service",
 | |
|     "version": "1.0.0"
 | |
|   },
 | |
|   "tags": [
 | |
|     {
 | |
|       "name": "Comments",
 | |
|       "description": "Comment Service",
 | |
|       "externalDocs": {
 | |
|         "description": "Find out more about grpc-gateway",
 | |
|         "url": "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/examples/internal/proto/examplepb/a_bit_of_everything.proto"
 | |
|       }
 | |
|     }
 | |
|   ],
 | |
|   "schemes": [
 | |
|     "http",
 | |
|     "https"
 | |
|   ],
 | |
|   "consumes": [
 | |
|     "application/json"
 | |
|   ],
 | |
|   "produces": [
 | |
|     "application/json"
 | |
|   ],
 | |
|   "paths": {
 | |
|     "/comment/add": {
 | |
|       "post": {
 | |
|         "operationId": "Comments_CommentAdd",
 | |
|         "responses": {
 | |
|           "200": {
 | |
|             "description": "A successful response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/CreateCommentResponse"
 | |
|             }
 | |
|           },
 | |
|           "default": {
 | |
|             "description": "An unexpected error response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/rpcStatus"
 | |
|             }
 | |
|           }
 | |
|         },
 | |
|         "parameters": [
 | |
|           {
 | |
|             "name": "body",
 | |
|             "in": "body",
 | |
|             "required": true,
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/CreateCommentRequest"
 | |
|             }
 | |
|           }
 | |
|         ],
 | |
|         "tags": [
 | |
|           "Comments"
 | |
|         ]
 | |
|       }
 | |
|     },
 | |
|     "/comment/edit": {
 | |
|       "post": {
 | |
|         "operationId": "Comments_CommentEdit",
 | |
|         "responses": {
 | |
|           "200": {
 | |
|             "description": "A successful response.",
 | |
|             "schema": {
 | |
|               "type": "object",
 | |
|               "properties": {}
 | |
|             }
 | |
|           },
 | |
|           "default": {
 | |
|             "description": "An unexpected error response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/rpcStatus"
 | |
|             }
 | |
|           }
 | |
|         },
 | |
|         "parameters": [
 | |
|           {
 | |
|             "name": "body",
 | |
|             "in": "body",
 | |
|             "required": true,
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/EditCommentRequest"
 | |
|             }
 | |
|           }
 | |
|         ],
 | |
|         "tags": [
 | |
|           "Comments"
 | |
|         ]
 | |
|       }
 | |
|     },
 | |
|     "/comment/get-by-id": {
 | |
|       "post": {
 | |
|         "operationId": "Comments_CommentGetByID",
 | |
|         "responses": {
 | |
|           "200": {
 | |
|             "description": "A successful response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/GetCommentResponse"
 | |
|             }
 | |
|           },
 | |
|           "default": {
 | |
|             "description": "An unexpected error response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/rpcStatus"
 | |
|             }
 | |
|           }
 | |
|         },
 | |
|         "parameters": [
 | |
|           {
 | |
|             "name": "body",
 | |
|             "in": "body",
 | |
|             "required": true,
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/GetCommentRequest"
 | |
|             }
 | |
|           }
 | |
|         ],
 | |
|         "tags": [
 | |
|           "Comments"
 | |
|         ]
 | |
|       }
 | |
|     },
 | |
|     "/comment/list-by-sku": {
 | |
|       "post": {
 | |
|         "operationId": "Comments_CommentListBySKU",
 | |
|         "responses": {
 | |
|           "200": {
 | |
|             "description": "A successful response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/ListBySkuResponse"
 | |
|             }
 | |
|           },
 | |
|           "default": {
 | |
|             "description": "An unexpected error response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/rpcStatus"
 | |
|             }
 | |
|           }
 | |
|         },
 | |
|         "parameters": [
 | |
|           {
 | |
|             "name": "body",
 | |
|             "in": "body",
 | |
|             "required": true,
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/ListBySkuRequest"
 | |
|             }
 | |
|           }
 | |
|         ],
 | |
|         "tags": [
 | |
|           "Comments"
 | |
|         ]
 | |
|       }
 | |
|     },
 | |
|     "/comment/list-by-user": {
 | |
|       "post": {
 | |
|         "operationId": "Comments_CommentListByUser",
 | |
|         "responses": {
 | |
|           "200": {
 | |
|             "description": "A successful response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/ListByUserResponse"
 | |
|             }
 | |
|           },
 | |
|           "default": {
 | |
|             "description": "An unexpected error response.",
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/rpcStatus"
 | |
|             }
 | |
|           }
 | |
|         },
 | |
|         "parameters": [
 | |
|           {
 | |
|             "name": "body",
 | |
|             "in": "body",
 | |
|             "required": true,
 | |
|             "schema": {
 | |
|               "$ref": "#/definitions/ListByUserRequest"
 | |
|             }
 | |
|           }
 | |
|         ],
 | |
|         "tags": [
 | |
|           "Comments"
 | |
|         ]
 | |
|       }
 | |
|     }
 | |
|   },
 | |
|   "definitions": {
 | |
|     "Comment": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "id": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "userId": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "sku": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "text": {
 | |
|           "type": "string"
 | |
|         },
 | |
|         "createdAt": {
 | |
|           "type": "string",
 | |
|           "format": "date-time"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "CreateCommentRequest": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "userId": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "sku": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "comment": {
 | |
|           "type": "string"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "CreateCommentResponse": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "id": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "EditCommentRequest": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "userId": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "commentId": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         },
 | |
|         "newComment": {
 | |
|           "type": "string"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "GetCommentRequest": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "id": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "GetCommentResponse": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "comment": {
 | |
|           "$ref": "#/definitions/Comment"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "ListBySkuRequest": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "sku": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "ListBySkuResponse": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "comments": {
 | |
|           "type": "array",
 | |
|           "items": {
 | |
|             "type": "object",
 | |
|             "$ref": "#/definitions/Comment"
 | |
|           }
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "ListByUserRequest": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "userId": {
 | |
|           "type": "string",
 | |
|           "format": "int64"
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "ListByUserResponse": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "comments": {
 | |
|           "type": "array",
 | |
|           "items": {
 | |
|             "type": "object",
 | |
|             "$ref": "#/definitions/Comment"
 | |
|           }
 | |
|         }
 | |
|       }
 | |
|     },
 | |
|     "protobufAny": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "@type": {
 | |
|           "type": "string"
 | |
|         }
 | |
|       },
 | |
|       "additionalProperties": {}
 | |
|     },
 | |
|     "rpcStatus": {
 | |
|       "type": "object",
 | |
|       "properties": {
 | |
|         "code": {
 | |
|           "type": "integer",
 | |
|           "format": "int32"
 | |
|         },
 | |
|         "message": {
 | |
|           "type": "string"
 | |
|         },
 | |
|         "details": {
 | |
|           "type": "array",
 | |
|           "items": {
 | |
|             "type": "object",
 | |
|             "$ref": "#/definitions/protobufAny"
 | |
|           }
 | |
|         }
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| }
 | 
