From 3ae7bdeb3df014affdf4869957e7de683f101468 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Wed, 4 Jun 2025 18:07:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E5=A2=9E=E5=8A=A0=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E6=95=B0=E6=8D=AE=E4=B8=8E=E6=96=87=E4=BB=B6=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=AE=9E=E4=BD=93=E5=92=8C=E6=9C=8D=E5=8A=A1=EF=BC=88?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=BA=94=E7=94=A8=E5=AE=9E=E4=BD=93=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=B8=8E=E6=96=87=E4=BB=B6=E5=85=B3=E8=81=94=E6=97=B6?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.NET/Admin.NET.Core/Entity/SysFile.cs | 26 +--- .../Admin.NET.Core/Entity/SysFileRelation.cs | 33 +++++ .../Service/File/Dto/FileInput.cs | 55 +++----- .../Service/File/SysFileRelationService.cs | 76 +++++++++++ .../Service/File/SysFileService.cs | 80 +++++------ .../Service/Tenant/SysTenantService.cs | 12 +- Web/package.json | 4 +- Web/src/api-services/apis/sys-file-api.ts | 129 ++---------------- .../models/sys-file-upload-file-body.ts | 8 ++ Web/src/api-services/models/sys-file.ts | 32 ++--- .../models/upload-file-from-base64-input.ts | 24 ++++ 11 files changed, 239 insertions(+), 240 deletions(-) create mode 100644 Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs create mode 100644 Admin.NET/Admin.NET.Core/Service/File/SysFileRelationService.cs diff --git a/Admin.NET/Admin.NET.Core/Entity/SysFile.cs b/Admin.NET/Admin.NET.Core/Entity/SysFile.cs index 99aa1482..c43211a6 100644 --- a/Admin.NET/Admin.NET.Core/Entity/SysFile.cs +++ b/Admin.NET/Admin.NET.Core/Entity/SysFile.cs @@ -83,25 +83,6 @@ public partial class SysFile : EntityTenantBaseData [MaxLength(128)] public string? FileMd5 { get; set; } - /// - /// 关联对象名称(如子对象) - /// - [SugarColumn(ColumnDescription = "关联对象名称", Length = 128)] - [MaxLength(128)] - public string? RelationName { get; set; } - - /// - /// 关联对象Id - /// - [SugarColumn(ColumnDescription = "关联对象Id")] - public long? RelationId { get; set; } - - /// - /// 所属Id(如主对象) - /// - [SugarColumn(ColumnDescription = "所属Id")] - public long? BelongId { get; set; } - /// /// 文件类别 /// @@ -109,6 +90,13 @@ public partial class SysFile : EntityTenantBaseData [MaxLength(128)] public virtual string? FileType { get; set; } + /// + /// 文件别名 + /// + [SugarColumn(ColumnDescription = "文件别名", Length = 128)] + [MaxLength(128)] + public string? FileAlias { get; set; } + /// /// 是否公开 /// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看 diff --git a/Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs b/Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs new file mode 100644 index 00000000..ebf81c93 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs @@ -0,0 +1,33 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 系统文件关联表 +/// +[SugarTable(null, "系统文件关联表")] +[SysTable] +public partial class SysFileRelation : EntityBaseId +{ + /// + /// 业务数据Id + /// + [SugarColumn(ColumnDescription = "业务数据Id")] + public long DataId { get; set; } + + /// + /// 文件Id + /// + [SugarColumn(ColumnDescription = "文件Id")] + public long FileId { get; set; } + + /// + /// 文件 + /// + [Navigate(NavigateType.OneToOne, nameof(FileId))] + public SysFile SysFile { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs b/Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs index 21eb8e98..f99e2515 100644 --- a/Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs +++ b/Admin.NET/Admin.NET.Core/Service/File/Dto/FileInput.cs @@ -61,6 +61,11 @@ public class UploadFileInput /// public string FileType { get; set; } + /// + /// 文件别名 + /// + public string FileAlias { get; set; } + /// /// 是否公开 /// @@ -102,43 +107,23 @@ public class UploadFileFromBase64Input /// public string ContentType { get; set; } + /// + /// 文件类别 + /// + public string FileType { get; set; } + + /// + /// 文件别名 + /// + public string FileAlias { get; set; } + + /// + /// 是否公开 + /// + public bool IsPublic { get; set; } = false; + /// /// 保存路径 /// public string Path { get; set; } -} - -/// -/// 查询关联查询输入 -/// -public class RelationQueryInput -{ - /// - /// 关联对象名称 - /// - public string RelationName { get; set; } - - /// - /// 关联对象Id - /// - public long? RelationId { get; set; } - - /// - /// 文件类型:多个以","分割 - /// - public string FileTypes { get; set; } - - /// - /// 所属Id - /// - public long? BelongId { get; set; } - - /// - /// 文件类型分割 - /// - /// - public string[] GetFileTypeBS() - { - return FileTypes.Split(','); - } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/File/SysFileRelationService.cs b/Admin.NET/Admin.NET.Core/Service/File/SysFileRelationService.cs new file mode 100644 index 00000000..1b32bda7 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Service/File/SysFileRelationService.cs @@ -0,0 +1,76 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.Service; + +/// +/// 系统文件关联服务 +/// +public class SysFileRelationService : ITransient +{ + private readonly SqlSugarRepository _sysFileRelationRep; + + public SysFileRelationService(SqlSugarRepository sysFileRelationRep) + { + _sysFileRelationRep = sysFileRelationRep; + } + + /// + /// 获取文件关联列表 + /// + /// + /// + public async Task> GetList(long dataId) + { + return await _sysFileRelationRep.AsQueryable() + .WhereIF(dataId > 0, u => u.DataId == dataId) + .ToListAsync(); + } + + /// + /// 增加文件关联 + /// + /// + /// + /// + public async Task AddFileRelation(long dataId, List fileIds) + { + var fileRelations = fileIds.Select(u => new SysFileRelation + { + DataId = dataId, + FileId = u.FileId + }).ToList(); + await _sysFileRelationRep.InsertRangeAsync(fileRelations); + } + + /// + /// 更新文件关联 + /// + /// + /// + /// + public async Task UpdateFileRelation(long dataId, List fileIds) + { + await _sysFileRelationRep.DeleteAsync(u => u.DataId == dataId); + + var fileRelations = fileIds.Select(u => new SysFileRelation + { + DataId = dataId, + FileId = u.FileId + }).ToList(); + await _sysFileRelationRep.InsertRangeAsync(fileRelations); + } + + /// + /// 删除文件关联 + /// + /// + /// + public async Task DeleteFileRelation(long dataId) + { + await _sysFileRelationRep.DeleteAsync(u => u.DataId == dataId); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs b/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs index b3c230db..3b755018 100644 --- a/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs +++ b/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs @@ -345,45 +345,45 @@ public class SysFileService : IDynamicApiController, ITransient return sysFile; } - /// - /// 修改附件关联对象 🔖 - /// - /// - /// - /// - /// - /// - [NonAction] - public async Task UpdateRelation(List ids, string relationName, long relationId, long belongId = 0) - { - if (ids == null || ids.Count == 0) - return 0; - return await _sysFileRep.AsUpdateable() - .SetColumns(u => u.RelationName == relationName) - .SetColumns(u => u.RelationId == relationId) - .SetColumns(u => u.BelongId == belongId) - .Where(u => ids.Contains(u.Id)) - .ExecuteCommandAsync(); - } + ///// + ///// 修改附件关联对象 🔖 + ///// + ///// + ///// + ///// + ///// + ///// + //[NonAction] + //public async Task UpdateRelation(List ids, string relationName, long relationId, long belongId = 0) + //{ + // if (ids == null || ids.Count == 0) + // return 0; + // return await _sysFileRep.AsUpdateable() + // .SetColumns(u => u.RelationName == relationName) + // .SetColumns(u => u.RelationId == relationId) + // .SetColumns(u => u.BelongId == belongId) + // .Where(u => ids.Contains(u.Id)) + // .ExecuteCommandAsync(); + //} - /// - /// 根据关联查询附件 🔖 - /// - /// - /// - /// - [DisplayName("根据关联查询附件")] - public async Task> GetRelationFiles([FromQuery] RelationQueryInput input) - { - return await _sysFileRep.AsQueryable() - .WhereIF(input.RelationId is > 0, u => u.RelationId == input.RelationId) - .WhereIF(input.BelongId is > 0, u => u.BelongId == input.BelongId.Value) - .WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), u => u.RelationName == input.RelationName) - .WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType)) - .Select(u => new SysFile - { - Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()), - }, true) - .ToListAsync(); - } + ///// + ///// 根据关联查询附件 🔖 + ///// + ///// + ///// + ///// + //[DisplayName("根据关联查询附件")] + //public async Task> GetRelationFiles([FromQuery] RelationQueryInput input) + //{ + // return await _sysFileRep.AsQueryable() + // .WhereIF(input.RelationId is > 0, u => u.RelationId == input.RelationId) + // .WhereIF(input.BelongId is > 0, u => u.BelongId == input.BelongId.Value) + // .WhereIF(!string.IsNullOrWhiteSpace(input.RelationName), u => u.RelationName == input.RelationName) + // .WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType)) + // .Select(u => new SysFile + // { + // Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()), + // }, true) + // .ToListAsync(); + //} } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs index f43384f4..efed494b 100644 --- a/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs @@ -582,8 +582,8 @@ public class SysTenantService : IDynamicApiController, ITransient if (string.IsNullOrWhiteSpace(tenant.Title)) tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == SqlSugarConst.DefaultTenantId); - // 获取首页轮播图列表 - var carouselFiles = await _fileRep.GetListAsync(u => u.BelongId == tenant.Id && u.RelationId == tenant.Id && u.FileType == "Carousel"); + //// 获取首页轮播图列表 + //var carouselFiles = await _fileRep.GetListAsync(u => u.BelongId == tenant.Id && u.RelationId == tenant.Id && u.FileType == "Carousel"); var forceChangePassword = await _sysConfigService.GetConfigValueByCode(ConfigConst.SysForceChangePassword); // 强制修改密码 var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode(ConfigConst.SysPasswordExpirationTime); // 密码有效期 @@ -611,7 +611,7 @@ public class SysTenantService : IDynamicApiController, ITransient ForceChangePassword = forceChangePassword, PasswordExpirationTime = passwordExpirationTime, PublicKey = publicKey, - CarouselFiles = carouselFiles, + //CarouselFiles = carouselFiles, I18NSwitch = i18NSwitch, IdleTimeout = idleTimeout, }; @@ -721,9 +721,9 @@ public class SysTenantService : IDynamicApiController, ITransient // 保存轮播图文件 var sysFile = await _sysFileService.UploadFile(new UploadFileInput { File = file, FileType = "Carousel", SavePath = path }); - // 保存轮播图配置 - sysFile.BelongId = tenant.Id; - sysFile.RelationId = tenant.Id; + //// 保存轮播图配置 + //sysFile.BelongId = tenant.Id; + //sysFile.RelationId = tenant.Id; await _sysFileService.UpdateFile(sysFile); diff --git a/Web/package.json b/Web/package.json index cf4b902e..988a16ae 100644 --- a/Web/package.json +++ b/Web/package.json @@ -80,8 +80,8 @@ "vue-signature-pad": "^3.0.2", "vue3-flag-icons": "^0.0.3", "vue3-tree-org": "^4.2.2", - "vxe-pc-ui": "^4.6.13", - "vxe-table": "^4.13.32", + "vxe-pc-ui": "^4.6.14", + "vxe-table": "^4.13.33", "xe-utils": "^3.7.4", "xlsx-js-style": "^1.2.0" }, diff --git a/Web/src/api-services/apis/sys-file-api.ts b/Web/src/api-services/apis/sys-file-api.ts index 0ff9bc62..d2e029f3 100644 --- a/Web/src/api-services/apis/sys-file-api.ts +++ b/Web/src/api-services/apis/sys-file-api.ts @@ -418,69 +418,6 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, - /** - * - * @summary 根据关联查询附件 🔖 - * @param {string} [relationName] 关联对象名称 - * @param {number} [relationId] 关联对象Id - * @param {string} [fileTypes] 文件类型:多个以\",\"分割 - * @param {number} [belongId] 所属Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysFileRelationFilesGet: async (relationName?: string, relationId?: number, fileTypes?: string, belongId?: number, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysFile/relationFiles`; - // 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: 'GET', ...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; - } - - if (relationName !== undefined) { - localVarQueryParameter['RelationName'] = relationName; - } - - if (relationId !== undefined) { - localVarQueryParameter['RelationId'] = relationId; - } - - if (fileTypes !== undefined) { - localVarQueryParameter['FileTypes'] = fileTypes; - } - - if (belongId !== undefined) { - localVarQueryParameter['BelongId'] = belongId; - } - - 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}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, /** * * @summary 更新文件 🔖 @@ -634,6 +571,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati * @summary 上传文件 🔖 * @param {Blob} [file] * @param {string} [fileType] + * @param {string} [fileAlias] * @param {boolean} [isPublic] * @param {string} [path] * @param {string} [savePath] @@ -641,7 +579,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysFileUploadFilePostForm: async (file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options: AxiosRequestConfig = {}): Promise => { + apiSysFileUploadFilePostForm: async (file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/sysFile/uploadFile`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); @@ -672,6 +610,10 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati localVarFormParams.append('FileType', fileType as any); } + if (fileAlias !== undefined) { + localVarFormParams.append('FileAlias', fileAlias as any); + } + if (isPublic !== undefined) { localVarFormParams.append('IsPublic', isPublic as any); } @@ -932,23 +874,6 @@ export const SysFileApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, - /** - * - * @summary 根据关联查询附件 🔖 - * @param {string} [relationName] 关联对象名称 - * @param {number} [relationId] 关联对象Id - * @param {string} [fileTypes] 文件类型:多个以\",\"分割 - * @param {number} [belongId] 所属Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysFileRelationFilesGet(relationName?: string, relationId?: number, fileTypes?: string, belongId?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileRelationFilesGet(relationName, relationId, fileTypes, belongId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, /** * * @summary 更新文件 🔖 @@ -996,6 +921,7 @@ export const SysFileApiFp = function(configuration?: Configuration) { * @summary 上传文件 🔖 * @param {Blob} [file] * @param {string} [fileType] + * @param {string} [fileAlias] * @param {boolean} [isPublic] * @param {string} [path] * @param {string} [savePath] @@ -1003,8 +929,8 @@ export const SysFileApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options); + async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, fileAlias, isPublic, path, savePath, allowSuffix, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -1127,19 +1053,6 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa async apiSysFilePreviewIdGet(id: number, options?: AxiosRequestConfig): Promise> { return SysFileApiFp(configuration).apiSysFilePreviewIdGet(id, options).then((request) => request(axios, basePath)); }, - /** - * - * @summary 根据关联查询附件 🔖 - * @param {string} [relationName] 关联对象名称 - * @param {number} [relationId] 关联对象Id - * @param {string} [fileTypes] 文件类型:多个以\",\"分割 - * @param {number} [belongId] 所属Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysFileRelationFilesGet(relationName?: string, relationId?: number, fileTypes?: string, belongId?: number, options?: AxiosRequestConfig): Promise> { - return SysFileApiFp(configuration).apiSysFileRelationFilesGet(relationName, relationId, fileTypes, belongId, options).then((request) => request(axios, basePath)); - }, /** * * @summary 更新文件 🔖 @@ -1175,6 +1088,7 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa * @summary 上传文件 🔖 * @param {Blob} [file] * @param {string} [fileType] + * @param {string} [fileAlias] * @param {boolean} [isPublic] * @param {string} [path] * @param {string} [savePath] @@ -1182,8 +1096,8 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise> { - return SysFileApiFp(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(axios, basePath)); + async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise> { + return SysFileApiFp(configuration).apiSysFileUploadFilePostForm(file, fileType, fileAlias, isPublic, path, savePath, allowSuffix, options).then((request) => request(axios, basePath)); }, /** * @@ -1303,20 +1217,6 @@ export class SysFileApi extends BaseAPI { public async apiSysFilePreviewIdGet(id: number, options?: AxiosRequestConfig) : Promise> { return SysFileApiFp(this.configuration).apiSysFilePreviewIdGet(id, options).then((request) => request(this.axios, this.basePath)); } - /** - * - * @summary 根据关联查询附件 🔖 - * @param {string} [relationName] 关联对象名称 - * @param {number} [relationId] 关联对象Id - * @param {string} [fileTypes] 文件类型:多个以\",\"分割 - * @param {number} [belongId] 所属Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysFileApi - */ - public async apiSysFileRelationFilesGet(relationName?: string, relationId?: number, fileTypes?: string, belongId?: number, options?: AxiosRequestConfig) : Promise> { - return SysFileApiFp(this.configuration).apiSysFileRelationFilesGet(relationName, relationId, fileTypes, belongId, options).then((request) => request(this.axios, this.basePath)); - } /** * * @summary 更新文件 🔖 @@ -1355,6 +1255,7 @@ export class SysFileApi extends BaseAPI { * @summary 上传文件 🔖 * @param {Blob} [file] * @param {string} [fileType] + * @param {string} [fileAlias] * @param {boolean} [isPublic] * @param {string} [path] * @param {string} [savePath] @@ -1363,8 +1264,8 @@ export class SysFileApi extends BaseAPI { * @throws {RequiredError} * @memberof SysFileApi */ - public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise> { - return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath)); + public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise> { + return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, fileAlias, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath)); } /** * diff --git a/Web/src/api-services/models/sys-file-upload-file-body.ts b/Web/src/api-services/models/sys-file-upload-file-body.ts index 2a4d4140..66b0c22f 100644 --- a/Web/src/api-services/models/sys-file-upload-file-body.ts +++ b/Web/src/api-services/models/sys-file-upload-file-body.ts @@ -36,6 +36,14 @@ export interface SysFileUploadFileBody { */ fileType?: string; + /** + * 文件别名 + * + * @type {string} + * @memberof SysFileUploadFileBody + */ + fileAlias?: string; + /** * 是否公开 * diff --git a/Web/src/api-services/models/sys-file.ts b/Web/src/api-services/models/sys-file.ts index e0ca5143..9cac0129 100644 --- a/Web/src/api-services/models/sys-file.ts +++ b/Web/src/api-services/models/sys-file.ts @@ -188,30 +188,6 @@ export interface SysFile { */ fileMd5?: string | null; - /** - * 关联对象名称(如子对象) - * - * @type {string} - * @memberof SysFile - */ - relationName?: string | null; - - /** - * 关联对象Id - * - * @type {number} - * @memberof SysFile - */ - relationId?: number | null; - - /** - * 所属Id(如主对象) - * - * @type {number} - * @memberof SysFile - */ - belongId?: number | null; - /** * 文件类别 * @@ -220,6 +196,14 @@ export interface SysFile { */ fileType?: string | null; + /** + * 文件别名 + * + * @type {string} + * @memberof SysFile + */ + fileAlias?: string | null; + /** * 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看 * diff --git a/Web/src/api-services/models/upload-file-from-base64-input.ts b/Web/src/api-services/models/upload-file-from-base64-input.ts index b29d841d..ffb1f5c5 100644 --- a/Web/src/api-services/models/upload-file-from-base64-input.ts +++ b/Web/src/api-services/models/upload-file-from-base64-input.ts @@ -44,6 +44,30 @@ export interface UploadFileFromBase64Input { */ contentType?: string | null; + /** + * 文件类别 + * + * @type {string} + * @memberof UploadFileFromBase64Input + */ + fileType?: string | null; + + /** + * 文件别名 + * + * @type {string} + * @memberof UploadFileFromBase64Input + */ + fileAlias?: string | null; + + /** + * 是否公开 + * + * @type {boolean} + * @memberof UploadFileFromBase64Input + */ + isPublic?: boolean; + /** * 保存路径 *