From 848d80a45e26155da66d421b2142be516cc5539b Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Thu, 26 Dec 2024 17:12:08 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E6=94=AF=E5=87=BA=E5=85=83api=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 99 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 2cb5264a6..f3ac6ffc5 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -767,6 +767,72 @@ paths: "200": description: yearで指定されたexpensesを取得 content: {} + /financail_records: + get: + tags: + - financial_record + description: financial_recordの一覧を取得 + responses: + "200": + description: financial_recordの一覧の取得 + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/financial_record_detail" + post: + tags: + - financial_record + description: financial_recordの作成 + reequestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/financial_record" + required: false + responses: + "200": + description: create されたfinancial_recordが返ってくる + content: {} + /financail_records/{id}: + put: + tags: + - financial_record + description: financial_recordの更新 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/financial_record" + required: false + responses: + "200": + description: 更新されたfinancial_recordが返ってくる + content: {} + x-codegen-request-body-name: financial_record + delete: + tags: + - financial_record + description: IDを指定してfinancial_recordの削除 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + responses: + "200": + description: financial_recordの削除完了 + content: {} /fund_informations: get: tags: @@ -1835,6 +1901,39 @@ components: sponsorStyleID: type: integer example: 1 + financial_record: + required: + - name + - year_id + type: object + properties: + name: + type: string + example: 総務局 + year_id: + type: integer + example: 1 + financial_record_detail: + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: 総務局 + year: + type: integer + example: 2024 + budget: + type: integer + example: 100000 + expense: + type: integer + example: 10000 + balance: + type: integer + example: 90000 sponsorStyle: required: - feature From 08e1a7ce441e3c82521c5dead8cc2c2eddb85360 Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Thu, 26 Dec 2024 17:26:56 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=E9=83=A8=E9=96=80=E3=81=AEapi=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 111 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 6 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index f3ac6ffc5..f0b8e58b2 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -626,6 +626,72 @@ paths: "200": description: departmentの削除完了 content: {} + /divisions: + get: + tags: + - division + description: divisionの一覧の取得 + responses: + "200": + description: divisionの一覧を取得 + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/divisionDetail" + post: + tags: + - division + description: divisionの作成 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/division" + required: false + responses: + "200": + description: 作成されたdivisionが返ってくる + content: {} + /divisions/{id}: + put: + tags: + - division + description: divisionの更新 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/division" + required: false + responses: + "200": + description: 更新されたdivisionが返ってくる + content: {} + x-codegen-request-body-name: division + delete: + tags: + - division + description: IDを指定してdivisionの削除 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + responses: + "200": + description: divisionの削除完了 + content: {} /expenses: get: tags: @@ -780,16 +846,16 @@ paths: schema: type: array items: - $ref: "#/components/schemas/financial_record_detail" + $ref: "#/components/schemas/financialRecordDetail" post: tags: - financial_record description: financial_recordの作成 - reequestBody: + requestBody: content: application/json: schema: - $ref: "#/components/schemas/financial_record" + $ref: "#/components/schemas/financialRecord" required: false responses: "200": @@ -811,7 +877,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/financial_record" + $ref: "#/components/schemas/financialRecord" required: false responses: "200": @@ -1901,7 +1967,40 @@ components: sponsorStyleID: type: integer example: 1 - financial_record: + division: + required: + - name + - financialRecordID + type: object + properties: + name: + type: string + example: 衛生管理部門 + financialRecordID: + type: integer + example: 1 + divisionDetail: + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: 衛生管理部門 + financialRecord: + type: string + example: 総務局 + budget: + type: integer + example: 10000 + expense: + type: integer + example: 1000 + balance: + type: integer + example: 9000 + financialRecord: required: - name - year_id @@ -1913,7 +2012,7 @@ components: year_id: type: integer example: 1 - financial_record_detail: + financialRecordDetail: type: object properties: id: From 3621d13258e5010382d61213292bd63b623e037c Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Thu, 26 Dec 2024 17:49:41 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=E3=80=80=E8=B3=BC=E5=85=A5=E7=89=A9?= =?UTF-8?q?=E5=93=81=E3=81=AEopenapi=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 109 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index f0b8e58b2..a1832a34a 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -833,6 +833,72 @@ paths: "200": description: yearで指定されたexpensesを取得 content: {} + /festival_items: + get: + tags: + - festival_item + description: festival_itemの一覧の取得 + responses: + "200": + description: festival_itemの一覧を取得 + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/festivalItemDetail" + post: + tags: + - festival_item + description: festival_itemの作成 + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/festivalItem" + required: false + responses: + "200": + description: 作成されたfestival_itemが返ってくる + content: {} + /festival_items/{id}: + put: + tags: + - festival_item + description: festival_itemの更新 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/festivalItem" + required: false + responses: + "200": + description: 更新されたfestival_itemが返ってくる + content: {} + x-codegen-request-body-name: festivalItem + delete: + tags: + - festival_item + description: IDを指定してfestival_itemの削除 + parameters: + - name: id + in: path + description: id + required: true + schema: + type: integer + responses: + "200": + description: festival_itemの削除完了 + content: {} /financail_records: get: tags: @@ -2000,6 +2066,49 @@ components: balance: type: integer example: 9000 + festivalItem: + required: + - name + - divisionId + - amount + type: object + properties: + name: + type: string + example: 農ポリ + divisionId: + type: integer + example: 1 + amount: + type: integer + example: 10000 + memo: + type: string + example: "" + festivalItemDetail: + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: 農ポリ + division: + type: string + example: 総務局 + budget: + type: integer + example: 10000 + expense: + type: integer + example: 1000 + balance: + type: integer + example: 9000 + memo: + type: string + example: "" financialRecord: required: - name From 9f46fa0c1d6f68c8a9ba28d8d05ad252c0e41fc5 Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Thu, 26 Dec 2024 20:42:47 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=E3=83=AC=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 57 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index a1832a34a..a94bd03c0 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -637,9 +637,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: "#/components/schemas/divisionDetail" + $ref: "#/components/schemas/divisionDetails" post: tags: - division @@ -844,9 +842,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: "#/components/schemas/festivalItemDetail" + $ref: "#/components/schemas/festivalItemDetails" post: tags: - festival_item @@ -910,9 +906,7 @@ paths: content: application/json: schema: - type: array - items: - $ref: "#/components/schemas/financialRecordDetail" + $ref: "#/components/schemas/financialRecordDetails" post: tags: - financial_record @@ -2045,7 +2039,16 @@ components: financialRecordID: type: integer example: 1 - divisionDetail: + divisionDetails: + type: object + properties: + total: + $ref: "#/components/schemas/total" + divisions: + type: array + items: + $ref: "#/components/schemas/divisionWithBalance" + divisionWithBalance: type: object properties: id: @@ -2085,7 +2088,16 @@ components: memo: type: string example: "" - festivalItemDetail: + festivalItemDetails: + type: object + properties: + total: + $ref: "#/components/schemas/total" + festivalItems: + type: array + items: + $ref: "#/components/schemas/festivalItemWithBalance" + festivalItemWithBalance: type: object properties: id: @@ -2121,7 +2133,16 @@ components: year_id: type: integer example: 1 - financialRecordDetail: + financialRecordDetails: + type: object + properties: + total: + $ref: "#/components/schemas/total" + financialRecords: + type: array + items: + $ref: "#/components/schemas/financialRecordWithBalance" + financialRecordWithBalance: type: object properties: id: @@ -2234,6 +2255,18 @@ components: remark: type: string example: "" + total: + type: object + properties: + budget: + type: integer + example: 100000 + expense: + type: integer + example: 10000 + balance: + type: integer + example: 90000 year_periods: required: - endedAt From 71bb85afed74c6a19921887f45e186a5a35557b8 Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Fri, 27 Dec 2024 10:24:26 +0900 Subject: [PATCH 5/7] =?UTF-8?q?gomod=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/go.mod | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/go.mod b/api/go.mod index 72c6a783a..ebbfbb747 100644 --- a/api/go.mod +++ b/api/go.mod @@ -6,10 +6,9 @@ require ( github.com/go-sql-driver/mysql v1.6.0 github.com/go-test/deep v1.0.8 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect github.com/joho/godotenv v1.4.0 github.com/labstack/echo/v4 v4.11.4 - github.com/oapi-codegen/runtime v1.1.1 // indirect + github.com/oapi-codegen/runtime v1.1.1 github.com/pkg/errors v0.9.1 github.com/slack-go/slack v0.13.0 github.com/stretchr/testify v1.9.0 // indirect From 2c6ae916fcb1301e3f9d6045378a23a5304562a4 Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Fri, 27 Dec 2024 10:28:39 +0900 Subject: [PATCH 6/7] =?UTF-8?q?yml=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index ba33b4c4d..eeed39d9c 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -777,7 +777,7 @@ paths: application/json: schema: $ref: "#/components/schemas/division" - required: false + required: true responses: "200": description: 作成されたdivisionが返ってくる @@ -799,7 +799,7 @@ paths: application/json: schema: $ref: "#/components/schemas/division" - required: false + required: true responses: "200": description: 更新されたdivisionが返ってくる @@ -1014,7 +1014,7 @@ paths: application/json: schema: $ref: "#/components/schemas/festivalItem" - required: false + required: true responses: "200": description: 作成されたfestival_itemが返ってくる @@ -1036,7 +1036,7 @@ paths: application/json: schema: $ref: "#/components/schemas/festivalItem" - required: false + required: true responses: "200": description: 更新されたfestival_itemが返ってくる @@ -1078,7 +1078,7 @@ paths: application/json: schema: $ref: "#/components/schemas/financialRecord" - required: false + required: true responses: "200": description: create されたfinancial_recordが返ってくる @@ -1100,7 +1100,7 @@ paths: application/json: schema: $ref: "#/components/schemas/financialRecord" - required: false + required: true responses: "200": description: 更新されたfinancial_recordが返ってくる From 050555ea0f1066c62785636e588c2ad07a53ab12 Mon Sep 17 00:00:00 2001 From: Kubosaka Date: Fri, 27 Dec 2024 10:35:07 +0900 Subject: [PATCH 7/7] =?UTF-8?q?response=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/openapi.yaml | 48 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index eeed39d9c..bf50e8add 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -781,7 +781,10 @@ paths: responses: "200": description: 作成されたdivisionが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/divisionWithBalance" /divisions/{id}: put: tags: @@ -803,7 +806,10 @@ paths: responses: "200": description: 更新されたdivisionが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/divisionWithBalance" x-codegen-request-body-name: division delete: tags: @@ -819,7 +825,10 @@ paths: responses: "200": description: divisionの削除完了 - content: {} + content: + application/json: + schema: + type: object /expenses: get: tags: @@ -1018,7 +1027,10 @@ paths: responses: "200": description: 作成されたfestival_itemが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/festivalItemWithBalance" /festival_items/{id}: put: tags: @@ -1040,7 +1052,10 @@ paths: responses: "200": description: 更新されたfestival_itemが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/festivalItemWithBalance" x-codegen-request-body-name: festivalItem delete: tags: @@ -1056,7 +1071,10 @@ paths: responses: "200": description: festival_itemの削除完了 - content: {} + content: + application/json: + schema: + type: object /financail_records: get: tags: @@ -1082,7 +1100,10 @@ paths: responses: "200": description: create されたfinancial_recordが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/financialRecordWithBalance" /financail_records/{id}: put: tags: @@ -1104,7 +1125,10 @@ paths: responses: "200": description: 更新されたfinancial_recordが返ってくる - content: {} + content: + application/json: + schema: + $ref: "#/components/schemas/financialRecordWithBalance" x-codegen-request-body-name: financial_record delete: tags: @@ -1120,7 +1144,10 @@ paths: responses: "200": description: financial_recordの削除完了 - content: {} + content: + application/json: + schema: + type: object /fund_informations: get: tags: @@ -2457,6 +2484,9 @@ components: type: string example: 農ポリ division: + type: string + example: 衛生管理部門 + financialRecord: type: string example: 総務局 budget: