|
|
@@ -23,6 +23,7 @@ import { AdminResultSqlSugarPagedListSysFile } from '../models';
|
|
|
import { DeleteFileInput } from '../models';
|
|
|
import { FileInput } from '../models';
|
|
|
import { PageFileInput } from '../models';
|
|
|
+import { UploadFileFromBase64Input } from '../models';
|
|
|
/**
|
|
|
* SysFileApi - axios parameter creator
|
|
|
* @export
|
|
|
@@ -225,6 +226,54 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
options: localVarRequestOptions,
|
|
|
};
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @summary 上传文件Base64
|
|
|
+ * @param {UploadFileFromBase64Input} [body]
|
|
|
+ * @param {*} [options] Override http request option.
|
|
|
+ * @throws {RequiredError}
|
|
|
+ */
|
|
|
+ apiSysFileUploadFileFromBase64Post: async (body?: UploadFileFromBase64Input, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
|
+ const localVarPath = `/api/sysFile/uploadFileFromBase64`;
|
|
|
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
|
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
|
+ let baseOptions;
|
|
|
+ if (configuration) {
|
|
|
+ baseOptions = configuration.baseOptions;
|
|
|
+ }
|
|
|
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
|
+ const localVarHeaderParameter = {} as any;
|
|
|
+ const localVarQueryParameter = {} as any;
|
|
|
+
|
|
|
+ // authentication Bearer required
|
|
|
+ // http bearer authentication required
|
|
|
+ if (configuration && configuration.accessToken) {
|
|
|
+ const accessToken = typeof configuration.accessToken === 'function'
|
|
|
+ ? await configuration.accessToken()
|
|
|
+ : await configuration.accessToken;
|
|
|
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
|
+ }
|
|
|
+
|
|
|
+ localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
|
|
+
|
|
|
+ const query = new URLSearchParams(localVarUrlObj.search);
|
|
|
+ for (const key in localVarQueryParameter) {
|
|
|
+ query.set(key, localVarQueryParameter[key]);
|
|
|
+ }
|
|
|
+ for (const key in options.params) {
|
|
|
+ query.set(key, options.params[key]);
|
|
|
+ }
|
|
|
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
|
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
|
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
|
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
|
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
|
+
|
|
|
+ return {
|
|
|
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
|
+ options: localVarRequestOptions,
|
|
|
+ };
|
|
|
+ },
|
|
|
/**
|
|
|
*
|
|
|
* @summary 上传文件
|
|
|
@@ -452,6 +501,20 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|
|
return axios.request(axiosRequestArgs);
|
|
|
};
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @summary 上传文件Base64
|
|
|
+ * @param {UploadFileFromBase64Input} [body]
|
|
|
+ * @param {*} [options] Override http request option.
|
|
|
+ * @throws {RequiredError}
|
|
|
+ */
|
|
|
+ async apiSysFileUploadFileFromBase64Post(body?: UploadFileFromBase64Input, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultFileOutput>>> {
|
|
|
+ const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFileFromBase64Post(body, options);
|
|
|
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
|
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
|
+ return axios.request(axiosRequestArgs);
|
|
|
+ };
|
|
|
+ },
|
|
|
/**
|
|
|
*
|
|
|
* @summary 上传文件
|
|
|
@@ -544,6 +607,16 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|
|
async apiSysFileUploadAvatarPostForm(file?: Blob, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultFileOutput>> {
|
|
|
return SysFileApiFp(configuration).apiSysFileUploadAvatarPostForm(file, options).then((request) => request(axios, basePath));
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @summary 上传文件Base64
|
|
|
+ * @param {UploadFileFromBase64Input} [body]
|
|
|
+ * @param {*} [options] Override http request option.
|
|
|
+ * @throws {RequiredError}
|
|
|
+ */
|
|
|
+ async apiSysFileUploadFileFromBase64Post(body?: UploadFileFromBase64Input, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultFileOutput>> {
|
|
|
+ return SysFileApiFp(configuration).apiSysFileUploadFileFromBase64Post(body, options).then((request) => request(axios, basePath));
|
|
|
+ },
|
|
|
/**
|
|
|
*
|
|
|
* @summary 上传文件
|
|
|
@@ -629,6 +702,17 @@ export class SysFileApi extends BaseAPI {
|
|
|
public async apiSysFileUploadAvatarPostForm(file?: Blob, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultFileOutput>> {
|
|
|
return SysFileApiFp(this.configuration).apiSysFileUploadAvatarPostForm(file, options).then((request) => request(this.axios, this.basePath));
|
|
|
}
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @summary 上传文件Base64
|
|
|
+ * @param {UploadFileFromBase64Input} [body]
|
|
|
+ * @param {*} [options] Override http request option.
|
|
|
+ * @throws {RequiredError}
|
|
|
+ * @memberof SysFileApi
|
|
|
+ */
|
|
|
+ public async apiSysFileUploadFileFromBase64Post(body?: UploadFileFromBase64Input, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultFileOutput>> {
|
|
|
+ return SysFileApiFp(this.configuration).apiSysFileUploadFileFromBase64Post(body, options).then((request) => request(this.axios, this.basePath));
|
|
|
+ }
|
|
|
/**
|
|
|
*
|
|
|
* @summary 上传文件
|