From 1babf3fee69aa9c55c0486044e2a60d57ce13840 Mon Sep 17 00:00:00 2001 From: Taeho Choi <48103834+Taehoya@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:14:56 -0600 Subject: [PATCH] update swagger (#56) --- server/docs/docs.go | 38 ++++++++++++++++++++++++++++++++------ server/docs/swagger.json | 38 ++++++++++++++++++++++++++++++++------ server/docs/swagger.yaml | 28 +++++++++++++++++++++++----- 3 files changed, 87 insertions(+), 17 deletions(-) diff --git a/server/docs/docs.go b/server/docs/docs.go index 5dfaacf..1f24e91 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -698,13 +698,9 @@ const docTemplate = `{ "type": "integer", "example": 1 }, - "name_en": { + "name": { "type": "string", "example": "Food" - }, - "name_ko": { - "type": "string", - "example": "음식" } } }, @@ -713,7 +709,7 @@ const docTemplate = `{ "properties": { "amount": { "type": "number", - "example": 2000.12 + "example": 100.12 }, "categoryId": { "type": "integer", @@ -737,6 +733,30 @@ const docTemplate = `{ } } }, + "dto.TransactionResponseDTO": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "example": 100.12 + }, + "category": { + "$ref": "#/definitions/dto.TransactionOption" + }, + "description": { + "type": "string", + "example": "sample-description" + }, + "name": { + "type": "string", + "example": "sample-name" + }, + "transactionDateTime": { + "type": "string", + "example": "2023-11-25T15:04:05Z" + } + } + }, "dto.TripNoteProperty": { "type": "object", "required": [ @@ -835,6 +855,12 @@ const docTemplate = `{ "startDateTime": { "type": "string", "example": "2024-01-02T15:04:05Z" + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.TransactionResponseDTO" + } } } }, diff --git a/server/docs/swagger.json b/server/docs/swagger.json index 79c3f18..c9d8b68 100644 --- a/server/docs/swagger.json +++ b/server/docs/swagger.json @@ -690,13 +690,9 @@ "type": "integer", "example": 1 }, - "name_en": { + "name": { "type": "string", "example": "Food" - }, - "name_ko": { - "type": "string", - "example": "음식" } } }, @@ -705,7 +701,7 @@ "properties": { "amount": { "type": "number", - "example": 2000.12 + "example": 100.12 }, "categoryId": { "type": "integer", @@ -729,6 +725,30 @@ } } }, + "dto.TransactionResponseDTO": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "example": 100.12 + }, + "category": { + "$ref": "#/definitions/dto.TransactionOption" + }, + "description": { + "type": "string", + "example": "sample-description" + }, + "name": { + "type": "string", + "example": "sample-name" + }, + "transactionDateTime": { + "type": "string", + "example": "2023-11-25T15:04:05Z" + } + } + }, "dto.TripNoteProperty": { "type": "object", "required": [ @@ -827,6 +847,12 @@ "startDateTime": { "type": "string", "example": "2024-01-02T15:04:05Z" + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.TransactionResponseDTO" + } } } }, diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml index e3a09e5..ee356b9 100644 --- a/server/docs/swagger.yaml +++ b/server/docs/swagger.yaml @@ -41,17 +41,14 @@ definitions: id: example: 1 type: integer - name_en: + name: example: Food type: string - name_ko: - example: 음식 - type: string type: object dto.TransactionRequestDTO: properties: amount: - example: 2000.12 + example: 100.12 type: number categoryId: example: 1 @@ -69,6 +66,23 @@ definitions: example: 1 type: integer type: object + dto.TransactionResponseDTO: + properties: + amount: + example: 100.12 + type: number + category: + $ref: '#/definitions/dto.TransactionOption' + description: + example: sample-description + type: string + name: + example: sample-name + type: string + transactionDateTime: + example: "2023-11-25T15:04:05Z" + type: string + type: object dto.TripNoteProperty: properties: boundColor: @@ -140,6 +154,10 @@ definitions: startDateTime: example: "2024-01-02T15:04:05Z" type: string + transactions: + items: + $ref: '#/definitions/dto.TransactionResponseDTO' + type: array required: - countryProperty type: object