Skip to content

Commit

Permalink
feat: update api-client
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Nov 1, 2024
1 parent 446ea75 commit 9a064ff
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 29 deletions.
24 changes: 22 additions & 2 deletions app/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/ImageInsertRequest"
"$ref" : "#/components/schemas/ImagePatchRequest"
}
}
},
Expand Down Expand Up @@ -394,6 +394,26 @@
"schema" : {
"type" : "string"
}
}, {
"name" : "private",
"in" : "query",
"description" : "isPrivate",
"required" : false,
"deprecated" : false,
"explode" : false,
"schema" : {
"type" : "boolean"
}
}, {
"name" : "search",
"in" : "query",
"description" : "search content",
"required" : false,
"deprecated" : false,
"explode" : false,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
Expand Down Expand Up @@ -2484,7 +2504,7 @@
},
"required" : [ "code", "isSuccessful", "message" ]
},
"ImageInsertRequest" : {
"ImagePatchRequest" : {
"type" : "object",
"properties" : {
"albumId" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data class ImageRawFile(
}

@Serializable
@Name("ImageInsertRequest")
@Name("ImagePatchRequest")
data class ImagePatchRequest(
val albumId: Long? = null,
val displayName: String? = null,
Expand Down
64 changes: 45 additions & 19 deletions ui/packages/api-client/src/apis/image-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import type { CommonResponseKotlinUnit } from '../models';
// @ts-ignore
import type { CommonResponsePageResultImagePageVO } from '../models';
// @ts-ignore
import type { ImageInsertRequest } from '../models';
// @ts-ignore
import type { ImageManagePatchRequest } from '../models';
// @ts-ignore
import type { ImagePatchRequest } from '../models';
/**
* ImageApi - axios parameter creator
* @export
Expand Down Expand Up @@ -155,15 +155,15 @@ export const ImageApiAxiosParamCreator = function (configuration?: Configuration
/**
*
* @param {number} imageId image id
* @param {ImageInsertRequest} imageInsertRequest
* @param {ImagePatchRequest} imagePatchRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiImageImageIdPatch: async (imageId: number, imageInsertRequest: ImageInsertRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
apiImageImageIdPatch: async (imageId: number, imagePatchRequest: ImagePatchRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'imageId' is not null or undefined
assertParamExists('apiImageImageIdPatch', 'imageId', imageId)
// verify required parameter 'imageInsertRequest' is not null or undefined
assertParamExists('apiImageImageIdPatch', 'imageInsertRequest', imageInsertRequest)
// verify required parameter 'imagePatchRequest' is not null or undefined
assertParamExists('apiImageImageIdPatch', 'imagePatchRequest', imagePatchRequest)
const localVarPath = `/api/image/{imageId}`
.replace(`{${"imageId"}}`, encodeURIComponent(String(imageId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
Expand All @@ -188,7 +188,7 @@ export const ImageApiAxiosParamCreator = function (configuration?: Configuration
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(imageInsertRequest, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(imagePatchRequest, localVarRequestOptions, configuration)

return {
url: toPathString(localVarUrlObj),
Expand Down Expand Up @@ -486,10 +486,12 @@ export const ImageApiAxiosParamCreator = function (configuration?: Configuration
* @param {number} pageSize pageSize
* @param {string} [order] order
* @param {string} [orderBy] orderBy
* @param {boolean} [_private] isPrivate
* @param {string} [search] search content
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiImagePageGet: async (page: number, pageSize: number, order?: string, orderBy?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
apiImagePageGet: async (page: number, pageSize: number, order?: string, orderBy?: string, _private?: boolean, search?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'page' is not null or undefined
assertParamExists('apiImagePageGet', 'page', page)
// verify required parameter 'pageSize' is not null or undefined
Expand Down Expand Up @@ -526,6 +528,14 @@ export const ImageApiAxiosParamCreator = function (configuration?: Configuration
localVarQueryParameter['orderBy'] = orderBy;
}

if (_private !== undefined) {
localVarQueryParameter['private'] = _private;
}

if (search !== undefined) {
localVarQueryParameter['search'] = search;
}



setSearchParams(localVarUrlObj, localVarQueryParameter);
Expand Down Expand Up @@ -619,12 +629,12 @@ export const ImageApiFp = function(configuration?: Configuration) {
/**
*
* @param {number} imageId image id
* @param {ImageInsertRequest} imageInsertRequest
* @param {ImagePatchRequest} imagePatchRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiImageImageIdPatch(imageId: number, imageInsertRequest: ImageInsertRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonResponseKotlinUnit>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiImageImageIdPatch(imageId, imageInsertRequest, options);
async apiImageImageIdPatch(imageId: number, imagePatchRequest: ImagePatchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonResponseKotlinUnit>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiImageImageIdPatch(imageId, imagePatchRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ImageApi.apiImageImageIdPatch']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
Expand Down Expand Up @@ -723,11 +733,13 @@ export const ImageApiFp = function(configuration?: Configuration) {
* @param {number} pageSize pageSize
* @param {string} [order] order
* @param {string} [orderBy] orderBy
* @param {boolean} [_private] isPrivate
* @param {string} [search] search content
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiImagePageGet(page: number, pageSize: number, order?: string, orderBy?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonResponsePageResultImagePageVO>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiImagePageGet(page, pageSize, order, orderBy, options);
async apiImagePageGet(page: number, pageSize: number, order?: string, orderBy?: string, _private?: boolean, search?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonResponsePageResultImagePageVO>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiImagePageGet(page, pageSize, order, orderBy, _private, search, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ImageApi.apiImagePageGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
Expand Down Expand Up @@ -787,7 +799,7 @@ export const ImageApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError}
*/
apiImageImageIdPatch(requestParameters: ImageApiApiImageImageIdPatchRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonResponseKotlinUnit> {
return localVarFp.apiImageImageIdPatch(requestParameters.imageId, requestParameters.imageInsertRequest, options).then((request) => request(axios, basePath));
return localVarFp.apiImageImageIdPatch(requestParameters.imageId, requestParameters.imagePatchRequest, options).then((request) => request(axios, basePath));
},
/**
*
Expand Down Expand Up @@ -859,7 +871,7 @@ export const ImageApiFactory = function (configuration?: Configuration, basePath
* @throws {RequiredError}
*/
apiImagePageGet(requestParameters: ImageApiApiImagePageGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonResponsePageResultImagePageVO> {
return localVarFp.apiImagePageGet(requestParameters.page, requestParameters.pageSize, requestParameters.order, requestParameters.orderBy, options).then((request) => request(axios, basePath));
return localVarFp.apiImagePageGet(requestParameters.page, requestParameters.pageSize, requestParameters.order, requestParameters.orderBy, requestParameters._private, requestParameters.search, options).then((request) => request(axios, basePath));
},
/**
*
Expand Down Expand Up @@ -929,10 +941,10 @@ export interface ImageApiApiImageImageIdPatchRequest {

/**
*
* @type {ImageInsertRequest}
* @type {ImagePatchRequest}
* @memberof ImageApiApiImageImageIdPatch
*/
readonly imageInsertRequest: ImageInsertRequest
readonly imagePatchRequest: ImagePatchRequest
}

/**
Expand Down Expand Up @@ -1094,6 +1106,20 @@ export interface ImageApiApiImagePageGetRequest {
* @memberof ImageApiApiImagePageGet
*/
readonly orderBy?: string

/**
* isPrivate
* @type {boolean}
* @memberof ImageApiApiImagePageGet
*/
readonly _private?: boolean

/**
* search content
* @type {string}
* @memberof ImageApiApiImagePageGet
*/
readonly search?: string
}

/**
Expand Down Expand Up @@ -1144,7 +1170,7 @@ export class ImageApi extends BaseAPI {
* @memberof ImageApi
*/
public apiImageImageIdPatch(requestParameters: ImageApiApiImageImageIdPatchRequest, options?: RawAxiosRequestConfig) {
return ImageApiFp(this.configuration).apiImageImageIdPatch(requestParameters.imageId, requestParameters.imageInsertRequest, options).then((request) => request(this.axios, this.basePath));
return ImageApiFp(this.configuration).apiImageImageIdPatch(requestParameters.imageId, requestParameters.imagePatchRequest, options).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down Expand Up @@ -1232,7 +1258,7 @@ export class ImageApi extends BaseAPI {
* @memberof ImageApi
*/
public apiImagePageGet(requestParameters: ImageApiApiImagePageGetRequest, options?: RawAxiosRequestConfig) {
return ImageApiFp(this.configuration).apiImagePageGet(requestParameters.page, requestParameters.pageSize, requestParameters.order, requestParameters.orderBy, options).then((request) => request(this.axios, this.basePath));
return ImageApiFp(this.configuration).apiImagePageGet(requestParameters.page, requestParameters.pageSize, requestParameters.order, requestParameters.orderBy, requestParameters._private, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
/**
*
* @export
* @interface ImageInsertRequest
* @interface ImagePatchRequest
*/
export interface ImageInsertRequest {
export interface ImagePatchRequest {
/**
*
* @type {number}
* @memberof ImageInsertRequest
* @memberof ImagePatchRequest
*/
'albumId'?: number | null;
/**
*
* @type {string}
* @memberof ImageInsertRequest
* @memberof ImagePatchRequest
*/
'description'?: string | null;
/**
*
* @type {string}
* @memberof ImageInsertRequest
* @memberof ImagePatchRequest
*/
'displayName'?: string | null;
/**
*
* @type {boolean}
* @memberof ImageInsertRequest
* @memberof ImagePatchRequest
*/
'isPrivate'?: boolean | null;
}
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/api-client/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export * from './group-page-vo';
export * from './group-patch-request';
export * from './group-strategy-config';
export * from './group-vo';
export * from './image-insert-request';
export * from './image-manage-patch-request';
export * from './image-manage-vo';
export * from './image-page-vo';
export * from './image-patch-request';
export * from './image-type-enum';
export * from './image-vo';
export * from './java-time-day-of-week';
Expand Down

0 comments on commit 9a064ff

Please sign in to comment.