From 212df41eff8847d13a4d632b644a91d9446accd6 Mon Sep 17 00:00:00 2001 From: kentah <158997636+KentaHizume@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:22:38 +0900 Subject: [PATCH] =?UTF-8?q?OpenAPI=E5=AE=9A=E7=BE=A9=E3=81=A7Maia=E3=81=A8?= =?UTF-8?q?=E3=81=AE=E5=B7=AE=E5=88=86=E3=82=92=E5=B0=8F=E3=81=95=E3=81=8F?= =?UTF-8?q?=E3=81=99=E3=82=8B=20(#1013)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * DresscaについてoperationIdを指定 * AzureADB2Cのサンプルについて対応 * api-clientを削除&新規作成することで、不要なAPIモデルを削除 * AzureADB2Cについて削除と再作成を実施 --- .../Controllers/ServerTimeController.cs | 2 + .../Controllers/UsersController.cs | 2 + .../src/Dressca.Web/dressca-api.json | 4 +- .../api-client/api/server-time-api.ts | 14 ++--- .../src/generated/api-client/api/users-api.ts | 14 ++--- .../src/stores/serverTime/serverTime.ts | 2 +- .../auth-frontend/src/stores/user/user.ts | 2 +- .../Controllers/AssetsController.cs | 2 + .../Controllers/BasketItemsController.cs | 5 ++ .../Controllers/CatalogBrandsController.cs | 2 + .../CatalogCategoriesController.cs | 2 + .../Controllers/CatalogItemsController.cs | 2 + .../Controllers/OrdersController.cs | 3 + .../src/Dressca.Web/dressca-api.json | 20 +++--- .../generated/api-client/api/assets-api.ts | 16 ++--- .../api-client/api/basket-items-api.ts | 62 +++++++++---------- .../api-client/api/catalog-brands-api.ts | 14 ++--- .../api-client/api/catalog-categories-api.ts | 14 ++--- .../api-client/api/catalog-items-api.ts | 14 ++--- .../generated/api-client/api/orders-api.ts | 32 +++++----- .../src/stores/basket/basket.ts | 8 +-- .../src/stores/catalog/catalog.ts | 7 +-- .../src/stores/ordering/ordering.ts | 4 +- 23 files changed, 133 insertions(+), 114 deletions(-) diff --git a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/ServerTimeController.cs b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/ServerTimeController.cs index 56d5f1f40..ef1a0cc64 100644 --- a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/ServerTimeController.cs +++ b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/ServerTimeController.cs @@ -1,5 +1,6 @@ using Dressca.Web.Dto.ServerTime; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -40,6 +41,7 @@ internal ServerTimeController(ILogger logger, TimeProvider /// サーバー時間。 [HttpGet] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(ServerTimeResponse))] + [OpenApiOperation("getServerTime")] public IActionResult Get() { var currentTime = this.timeProvider.GetLocalNow(); diff --git a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/UsersController.cs b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/UsersController.cs index c110f171a..b762f4859 100644 --- a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/UsersController.cs +++ b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/Controllers/UsersController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Identity.Web; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -23,6 +24,7 @@ public class UsersController : ControllerBase [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(UserResponse))] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [Authorize] + [OpenApiOperation("getUser")] public IActionResult GetUser() { var userId = this.User.GetNameIdentifierId(); diff --git a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/dressca-api.json b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/dressca-api.json index 3c65327e7..e376c67b7 100644 --- a/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/dressca-api.json +++ b/samples/AzureADB2CAuth/auth-backend/src/Dressca.Web/dressca-api.json @@ -19,7 +19,7 @@ "ServerTime" ], "summary": "認証不要で現在のサーバー時間を取得します。", - "operationId": "ServerTime_Get", + "operationId": "getServerTime", "responses": { "200": { "description": "サーバー時間。", @@ -40,7 +40,7 @@ "Users" ], "summary": "認証済みユーザーのユーザー情報を取得します。", - "operationId": "Users_GetUser", + "operationId": "getUser", "responses": { "200": { "description": "成功。", diff --git a/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/server-time-api.ts b/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/server-time-api.ts index 9af2ccf86..79bcf41f0 100644 --- a/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/server-time-api.ts +++ b/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/server-time-api.ts @@ -34,7 +34,7 @@ export const ServerTimeApiAxiosParamCreator = function (configuration?: Configur * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serverTimeGet: async (options: AxiosRequestConfig = {}): Promise => { + getServerTime: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/servertime`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -74,8 +74,8 @@ export const ServerTimeApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async serverTimeGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.serverTimeGet(options); + async getServerTime(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getServerTime(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -94,8 +94,8 @@ export const ServerTimeApiFactory = function (configuration?: Configuration, bas * @param {*} [options] Override http request option. * @throws {RequiredError} */ - serverTimeGet(options?: any): AxiosPromise { - return localVarFp.serverTimeGet(options).then((request) => request(axios, basePath)); + getServerTime(options?: any): AxiosPromise { + return localVarFp.getServerTime(options).then((request) => request(axios, basePath)); }, }; }; @@ -114,7 +114,7 @@ export class ServerTimeApi extends BaseAPI { * @throws {RequiredError} * @memberof ServerTimeApi */ - public serverTimeGet(options?: AxiosRequestConfig) { - return ServerTimeApiFp(this.configuration).serverTimeGet(options).then((request) => request(this.axios, this.basePath)); + public getServerTime(options?: AxiosRequestConfig) { + return ServerTimeApiFp(this.configuration).getServerTime(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/users-api.ts b/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/users-api.ts index 2d2d2f044..6bd237b62 100644 --- a/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/users-api.ts +++ b/samples/AzureADB2CAuth/auth-frontend/src/generated/api-client/api/users-api.ts @@ -34,7 +34,7 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersGetUser: async (options: AxiosRequestConfig = {}): Promise => { + getUser: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/users`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -78,8 +78,8 @@ export const UsersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async usersGetUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.usersGetUser(options); + async getUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUser(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -98,8 +98,8 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - usersGetUser(options?: any): AxiosPromise { - return localVarFp.usersGetUser(options).then((request) => request(axios, basePath)); + getUser(options?: any): AxiosPromise { + return localVarFp.getUser(options).then((request) => request(axios, basePath)); }, }; }; @@ -118,7 +118,7 @@ export class UsersApi extends BaseAPI { * @throws {RequiredError} * @memberof UsersApi */ - public usersGetUser(options?: AxiosRequestConfig) { - return UsersApiFp(this.configuration).usersGetUser(options).then((request) => request(this.axios, this.basePath)); + public getUser(options?: AxiosRequestConfig) { + return UsersApiFp(this.configuration).getUser(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/AzureADB2CAuth/auth-frontend/src/stores/serverTime/serverTime.ts b/samples/AzureADB2CAuth/auth-frontend/src/stores/serverTime/serverTime.ts index 267ace6ce..fbe6275bd 100644 --- a/samples/AzureADB2CAuth/auth-frontend/src/stores/serverTime/serverTime.ts +++ b/samples/AzureADB2CAuth/auth-frontend/src/stores/serverTime/serverTime.ts @@ -9,7 +9,7 @@ export const useServerTimeStore = defineStore({ actions: { async fetchServerTimeResponse() { const api = await getServerTimeApi(); - const response = await api.serverTimeGet(); + const response = await api.getServerTime(); this.serverTime = response.data.serverTime; }, }, diff --git a/samples/AzureADB2CAuth/auth-frontend/src/stores/user/user.ts b/samples/AzureADB2CAuth/auth-frontend/src/stores/user/user.ts index 5deb9825b..1339aa2c2 100644 --- a/samples/AzureADB2CAuth/auth-frontend/src/stores/user/user.ts +++ b/samples/AzureADB2CAuth/auth-frontend/src/stores/user/user.ts @@ -9,7 +9,7 @@ export const useUserStore = defineStore({ actions: { async fetchUserResponse() { const usersApi = await getUsersApi(); - const response = await usersApi.usersGetUser(); + const response = await usersApi.getUser(); this.userId = response.data.userId; }, }, diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/AssetsController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/AssetsController.cs index 76525bbf4..8792b4f74 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/AssetsController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/AssetsController.cs @@ -2,6 +2,7 @@ using Dressca.ApplicationCore.Assets; using Dressca.Web.Assets; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -44,6 +45,7 @@ public AssetsController( [HttpGet("{assetCode}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] + [OpenApiOperation("get")] public IActionResult Get(string assetCode) { try diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/BasketItemsController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/BasketItemsController.cs index e2736f0bf..4542b819b 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/BasketItemsController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/BasketItemsController.cs @@ -8,6 +8,7 @@ using Dressca.Web.Dto.Baskets; using Dressca.Web.Dto.Catalog; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -62,6 +63,7 @@ public BasketItemsController( /// 成功。 [HttpGet] [ProducesResponseType(typeof(BasketResponse), StatusCodes.Status200OK)] + [OpenApiOperation("getBasketItems")] public async Task GetBasketItemsAsync() { var buyerId = this.HttpContext.GetBuyerId(); @@ -95,6 +97,7 @@ public async Task GetBasketItemsAsync() [HttpPut] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status400BadRequest)] + [OpenApiOperation("putBasketItems")] public async Task PutBasketItemsAsync(IEnumerable putBasketItems) { if (!putBasketItems.Any()) @@ -143,6 +146,7 @@ public async Task PutBasketItemsAsync(IEnumerable PostBasketItemAsync(PostBasketItemsRequest postBasketItem) { postBasketItem.CatalogItemId.ThrowIfNull(); @@ -176,6 +180,7 @@ public async Task PostBasketItemAsync(PostBasketItemsRequest post [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] + [OpenApiOperation("deleteBasketItem")] public async Task DeleteBasketItemAsync([Range(1L, long.MaxValue)] long catalogItemId) { var buyerId = this.HttpContext.GetBuyerId(); diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogBrandsController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogBrandsController.cs index 70446aaed..f2e44198f 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogBrandsController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogBrandsController.cs @@ -3,6 +3,7 @@ using Dressca.SystemCommon.Mapper; using Dressca.Web.Dto.Catalog; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -43,6 +44,7 @@ public CatalogBrandsController( /// 成功。 [HttpGet] [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [OpenApiOperation("getCatalogBrands")] public async Task GetCatalogBrandsAsync() { var brands = await this.service.GetBrandsAsync(); diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogCategoriesController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogCategoriesController.cs index b56ea11bb..eda5bc150 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogCategoriesController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogCategoriesController.cs @@ -3,6 +3,7 @@ using Dressca.SystemCommon.Mapper; using Dressca.Web.Dto.Catalog; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -43,6 +44,7 @@ public CatalogCategoriesController( /// 成功。 [HttpGet] [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [OpenApiOperation("getCatalogCategories")] public async Task GetCatalogCategoriesAsync() { var categories = await this.service.GetCategoriesAsync(); diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogItemsController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogItemsController.cs index f6b0daed1..3ebb46428 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogItemsController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/CatalogItemsController.cs @@ -5,6 +5,7 @@ using Dressca.Web.Dto; using Dressca.Web.Dto.Catalog; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -48,6 +49,7 @@ public CatalogItemsController( [HttpGet] [ProducesResponseType(typeof(PagedList), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] + [OpenApiOperation("getByQuery")] public async Task GetByQueryAsync([FromQuery] FindCatalogItemsQuery query) { var (catalogItems, totalCount) = diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/OrdersController.cs b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/OrdersController.cs index 9eb7c0001..58568511e 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/OrdersController.cs +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/Controllers/OrdersController.cs @@ -4,6 +4,7 @@ using Dressca.Web.Baskets; using Dressca.Web.Dto.Ordering; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; namespace Dressca.Web.Controllers; @@ -57,6 +58,7 @@ public OrdersController( [HttpGet("{orderId:long}")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(OrderResponse))] [ProducesResponseType(StatusCodes.Status404NotFound)] + [OpenApiOperation("getById")] public async Task GetByIdAsync(long orderId) { var buyerId = this.HttpContext.GetBuyerId(); @@ -85,6 +87,7 @@ public async Task GetByIdAsync(long orderId) [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status500InternalServerError, Type = typeof(ProblemDetails))] + [OpenApiOperation("postOrder")] public async Task PostOrderAsync(PostOrderRequest postOrderInput) { var buyerId = this.HttpContext.GetBuyerId(); diff --git a/samples/Dressca/dressca-backend/src/Dressca.Web/dressca-api.json b/samples/Dressca/dressca-backend/src/Dressca.Web/dressca-api.json index 0641c8e6a..4e16537f7 100644 --- a/samples/Dressca/dressca-backend/src/Dressca.Web/dressca-api.json +++ b/samples/Dressca/dressca-backend/src/Dressca.Web/dressca-api.json @@ -19,7 +19,7 @@ "Assets" ], "summary": "アセットを取得します。", - "operationId": "Assets_Get", + "operationId": "get", "parameters": [ { "name": "assetCode", @@ -55,7 +55,7 @@ "BasketItems" ], "summary": "買い物かごアイテムの一覧を取得します。", - "operationId": "BasketItems_GetBasketItems", + "operationId": "getBasketItems", "responses": { "200": { "description": "成功。", @@ -75,7 +75,7 @@ ], "summary": "買い物かごアイテム内の数量を変更します。\n買い物かご内に存在しないカタログアイテム ID は指定できません。", "description": "この API では、買い物かご内に存在する商品の数量を変更できます。\n 買い物かご内に存在しないカタログアイテム Id を指定すると HTTP 400 を返却します。\n またシステムに登録されていないカタログアイテム Id を指定した場合も HTTP 400 を返却します。", - "operationId": "BasketItems_PutBasketItems", + "operationId": "putBasketItems", "requestBody": { "x-name": "putBasketItems", "description": "変更する買い物かごアイテムのデータリスト。", @@ -114,7 +114,7 @@ ], "summary": "買い物かごに商品を追加します。", "description": "この API では、システムに登録されていないカタログアイテム Id を指定した場合 HTTP 400 を返却します。\n また買い物かごに追加していないカタログアイテムを指定した場合、その商品を買い物かごに追加します。\n すでに買い物かごに追加されているカタログアイテムを指定した場合、指定した数量、買い物かご内の数量を追加します。\n\n\n 買い物かご内のカタログアイテムの数量が 0 未満になるように減じることはできません。\n 計算の結果数量が 0 未満になる場合 HTTP 500 を返却します。", - "operationId": "BasketItems_PostBasketItem", + "operationId": "postBasketItem", "requestBody": { "x-name": "postBasketItem", "description": "追加する商品の情報。", @@ -162,7 +162,7 @@ ], "summary": "買い物かごから指定したカタログアイテム Id の商品を削除します。", "description": "catalogItemId には買い物かご内に存在するカタログアイテム Id を指定してください。\n カタログアイテム Id は 1 以上の整数です。\n 0 以下の値を指定したり、整数値ではない値を指定した場合 HTTP 400 を返却します。\n 買い物かご内に指定したカタログアイテムの商品が存在しない場合、 HTTP 404 を返却します。", - "operationId": "BasketItems_DeleteBasketItem", + "operationId": "deleteBasketItem", "parameters": [ { "name": "catalogItemId", @@ -211,7 +211,7 @@ "CatalogBrands" ], "summary": "カタログブランドの一覧を取得します。", - "operationId": "CatalogBrands_GetCatalogBrands", + "operationId": "getCatalogBrands", "responses": { "200": { "description": "成功。", @@ -235,7 +235,7 @@ "CatalogCategories" ], "summary": "カタログカテゴリの一覧を取得します。", - "operationId": "CatalogCategories_GetCatalogCategories", + "operationId": "getCatalogCategories", "responses": { "200": { "description": "成功。", @@ -259,7 +259,7 @@ "CatalogItems" ], "summary": "カタログアイテムを検索して返します。", - "operationId": "CatalogItems_GetByQuery", + "operationId": "getByQuery", "parameters": [ { "name": "brandId", @@ -338,7 +338,7 @@ "Orders" ], "summary": "注文情報を取得します。", - "operationId": "Orders_GetById", + "operationId": "getById", "parameters": [ { "name": "orderId", @@ -382,7 +382,7 @@ "Orders" ], "summary": "買い物かごに登録されている商品を注文します。", - "operationId": "Orders_PostOrder", + "operationId": "postOrder", "requestBody": { "x-name": "postOrderInput", "description": "注文に必要な配送先などの情報。", diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/assets-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/assets-api.ts index 8dca0ebf2..5aab43644 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/assets-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/assets-api.ts @@ -35,9 +35,9 @@ export const AssetsApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - assetsGet: async (assetCode: string, options: AxiosRequestConfig = {}): Promise => { + get: async (assetCode: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'assetCode' is not null or undefined - assertParamExists('assetsGet', 'assetCode', assetCode) + assertParamExists('get', 'assetCode', assetCode) const localVarPath = `/api/assets/{assetCode}` .replace(`{${"assetCode"}}`, encodeURIComponent(String(assetCode))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -79,8 +79,8 @@ export const AssetsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async assetsGet(assetCode: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.assetsGet(assetCode, options); + async get(assetCode: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.get(assetCode, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -100,8 +100,8 @@ export const AssetsApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - assetsGet(assetCode: string, options?: any): AxiosPromise { - return localVarFp.assetsGet(assetCode, options).then((request) => request(axios, basePath)); + get(assetCode: string, options?: any): AxiosPromise { + return localVarFp.get(assetCode, options).then((request) => request(axios, basePath)); }, }; }; @@ -121,7 +121,7 @@ export class AssetsApi extends BaseAPI { * @throws {RequiredError} * @memberof AssetsApi */ - public assetsGet(assetCode: string, options?: AxiosRequestConfig) { - return AssetsApiFp(this.configuration).assetsGet(assetCode, options).then((request) => request(this.axios, this.basePath)); + public get(assetCode: string, options?: AxiosRequestConfig) { + return AssetsApiFp(this.configuration).get(assetCode, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/basket-items-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/basket-items-api.ts index 2e38e087d..760d69259 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/basket-items-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/basket-items-api.ts @@ -41,9 +41,9 @@ export const BasketItemsApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsDeleteBasketItem: async (catalogItemId: number, options: AxiosRequestConfig = {}): Promise => { + deleteBasketItem: async (catalogItemId: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'catalogItemId' is not null or undefined - assertParamExists('basketItemsDeleteBasketItem', 'catalogItemId', catalogItemId) + assertParamExists('deleteBasketItem', 'catalogItemId', catalogItemId) const localVarPath = `/api/basket-items/{catalogItemId}` .replace(`{${"catalogItemId"}}`, encodeURIComponent(String(catalogItemId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -74,7 +74,7 @@ export const BasketItemsApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsGetBasketItems: async (options: AxiosRequestConfig = {}): Promise => { + getBasketItems: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/basket-items`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -105,9 +105,9 @@ export const BasketItemsApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsPostBasketItem: async (postBasketItemsRequest: PostBasketItemsRequest, options: AxiosRequestConfig = {}): Promise => { + postBasketItem: async (postBasketItemsRequest: PostBasketItemsRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'postBasketItemsRequest' is not null or undefined - assertParamExists('basketItemsPostBasketItem', 'postBasketItemsRequest', postBasketItemsRequest) + assertParamExists('postBasketItem', 'postBasketItemsRequest', postBasketItemsRequest) const localVarPath = `/api/basket-items`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -141,9 +141,9 @@ export const BasketItemsApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsPutBasketItems: async (putBasketItemsRequest: Array, options: AxiosRequestConfig = {}): Promise => { + putBasketItems: async (putBasketItemsRequest: Array, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'putBasketItemsRequest' is not null or undefined - assertParamExists('basketItemsPutBasketItems', 'putBasketItemsRequest', putBasketItemsRequest) + assertParamExists('putBasketItems', 'putBasketItemsRequest', putBasketItemsRequest) const localVarPath = `/api/basket-items`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -187,8 +187,8 @@ export const BasketItemsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async basketItemsDeleteBasketItem(catalogItemId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basketItemsDeleteBasketItem(catalogItemId, options); + async deleteBasketItem(catalogItemId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBasketItem(catalogItemId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -197,8 +197,8 @@ export const BasketItemsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async basketItemsGetBasketItems(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basketItemsGetBasketItems(options); + async getBasketItems(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getBasketItems(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -208,8 +208,8 @@ export const BasketItemsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async basketItemsPostBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basketItemsPostBasketItem(postBasketItemsRequest, options); + async postBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postBasketItem(postBasketItemsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -219,8 +219,8 @@ export const BasketItemsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async basketItemsPutBasketItems(putBasketItemsRequest: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.basketItemsPutBasketItems(putBasketItemsRequest, options); + async putBasketItems(putBasketItemsRequest: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.putBasketItems(putBasketItemsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -240,8 +240,8 @@ export const BasketItemsApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsDeleteBasketItem(catalogItemId: number, options?: any): AxiosPromise { - return localVarFp.basketItemsDeleteBasketItem(catalogItemId, options).then((request) => request(axios, basePath)); + deleteBasketItem(catalogItemId: number, options?: any): AxiosPromise { + return localVarFp.deleteBasketItem(catalogItemId, options).then((request) => request(axios, basePath)); }, /** * @@ -249,8 +249,8 @@ export const BasketItemsApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsGetBasketItems(options?: any): AxiosPromise { - return localVarFp.basketItemsGetBasketItems(options).then((request) => request(axios, basePath)); + getBasketItems(options?: any): AxiosPromise { + return localVarFp.getBasketItems(options).then((request) => request(axios, basePath)); }, /** * この API では、システムに登録されていないカタログアイテム Id を指定した場合 HTTP 400 を返却します。 また買い物かごに追加していないカタログアイテムを指定した場合、その商品を買い物かごに追加します。 すでに買い物かごに追加されているカタログアイテムを指定した場合、指定した数量、買い物かご内の数量を追加します。 買い物かご内のカタログアイテムの数量が 0 未満になるように減じることはできません。 計算の結果数量が 0 未満になる場合 HTTP 500 を返却します。 @@ -259,8 +259,8 @@ export const BasketItemsApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsPostBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: any): AxiosPromise { - return localVarFp.basketItemsPostBasketItem(postBasketItemsRequest, options).then((request) => request(axios, basePath)); + postBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: any): AxiosPromise { + return localVarFp.postBasketItem(postBasketItemsRequest, options).then((request) => request(axios, basePath)); }, /** * この API では、買い物かご内に存在する商品の数量を変更できます。 買い物かご内に存在しないカタログアイテム Id を指定すると HTTP 400 を返却します。 またシステムに登録されていないカタログアイテム Id を指定した場合も HTTP 400 を返却します。 @@ -269,8 +269,8 @@ export const BasketItemsApiFactory = function (configuration?: Configuration, ba * @param {*} [options] Override http request option. * @throws {RequiredError} */ - basketItemsPutBasketItems(putBasketItemsRequest: Array, options?: any): AxiosPromise { - return localVarFp.basketItemsPutBasketItems(putBasketItemsRequest, options).then((request) => request(axios, basePath)); + putBasketItems(putBasketItemsRequest: Array, options?: any): AxiosPromise { + return localVarFp.putBasketItems(putBasketItemsRequest, options).then((request) => request(axios, basePath)); }, }; }; @@ -290,8 +290,8 @@ export class BasketItemsApi extends BaseAPI { * @throws {RequiredError} * @memberof BasketItemsApi */ - public basketItemsDeleteBasketItem(catalogItemId: number, options?: AxiosRequestConfig) { - return BasketItemsApiFp(this.configuration).basketItemsDeleteBasketItem(catalogItemId, options).then((request) => request(this.axios, this.basePath)); + public deleteBasketItem(catalogItemId: number, options?: AxiosRequestConfig) { + return BasketItemsApiFp(this.configuration).deleteBasketItem(catalogItemId, options).then((request) => request(this.axios, this.basePath)); } /** @@ -301,8 +301,8 @@ export class BasketItemsApi extends BaseAPI { * @throws {RequiredError} * @memberof BasketItemsApi */ - public basketItemsGetBasketItems(options?: AxiosRequestConfig) { - return BasketItemsApiFp(this.configuration).basketItemsGetBasketItems(options).then((request) => request(this.axios, this.basePath)); + public getBasketItems(options?: AxiosRequestConfig) { + return BasketItemsApiFp(this.configuration).getBasketItems(options).then((request) => request(this.axios, this.basePath)); } /** @@ -313,8 +313,8 @@ export class BasketItemsApi extends BaseAPI { * @throws {RequiredError} * @memberof BasketItemsApi */ - public basketItemsPostBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: AxiosRequestConfig) { - return BasketItemsApiFp(this.configuration).basketItemsPostBasketItem(postBasketItemsRequest, options).then((request) => request(this.axios, this.basePath)); + public postBasketItem(postBasketItemsRequest: PostBasketItemsRequest, options?: AxiosRequestConfig) { + return BasketItemsApiFp(this.configuration).postBasketItem(postBasketItemsRequest, options).then((request) => request(this.axios, this.basePath)); } /** @@ -325,7 +325,7 @@ export class BasketItemsApi extends BaseAPI { * @throws {RequiredError} * @memberof BasketItemsApi */ - public basketItemsPutBasketItems(putBasketItemsRequest: Array, options?: AxiosRequestConfig) { - return BasketItemsApiFp(this.configuration).basketItemsPutBasketItems(putBasketItemsRequest, options).then((request) => request(this.axios, this.basePath)); + public putBasketItems(putBasketItemsRequest: Array, options?: AxiosRequestConfig) { + return BasketItemsApiFp(this.configuration).putBasketItems(putBasketItemsRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-brands-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-brands-api.ts index eddb8d8d4..2aa57ae00 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-brands-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-brands-api.ts @@ -34,7 +34,7 @@ export const CatalogBrandsApiAxiosParamCreator = function (configuration?: Confi * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogBrandsGetCatalogBrands: async (options: AxiosRequestConfig = {}): Promise => { + getCatalogBrands: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/catalog-brands`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -74,8 +74,8 @@ export const CatalogBrandsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async catalogBrandsGetCatalogBrands(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.catalogBrandsGetCatalogBrands(options); + async getCatalogBrands(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogBrands(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -94,8 +94,8 @@ export const CatalogBrandsApiFactory = function (configuration?: Configuration, * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogBrandsGetCatalogBrands(options?: any): AxiosPromise> { - return localVarFp.catalogBrandsGetCatalogBrands(options).then((request) => request(axios, basePath)); + getCatalogBrands(options?: any): AxiosPromise> { + return localVarFp.getCatalogBrands(options).then((request) => request(axios, basePath)); }, }; }; @@ -114,7 +114,7 @@ export class CatalogBrandsApi extends BaseAPI { * @throws {RequiredError} * @memberof CatalogBrandsApi */ - public catalogBrandsGetCatalogBrands(options?: AxiosRequestConfig) { - return CatalogBrandsApiFp(this.configuration).catalogBrandsGetCatalogBrands(options).then((request) => request(this.axios, this.basePath)); + public getCatalogBrands(options?: AxiosRequestConfig) { + return CatalogBrandsApiFp(this.configuration).getCatalogBrands(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-categories-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-categories-api.ts index 4f34a86bf..aab301e28 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-categories-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-categories-api.ts @@ -34,7 +34,7 @@ export const CatalogCategoriesApiAxiosParamCreator = function (configuration?: C * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogCategoriesGetCatalogCategories: async (options: AxiosRequestConfig = {}): Promise => { + getCatalogCategories: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/catalog-categories`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -74,8 +74,8 @@ export const CatalogCategoriesApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async catalogCategoriesGetCatalogCategories(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.catalogCategoriesGetCatalogCategories(options); + async getCatalogCategories(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogCategories(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -94,8 +94,8 @@ export const CatalogCategoriesApiFactory = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogCategoriesGetCatalogCategories(options?: any): AxiosPromise> { - return localVarFp.catalogCategoriesGetCatalogCategories(options).then((request) => request(axios, basePath)); + getCatalogCategories(options?: any): AxiosPromise> { + return localVarFp.getCatalogCategories(options).then((request) => request(axios, basePath)); }, }; }; @@ -114,7 +114,7 @@ export class CatalogCategoriesApi extends BaseAPI { * @throws {RequiredError} * @memberof CatalogCategoriesApi */ - public catalogCategoriesGetCatalogCategories(options?: AxiosRequestConfig) { - return CatalogCategoriesApiFp(this.configuration).catalogCategoriesGetCatalogCategories(options).then((request) => request(this.axios, this.basePath)); + public getCatalogCategories(options?: AxiosRequestConfig) { + return CatalogCategoriesApiFp(this.configuration).getCatalogCategories(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-items-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-items-api.ts index 2577b2432..5a0c34dea 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-items-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/catalog-items-api.ts @@ -40,7 +40,7 @@ export const CatalogItemsApiAxiosParamCreator = function (configuration?: Config * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogItemsGetByQuery: async (brandId?: number, categoryId?: number, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { + getByQuery: async (brandId?: number, categoryId?: number, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/catalog-items`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -100,8 +100,8 @@ export const CatalogItemsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async catalogItemsGetByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.catalogItemsGetByQuery(brandId, categoryId, page, pageSize, options); + async getByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getByQuery(brandId, categoryId, page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -124,8 +124,8 @@ export const CatalogItemsApiFactory = function (configuration?: Configuration, b * @param {*} [options] Override http request option. * @throws {RequiredError} */ - catalogItemsGetByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: any): AxiosPromise { - return localVarFp.catalogItemsGetByQuery(brandId, categoryId, page, pageSize, options).then((request) => request(axios, basePath)); + getByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.getByQuery(brandId, categoryId, page, pageSize, options).then((request) => request(axios, basePath)); }, }; }; @@ -148,7 +148,7 @@ export class CatalogItemsApi extends BaseAPI { * @throws {RequiredError} * @memberof CatalogItemsApi */ - public catalogItemsGetByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: AxiosRequestConfig) { - return CatalogItemsApiFp(this.configuration).catalogItemsGetByQuery(brandId, categoryId, page, pageSize, options).then((request) => request(this.axios, this.basePath)); + public getByQuery(brandId?: number, categoryId?: number, page?: number, pageSize?: number, options?: AxiosRequestConfig) { + return CatalogItemsApiFp(this.configuration).getByQuery(brandId, categoryId, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/generated/api-client/api/orders-api.ts b/samples/Dressca/dressca-frontend/src/generated/api-client/api/orders-api.ts index fe786071e..d043df833 100644 --- a/samples/Dressca/dressca-frontend/src/generated/api-client/api/orders-api.ts +++ b/samples/Dressca/dressca-frontend/src/generated/api-client/api/orders-api.ts @@ -39,9 +39,9 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - ordersGetById: async (orderId: number, options: AxiosRequestConfig = {}): Promise => { + getById: async (orderId: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - assertParamExists('ordersGetById', 'orderId', orderId) + assertParamExists('getById', 'orderId', orderId) const localVarPath = `/api/orders/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. @@ -73,9 +73,9 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - ordersPostOrder: async (postOrderRequest: PostOrderRequest, options: AxiosRequestConfig = {}): Promise => { + postOrder: async (postOrderRequest: PostOrderRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'postOrderRequest' is not null or undefined - assertParamExists('ordersPostOrder', 'postOrderRequest', postOrderRequest) + assertParamExists('postOrder', 'postOrderRequest', postOrderRequest) const localVarPath = `/api/orders`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -119,8 +119,8 @@ export const OrdersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async ordersGetById(orderId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.ordersGetById(orderId, options); + async getById(orderId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getById(orderId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -130,8 +130,8 @@ export const OrdersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async ordersPostOrder(postOrderRequest: PostOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.ordersPostOrder(postOrderRequest, options); + async postOrder(postOrderRequest: PostOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postOrder(postOrderRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -151,8 +151,8 @@ export const OrdersApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - ordersGetById(orderId: number, options?: any): AxiosPromise { - return localVarFp.ordersGetById(orderId, options).then((request) => request(axios, basePath)); + getById(orderId: number, options?: any): AxiosPromise { + return localVarFp.getById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -161,8 +161,8 @@ export const OrdersApiFactory = function (configuration?: Configuration, basePat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - ordersPostOrder(postOrderRequest: PostOrderRequest, options?: any): AxiosPromise { - return localVarFp.ordersPostOrder(postOrderRequest, options).then((request) => request(axios, basePath)); + postOrder(postOrderRequest: PostOrderRequest, options?: any): AxiosPromise { + return localVarFp.postOrder(postOrderRequest, options).then((request) => request(axios, basePath)); }, }; }; @@ -182,8 +182,8 @@ export class OrdersApi extends BaseAPI { * @throws {RequiredError} * @memberof OrdersApi */ - public ordersGetById(orderId: number, options?: AxiosRequestConfig) { - return OrdersApiFp(this.configuration).ordersGetById(orderId, options).then((request) => request(this.axios, this.basePath)); + public getById(orderId: number, options?: AxiosRequestConfig) { + return OrdersApiFp(this.configuration).getById(orderId, options).then((request) => request(this.axios, this.basePath)); } /** @@ -194,7 +194,7 @@ export class OrdersApi extends BaseAPI { * @throws {RequiredError} * @memberof OrdersApi */ - public ordersPostOrder(postOrderRequest: PostOrderRequest, options?: AxiosRequestConfig) { - return OrdersApiFp(this.configuration).ordersPostOrder(postOrderRequest, options).then((request) => request(this.axios, this.basePath)); + public postOrder(postOrderRequest: PostOrderRequest, options?: AxiosRequestConfig) { + return OrdersApiFp(this.configuration).postOrder(postOrderRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/samples/Dressca/dressca-frontend/src/stores/basket/basket.ts b/samples/Dressca/dressca-frontend/src/stores/basket/basket.ts index 88afbff09..0c6ee0004 100644 --- a/samples/Dressca/dressca-frontend/src/stores/basket/basket.ts +++ b/samples/Dressca/dressca-frontend/src/stores/basket/basket.ts @@ -18,7 +18,7 @@ export const useBasketStore = defineStore({ catalogItemId: catalogItemId, addedQuantity: 1, }; - await basketItemsApi.basketItemsPostBasketItem(params); + await basketItemsApi.postBasketItem(params); this.addedItemId = catalogItemId; }, async update(catalogItemId: number, newQuantity: number) { @@ -28,13 +28,13 @@ export const useBasketStore = defineStore({ quantity: newQuantity, }, ]; - await basketItemsApi.basketItemsPutBasketItems(params); + await basketItemsApi.putBasketItems(params); }, async remove(catalogItemId: number) { - await basketItemsApi.basketItemsDeleteBasketItem(catalogItemId); + await basketItemsApi.deleteBasketItem(catalogItemId); }, async fetch() { - const response = await basketItemsApi.basketItemsGetBasketItems(); + const response = await basketItemsApi.getBasketItems(); this.basket = response.data; }, async deleteAddedItemId() { diff --git a/samples/Dressca/dressca-frontend/src/stores/catalog/catalog.ts b/samples/Dressca/dressca-frontend/src/stores/catalog/catalog.ts index 2fba54dad..311dbe4f1 100644 --- a/samples/Dressca/dressca-frontend/src/stores/catalog/catalog.ts +++ b/samples/Dressca/dressca-frontend/src/stores/catalog/catalog.ts @@ -19,18 +19,17 @@ export const useCatalogStore = defineStore({ }), actions: { async fetchCategories() { - const response = - await catalogCategoriesApi.catalogCategoriesGetCatalogCategories(); + const response = await catalogCategoriesApi.getCatalogCategories(); this.categories = response.data; this.categories.unshift({ id: 0, name: 'すべて' }); }, async fetchBrands() { - const response = await catalogBrandsApi.catalogBrandsGetCatalogBrands(); + const response = await catalogBrandsApi.getCatalogBrands(); this.brands = response.data; this.brands.unshift({ id: 0, name: 'すべて' }); }, async fetchItems(categoryId: number, brandId: number, page?: number) { - const response = await catalogItemsApi.catalogItemsGetByQuery( + const response = await catalogItemsApi.getByQuery( brandId === 0 ? undefined : brandId, categoryId === 0 ? undefined : categoryId, page, diff --git a/samples/Dressca/dressca-frontend/src/stores/ordering/ordering.ts b/samples/Dressca/dressca-frontend/src/stores/ordering/ordering.ts index c50e4651d..15d038e7f 100644 --- a/samples/Dressca/dressca-frontend/src/stores/ordering/ordering.ts +++ b/samples/Dressca/dressca-frontend/src/stores/ordering/ordering.ts @@ -22,10 +22,10 @@ export const useOrderingStore = defineStore({ shikuchoson: shikuchoson, azanaAndOthers: azanaAndOthers, }; - const orderResponse = await ordersApi.ordersPostOrder(postOrderInput); + const orderResponse = await ordersApi.postOrder(postOrderInput); const url = new URL(orderResponse.headers.location); const orderId = Number(url.pathname.split('/').pop()); - const orderResultResponse = await ordersApi.ordersGetById(orderId); + const orderResultResponse = await ordersApi.getById(orderId); this.lastOrder = orderResultResponse.data; }, clearLastOrder() {