From 422e2f352db90a23ae01cdbc6d23c13bdac8a280 Mon Sep 17 00:00:00 2001 From: Mehdi Hadeli Date: Sun, 21 Jan 2024 23:42:15 +0100 Subject: [PATCH] refactoring project --- api/openapi/catalog_read_service/docs.go | 252 ------------ api/openapi/catalog_read_service/swagger.json | 225 ----------- api/openapi/catalog_read_service/swagger.yaml | 144 ------- api/openapi/catalog_write_service/docs.go | 380 ------------------ .../catalog_write_service/swagger.json | 353 ---------------- .../catalog_write_service/swagger.yaml | 228 ----------- api/openapi/order_service/docs.go | 315 --------------- api/openapi/order_service/swagger.json | 288 ------------- api/openapi/order_service/swagger.yaml | 186 --------- .../catalog_write_service/products.proto | 49 --- api/protobuf/common.proto | 1 - api/protobuf/order_service/orders.proto | 118 ------ 12 files changed, 2539 deletions(-) delete mode 100644 api/openapi/catalog_read_service/docs.go delete mode 100644 api/openapi/catalog_read_service/swagger.json delete mode 100644 api/openapi/catalog_read_service/swagger.yaml delete mode 100644 api/openapi/catalog_write_service/docs.go delete mode 100644 api/openapi/catalog_write_service/swagger.json delete mode 100644 api/openapi/catalog_write_service/swagger.yaml delete mode 100644 api/openapi/order_service/docs.go delete mode 100644 api/openapi/order_service/swagger.json delete mode 100644 api/openapi/order_service/swagger.yaml delete mode 100644 api/protobuf/catalog_write_service/products.proto delete mode 100644 api/protobuf/common.proto delete mode 100644 api/protobuf/order_service/orders.proto diff --git a/api/openapi/catalog_read_service/docs.go b/api/openapi/catalog_read_service/docs.go deleted file mode 100644 index 1c44e7b8..00000000 --- a/api/openapi/catalog_read_service/docs.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - -package catalog_read_service - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/v1/products": { - "get": { - "description": "Get all products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get all product", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/search": { - "get": { - "description": "Search products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Search products", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/{id}": { - "get": { - "description": "Get product by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get product", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto" - } - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - }, - "productId": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListQuery": { - "type": "object", - "properties": { - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/utils.FilterModel" - } - }, - "orderBy": { - "type": "string" - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "Catalogs Read-Service Api", - Description: "Catalogs Read-Service Api.", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/api/openapi/catalog_read_service/swagger.json b/api/openapi/catalog_read_service/swagger.json deleted file mode 100644 index f26438f3..00000000 --- a/api/openapi/catalog_read_service/swagger.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "Catalogs Read-Service Api.", - "title": "Catalogs Read-Service Api", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "1.0" - }, - "paths": { - "/api/v1/products": { - "get": { - "description": "Get all products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get all product", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/search": { - "get": { - "description": "Search products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Search products", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/{id}": { - "get": { - "description": "Get product by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get product", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto" - } - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - }, - "productId": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListQuery": { - "type": "object", - "properties": { - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/utils.FilterModel" - } - }, - "orderBy": { - "type": "string" - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -} \ No newline at end of file diff --git a/api/openapi/catalog_read_service/swagger.yaml b/api/openapi/catalog_read_service/swagger.yaml deleted file mode 100644 index b4c11854..00000000 --- a/api/openapi/catalog_read_service/swagger.yaml +++ /dev/null @@ -1,144 +0,0 @@ -definitions: - github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto: - properties: - createdAt: - type: string - description: - type: string - id: - type: string - name: - type: string - price: - type: number - productId: - type: string - updatedAt: - type: string - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto - : properties: - product: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto - : properties: - products: - $ref: '#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto - : properties: - products: - $ref: '#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto' - type: object - utils.FilterModel: - properties: - comparison: - type: string - field: - type: string - value: - type: string - type: object - utils.ListQuery: - properties: - filters: - items: - $ref: '#/definitions/utils.FilterModel' - type: array - orderBy: - type: string - page: - type: integer - size: - type: integer - type: object - ? utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto_ProductDto - : properties: - items: - items: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_dto.ProductDto' - type: array - page: - type: integer - size: - type: integer - totalItems: - type: integer - totalPage: - type: integer - type: object -info: - contact: - name: Mehdi Hadeli - url: https://github.com/mehdihadeli - description: Catalogs Read-Service Api. - title: Catalogs Read-Service Api - version: "1.0" -paths: - /api/v1/products: - get: - consumes: - - application/json - description: Get all products - parameters: - - in: query - name: orderBy - type: string - - in: query - name: page - type: integer - - in: query - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto' - summary: Get all product - tags: - - Products - /api/v1/products/{id}: - get: - consumes: - - application/json - description: Get product by id - parameters: - - description: Product ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_get_product_by_id_v1_dtos.GetProductByIdResponseDto' - summary: Get product - tags: - - Products - /api/v1/products/search: - get: - consumes: - - application/json - description: Search products - parameters: - - in: query - name: search - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogreadservice_internal_products_features_searching_products_v1_dtos.SearchProductsResponseDto' - summary: Search products - tags: - - Products -swagger: "2.0" diff --git a/api/openapi/catalog_write_service/docs.go b/api/openapi/catalog_write_service/docs.go deleted file mode 100644 index 5f8aa576..00000000 --- a/api/openapi/catalog_write_service/docs.go +++ /dev/null @@ -1,380 +0,0 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - -package catalog_write_service - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/v1/products": { - "get": { - "description": "Get all products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get all product", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto" - } - } - } - }, - "post": { - "description": "Create new product item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Create product", - "parameters": [ - { - "description": "Product data", - "name": "CreateProductRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto" - } - } - } - } - }, - "/api/v1/products/search": { - "get": { - "description": "Search products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Search products", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/{id}": { - "get": { - "description": "Get product by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get product by id", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto" - } - } - } - }, - "put": { - "description": "Update existing product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Update product", - "parameters": [ - { - "description": "Product data", - "name": "UpdateProductRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto" - } - }, - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - }, - "delete": { - "description": "Delete existing product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Delete product", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - }, - "productId": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto": { - "type": "object", - "properties": { - "productId": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListQuery": { - "type": "object", - "properties": { - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/utils.FilterModel" - } - }, - "orderBy": { - "type": "string" - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "Catalogs Write-Service Api", - Description: "Catalogs Write-Service Api.", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/api/openapi/catalog_write_service/swagger.json b/api/openapi/catalog_write_service/swagger.json deleted file mode 100644 index 87ed034e..00000000 --- a/api/openapi/catalog_write_service/swagger.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "Catalogs Write-Service Api.", - "title": "Catalogs Write-Service Api", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "1.0" - }, - "paths": { - "/api/v1/products": { - "get": { - "description": "Get all products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get all product", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto" - } - } - } - }, - "post": { - "description": "Create new product item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Create product", - "parameters": [ - { - "description": "Product data", - "name": "CreateProductRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto" - } - } - } - } - }, - "/api/v1/products/search": { - "get": { - "description": "Search products", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Search products", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto" - } - } - } - } - }, - "/api/v1/products/{id}": { - "get": { - "description": "Get product by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Get product by id", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto" - } - } - } - }, - "put": { - "description": "Update existing product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Update product", - "parameters": [ - { - "description": "Product data", - "name": "UpdateProductRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto" - } - }, - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - }, - "delete": { - "description": "Delete existing product", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Products" - ], - "summary": "Delete product", - "parameters": [ - { - "type": "string", - "description": "Product ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - }, - "productId": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto": { - "type": "object", - "properties": { - "productId": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto": { - "type": "object", - "properties": { - "product": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto": { - "type": "object", - "properties": { - "products": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "price": { - "type": "number" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListQuery": { - "type": "object", - "properties": { - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/utils.FilterModel" - } - }, - "orderBy": { - "type": "string" - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -} \ No newline at end of file diff --git a/api/openapi/catalog_write_service/swagger.yaml b/api/openapi/catalog_write_service/swagger.yaml deleted file mode 100644 index 3427a1bf..00000000 --- a/api/openapi/catalog_write_service/swagger.yaml +++ /dev/null @@ -1,228 +0,0 @@ -definitions: - github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto: - properties: - createdAt: - type: string - description: - type: string - name: - type: string - price: - type: number - productId: - type: string - updatedAt: - type: string - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto - : properties: - description: - type: string - name: - type: string - price: - type: number - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto - : properties: - productId: - type: string - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto - : properties: - product: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto - : properties: - products: - $ref: '#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto - : properties: - products: - $ref: '#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto - : properties: - description: - type: string - name: - type: string - price: - type: number - type: object - utils.FilterModel: - properties: - comparison: - type: string - field: - type: string - value: - type: string - type: object - utils.ListQuery: - properties: - filters: - items: - $ref: '#/definitions/utils.FilterModel' - type: array - orderBy: - type: string - page: - type: integer - size: - type: integer - type: object - ? utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1_ProductDto - : properties: - items: - items: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_dto_v1.ProductDto' - type: array - page: - type: integer - size: - type: integer - totalItems: - type: integer - totalPage: - type: integer - type: object -info: - contact: - name: Mehdi Hadeli - url: https://github.com/mehdihadeli - description: Catalogs Write-Service Api. - title: Catalogs Write-Service Api - version: "1.0" -paths: - /api/v1/products: - get: - consumes: - - application/json - description: Get all products - parameters: - - in: query - name: orderBy - type: string - - in: query - name: page - type: integer - - in: query - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_products_v1_dtos.GetProductsResponseDto' - summary: Get all product - tags: - - Products - post: - consumes: - - application/json - description: Create new product item - parameters: - - description: Product data - in: body - name: CreateProductRequestDto - required: true - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductRequestDto' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_creating_product_v1_dtos.CreateProductResponseDto' - summary: Create product - tags: - - Products - /api/v1/products/{id}: - delete: - consumes: - - application/json - description: Delete existing product - parameters: - - description: Product ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "204": - description: No Content - summary: Delete product - tags: - - Products - get: - consumes: - - application/json - description: Get product by id - parameters: - - description: Product ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_getting_product_by_id_v1_dtos.GetProductByIdResponseDto' - summary: Get product by id - tags: - - Products - put: - consumes: - - application/json - description: Update existing product - parameters: - - description: Product data - in: body - name: UpdateProductRequestDto - required: true - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_updating_product_v1_dtos.UpdateProductRequestDto' - - description: Product ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "204": - description: No Content - summary: Update product - tags: - - Products - /api/v1/products/search: - get: - consumes: - - application/json - description: Search products - parameters: - - in: query - name: search - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_catalogwriteservice_internal_products_features_searching_product_v1_dtos.SearchProductsResponseDto' - summary: Search products - tags: - - Products -swagger: "2.0" diff --git a/api/openapi/order_service/docs.go b/api/openapi/order_service/docs.go deleted file mode 100644 index 934905f3..00000000 --- a/api/openapi/order_service/docs.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - -package order_service - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/v1/orders": { - "get": { - "description": "Get all orders", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Get all orders", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto" - } - } - } - }, - "post": { - "description": "Create new order", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Create order", - "parameters": [ - { - "description": "Order data", - "name": "CreateOrderRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto" - } - } - } - } - }, - "/api/v1/orders/{id}": { - "get": { - "description": "Get order by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Get order by id", - "parameters": [ - { - "type": "string", - "description": "Order ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto" - } - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto": { - "type": "object", - "properties": { - "accountEmail": { - "type": "string" - }, - "cancelReason": { - "type": "string" - }, - "canceled": { - "type": "boolean" - }, - "completed": { - "type": "boolean" - }, - "createdAt": { - "type": "string" - }, - "deliveredTime": { - "type": "string" - }, - "deliveryAddress": { - "type": "string" - }, - "id": { - "type": "string" - }, - "orderId": { - "type": "string" - }, - "paid": { - "type": "boolean" - }, - "paymentId": { - "type": "string" - }, - "shopItems": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto" - } - }, - "submitted": { - "type": "boolean" - }, - "totalPrice": { - "type": "number" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "price": { - "type": "number" - }, - "quantity": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "price": { - "type": "number" - }, - "quantity": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto": { - "type": "object", - "properties": { - "accountEmail": { - "type": "string" - }, - "deliveryAddress": { - "type": "string" - }, - "deliveryTime": { - "type": "string" - }, - "shopItems": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto" - } - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto": { - "type": "object", - "properties": { - "Id": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto": { - "type": "object", - "properties": { - "order": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto": { - "type": "object", - "properties": { - "orders": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "Orders Service Api", - Description: "Orders Service Api", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/api/openapi/order_service/swagger.json b/api/openapi/order_service/swagger.json deleted file mode 100644 index 3af5fd5b..00000000 --- a/api/openapi/order_service/swagger.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "Orders Service Api", - "title": "Orders Service Api", - "contact": { - "name": "Mehdi Hadeli", - "url": "https://github.com/mehdihadeli" - }, - "version": "1.0" - }, - "paths": { - "/api/v1/orders": { - "get": { - "description": "Get all orders", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Get all orders", - "parameters": [ - { - "type": "string", - "name": "orderBy", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto" - } - } - } - }, - "post": { - "description": "Create new order", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Create order", - "parameters": [ - { - "description": "Order data", - "name": "CreateOrderRequestDto", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto" - } - } - ], - "responses": { - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto" - } - } - } - } - }, - "/api/v1/orders/{id}": { - "get": { - "description": "Get order by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Orders" - ], - "summary": "Get order by id", - "parameters": [ - { - "type": "string", - "description": "Order ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto" - } - } - } - } - } - }, - "definitions": { - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto": { - "type": "object", - "properties": { - "accountEmail": { - "type": "string" - }, - "cancelReason": { - "type": "string" - }, - "canceled": { - "type": "boolean" - }, - "completed": { - "type": "boolean" - }, - "createdAt": { - "type": "string" - }, - "deliveredTime": { - "type": "string" - }, - "deliveryAddress": { - "type": "string" - }, - "id": { - "type": "string" - }, - "orderId": { - "type": "string" - }, - "paid": { - "type": "boolean" - }, - "paymentId": { - "type": "string" - }, - "shopItems": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto" - } - }, - "submitted": { - "type": "boolean" - }, - "totalPrice": { - "type": "number" - }, - "updatedAt": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "price": { - "type": "number" - }, - "quantity": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "price": { - "type": "number" - }, - "quantity": { - "type": "integer" - }, - "title": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto": { - "type": "object", - "properties": { - "accountEmail": { - "type": "string" - }, - "deliveryAddress": { - "type": "string" - }, - "deliveryTime": { - "type": "string" - }, - "shopItems": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto" - } - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto": { - "type": "object", - "properties": { - "Id": { - "type": "string" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto": { - "type": "object", - "properties": { - "order": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto" - } - } - }, - "github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto": { - "type": "object", - "properties": { - "orders": { - "$ref": "#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto" - } - } - }, - "utils.FilterModel": { - "type": "object", - "properties": { - "comparison": { - "type": "string" - }, - "field": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto" - } - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalItems": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - } - } - } - } -} \ No newline at end of file diff --git a/api/openapi/order_service/swagger.yaml b/api/openapi/order_service/swagger.yaml deleted file mode 100644 index 8229daac..00000000 --- a/api/openapi/order_service/swagger.yaml +++ /dev/null @@ -1,186 +0,0 @@ -definitions: - github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto: - properties: - accountEmail: - type: string - cancelReason: - type: string - canceled: - type: boolean - completed: - type: boolean - createdAt: - type: string - deliveredTime: - type: string - deliveryAddress: - type: string - id: - type: string - orderId: - type: string - paid: - type: boolean - paymentId: - type: string - shopItems: - items: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto' - type: array - submitted: - type: boolean - totalPrice: - type: number - updatedAt: - type: string - type: object - github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto: - properties: - description: - type: string - price: - type: number - quantity: - type: integer - title: - type: string - type: object - github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemReadDto: - properties: - description: - type: string - price: - type: number - quantity: - type: integer - title: - type: string - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto - : properties: - accountEmail: - type: string - deliveryAddress: - type: string - deliveryTime: - type: string - shopItems: - items: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.ShopItemDto' - type: array - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto - : properties: - Id: - type: string - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto - : properties: - order: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto' - type: object - ? github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto - : properties: - orders: - $ref: '#/definitions/utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto' - type: object - utils.FilterModel: - properties: - comparison: - type: string - field: - type: string - value: - type: string - type: object - ? utils.ListResult-github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1_OrderReadDto - : properties: - items: - items: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_dtos_v1.OrderReadDto' - type: array - page: - type: integer - size: - type: integer - totalItems: - type: integer - totalPage: - type: integer - type: object -info: - contact: - name: Mehdi Hadeli - url: https://github.com/mehdihadeli - description: Orders Service Api - title: Orders Service Api - version: "1.0" -paths: - /api/v1/orders: - get: - consumes: - - application/json - description: Get all orders - parameters: - - in: query - name: orderBy - type: string - - in: query - name: page - type: integer - - in: query - name: size - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_orders_v1_dtos.GetOrdersResponseDto' - summary: Get all orders - tags: - - Orders - post: - consumes: - - application/json - description: Create new order - parameters: - - description: Order data - in: body - name: CreateOrderRequestDto - required: true - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderRequestDto' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_creating_order_v1_dtos.CreateOrderResponseDto' - summary: Create order - tags: - - Orders - /api/v1/orders/{id}: - get: - consumes: - - application/json - description: Get order by id - parameters: - - description: Order ID - in: path - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_mehdihadeli_go-ecommerce-microservices_internal_services_orderservice_internal_orders_features_getting_order_by_id_v1_dtos.GetOrderByIdResponseDto' - summary: Get order by id - tags: - - Orders -swagger: "2.0" diff --git a/api/protobuf/catalog_write_service/products.proto b/api/protobuf/catalog_write_service/products.proto deleted file mode 100644 index 4e01c0af..00000000 --- a/api/protobuf/catalog_write_service/products.proto +++ /dev/null @@ -1,49 +0,0 @@ -syntax = "proto3"; - -import "google/protobuf/timestamp.proto"; - -package products_service; - -option go_package = "./;products_service"; - -service ProductsService { - rpc CreateProduct(CreateProductReq) returns (CreateProductRes); - rpc UpdateProduct(UpdateProductReq) returns (UpdateProductRes); - rpc GetProductById(GetProductByIdReq) returns (GetProductByIdRes); -} - -message Product { - string ProductId = 1; - string Name = 2; - string Description = 3; - double Price = 4; - google.protobuf.Timestamp CreatedAt = 6; - google.protobuf.Timestamp UpdatedAt = 7; -} - -message CreateProductReq { - string Name = 1; - string Description = 2; - double Price = 3; -} - -message CreateProductRes { - string ProductId = 1; -} - -message UpdateProductReq { - string ProductId = 1; - string Name = 2; - string Description = 3; - double Price = 4; -} - -message UpdateProductRes {} - -message GetProductByIdReq { - string ProductId = 1; -} - -message GetProductByIdRes { - Product Product = 1; -} \ No newline at end of file diff --git a/api/protobuf/common.proto b/api/protobuf/common.proto deleted file mode 100644 index 410bfdea..00000000 --- a/api/protobuf/common.proto +++ /dev/null @@ -1 +0,0 @@ -syntax = "proto3"; diff --git a/api/protobuf/order_service/orders.proto b/api/protobuf/order_service/orders.proto deleted file mode 100644 index 904c2c4a..00000000 --- a/api/protobuf/order_service/orders.proto +++ /dev/null @@ -1,118 +0,0 @@ -syntax = "proto3"; - -package orders_service; - -option go_package = "./;orders_service"; - -import "google/protobuf/timestamp.proto"; - - -message ShopItem { - string Title = 1; - string Description = 2; - uint64 Quantity = 3; - double Price = 4; -} - -message Order { - string OrderId = 1; - repeated ShopItem ShopItems = 2; - bool Paid = 3; - bool Submitted = 4; - bool Completed = 5; - bool Canceled = 6; - double TotalPrice = 7; - string AccountEmail = 8; - string CancelReason = 9; - string DeliveryAddress = 10; - google.protobuf.Timestamp DeliveredTime = 11; - google.protobuf.Timestamp CreatedAt = 12; - google.protobuf.Timestamp UpdatedAt = 13; - string PaymentId = 14; -} - -message OrderReadModel { - string Id = 1; - string OrderId = 2; - repeated ShopItemReadModel ShopItems = 3; - bool Paid = 4; - bool Submitted = 5; - bool Completed = 6; - bool Canceled = 7; - double TotalPrice = 8; - string AccountEmail = 9; - string CancelReason = 10; - string DeliveryAddress = 11; - google.protobuf.Timestamp DeliveredTime = 12; - google.protobuf.Timestamp CreatedAt = 13; - google.protobuf.Timestamp UpdatedAt = 14; - string PaymentId = 15; -} - -message ShopItemReadModel { - string Title = 1; - string Description = 2; - uint64 Quantity = 3; - double Price = 4; -} - -message CreateOrderReq { - string AccountEmail = 1; - repeated ShopItem ShopItems = 2; - string DeliveryAddress = 3; - google.protobuf.Timestamp DeliveryTime = 4; -} - -message CreateOrderRes { - string OrderId = 1; -} - -message SubmitOrderReq { - string OrderId = 1; -} - -message SubmitOrderRes { - string OrderId = 1; -} - -message GetOrderByIDReq { - string Id = 1; -} - -message GetOrderByIDRes { - OrderReadModel Order = 1; -} - -message UpdateShoppingCartReq { - string OrderId = 1; - repeated ShopItem ShopItems = 2; -} - -message UpdateShoppingCartRes {} - -message GetOrdersReq { - string SearchText = 1; - int32 Page = 2; - int32 Size = 3; -} - -message GetOrdersRes { - Pagination Pagination = 1; - repeated OrderReadModel Orders = 2; -} - -message Pagination { - int64 TotalItems = 1; - int32 TotalPages = 2; - int32 Page = 3; - int32 Size = 4; - bool HasMore = 5; -} - -service OrdersService { - rpc CreateOrder(CreateOrderReq) returns (CreateOrderRes); - rpc SubmitOrder(SubmitOrderReq) returns (SubmitOrderRes); - rpc UpdateShoppingCart(UpdateShoppingCartReq) returns (UpdateShoppingCartRes); - rpc GetOrderByID(GetOrderByIDReq) returns (GetOrderByIDRes); - rpc GetOrders(GetOrdersReq) returns (GetOrdersRes); -}