😎增加业务数据与文件关联实体和服务(业务应用实体需要与文件关联时统一处理)
This commit is contained in:
parent
ced3c58581
commit
3ae7bdeb3d
@ -83,25 +83,6 @@ public partial class SysFile : EntityTenantBaseData
|
|||||||
[MaxLength(128)]
|
[MaxLength(128)]
|
||||||
public string? FileMd5 { get; set; }
|
public string? FileMd5 { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 关联对象名称(如子对象)
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "关联对象名称", Length = 128)]
|
|
||||||
[MaxLength(128)]
|
|
||||||
public string? RelationName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 关联对象Id
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "关联对象Id")]
|
|
||||||
public long? RelationId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属Id(如主对象)
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnDescription = "所属Id")]
|
|
||||||
public long? BelongId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件类别
|
/// 文件类别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -109,6 +90,13 @@ public partial class SysFile : EntityTenantBaseData
|
|||||||
[MaxLength(128)]
|
[MaxLength(128)]
|
||||||
public virtual string? FileType { get; set; }
|
public virtual string? FileType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件别名
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文件别名", Length = 128)]
|
||||||
|
[MaxLength(128)]
|
||||||
|
public string? FileAlias { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否公开
|
/// 是否公开
|
||||||
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
/// 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||||
|
|||||||
33
Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs
Normal file
33
Admin.NET/Admin.NET.Core/Entity/SysFileRelation.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
namespace Admin.NET.Core;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统文件关联表
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable(null, "系统文件关联表")]
|
||||||
|
[SysTable]
|
||||||
|
public partial class SysFileRelation : EntityBaseId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 业务数据Id
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "业务数据Id")]
|
||||||
|
public long DataId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件Id
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文件Id")]
|
||||||
|
public long FileId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件
|
||||||
|
/// </summary>
|
||||||
|
[Navigate(NavigateType.OneToOne, nameof(FileId))]
|
||||||
|
public SysFile SysFile { get; set; }
|
||||||
|
}
|
||||||
@ -61,6 +61,11 @@ public class UploadFileInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string FileType { get; set; }
|
public string FileType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件别名
|
||||||
|
/// </summary>
|
||||||
|
public string FileAlias { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否公开
|
/// 是否公开
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -102,43 +107,23 @@ public class UploadFileFromBase64Input
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ContentType { get; set; }
|
public string ContentType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件类别
|
||||||
|
/// </summary>
|
||||||
|
public string FileType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件别名
|
||||||
|
/// </summary>
|
||||||
|
public string FileAlias { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否公开
|
||||||
|
/// </summary>
|
||||||
|
public bool IsPublic { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存路径
|
/// 保存路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查询关联查询输入
|
|
||||||
/// </summary>
|
|
||||||
public class RelationQueryInput
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 关联对象名称
|
|
||||||
/// </summary>
|
|
||||||
public string RelationName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 关联对象Id
|
|
||||||
/// </summary>
|
|
||||||
public long? RelationId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 文件类型:多个以","分割
|
|
||||||
/// </summary>
|
|
||||||
public string FileTypes { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属Id
|
|
||||||
/// </summary>
|
|
||||||
public long? BelongId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 文件类型分割
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string[] GetFileTypeBS()
|
|
||||||
{
|
|
||||||
return FileTypes.Split(',');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
|
//
|
||||||
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
|
//
|
||||||
|
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||||
|
|
||||||
|
namespace Admin.NET.Core.Service;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统文件关联服务
|
||||||
|
/// </summary>
|
||||||
|
public class SysFileRelationService : ITransient
|
||||||
|
{
|
||||||
|
private readonly SqlSugarRepository<SysFileRelation> _sysFileRelationRep;
|
||||||
|
|
||||||
|
public SysFileRelationService(SqlSugarRepository<SysFileRelation> sysFileRelationRep)
|
||||||
|
{
|
||||||
|
_sysFileRelationRep = sysFileRelationRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取文件关联列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<SysFileRelation>> GetList(long dataId)
|
||||||
|
{
|
||||||
|
return await _sysFileRelationRep.AsQueryable()
|
||||||
|
.WhereIF(dataId > 0, u => u.DataId == dataId)
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 增加文件关联
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataId"></param>
|
||||||
|
/// <param name="fileIds"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task AddFileRelation(long dataId, List<SysFileRelation> fileIds)
|
||||||
|
{
|
||||||
|
var fileRelations = fileIds.Select(u => new SysFileRelation
|
||||||
|
{
|
||||||
|
DataId = dataId,
|
||||||
|
FileId = u.FileId
|
||||||
|
}).ToList();
|
||||||
|
await _sysFileRelationRep.InsertRangeAsync(fileRelations);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新文件关联
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataId"></param>
|
||||||
|
/// <param name="fileIds"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task UpdateFileRelation(long dataId, List<SysFileRelation> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除文件关联
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task DeleteFileRelation(long dataId)
|
||||||
|
{
|
||||||
|
await _sysFileRelationRep.DeleteAsync(u => u.DataId == dataId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -345,45 +345,45 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
return sysFile;
|
return sysFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 修改附件关联对象 🔖
|
///// 修改附件关联对象 🔖
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="ids"></param>
|
///// <param name="ids"></param>
|
||||||
/// <param name="relationName"></param>
|
///// <param name="relationName"></param>
|
||||||
/// <param name="relationId"></param>
|
///// <param name="relationId"></param>
|
||||||
/// <param name="belongId"></param>
|
///// <param name="belongId"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
[NonAction]
|
//[NonAction]
|
||||||
public async Task<int> UpdateRelation(List<long> ids, string relationName, long relationId, long belongId = 0)
|
//public async Task<int> UpdateRelation(List<long> ids, string relationName, long relationId, long belongId = 0)
|
||||||
{
|
//{
|
||||||
if (ids == null || ids.Count == 0)
|
// if (ids == null || ids.Count == 0)
|
||||||
return 0;
|
// return 0;
|
||||||
return await _sysFileRep.AsUpdateable()
|
// return await _sysFileRep.AsUpdateable()
|
||||||
.SetColumns(u => u.RelationName == relationName)
|
// .SetColumns(u => u.RelationName == relationName)
|
||||||
.SetColumns(u => u.RelationId == relationId)
|
// .SetColumns(u => u.RelationId == relationId)
|
||||||
.SetColumns(u => u.BelongId == belongId)
|
// .SetColumns(u => u.BelongId == belongId)
|
||||||
.Where(u => ids.Contains(u.Id))
|
// .Where(u => ids.Contains(u.Id))
|
||||||
.ExecuteCommandAsync();
|
// .ExecuteCommandAsync();
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 根据关联查询附件 🔖
|
///// 根据关联查询附件 🔖
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="input"></param>
|
///// <param name="input"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
/// <exception cref="ArgumentNullException"></exception>
|
///// <exception cref="ArgumentNullException"></exception>
|
||||||
[DisplayName("根据关联查询附件")]
|
//[DisplayName("根据关联查询附件")]
|
||||||
public async Task<List<SysFile>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
//public async Task<List<SysFile>> GetRelationFiles([FromQuery] RelationQueryInput input)
|
||||||
{
|
//{
|
||||||
return await _sysFileRep.AsQueryable()
|
// return await _sysFileRep.AsQueryable()
|
||||||
.WhereIF(input.RelationId is > 0, u => u.RelationId == input.RelationId)
|
// .WhereIF(input.RelationId is > 0, u => u.RelationId == input.RelationId)
|
||||||
.WhereIF(input.BelongId is > 0, u => u.BelongId == input.BelongId.Value)
|
// .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.RelationName), u => u.RelationName == input.RelationName)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType))
|
// .WhereIF(!string.IsNullOrWhiteSpace(input.FileTypes), u => input.GetFileTypeBS().Contains(u.FileType))
|
||||||
.Select(u => new SysFile
|
// .Select(u => new SysFile
|
||||||
{
|
// {
|
||||||
Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()),
|
// Url = SqlFunc.MergeString("/api/sysFile/Preview/", u.Id.ToString()),
|
||||||
}, true)
|
// }, true)
|
||||||
.ToListAsync();
|
// .ToListAsync();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
@ -582,8 +582,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
if (string.IsNullOrWhiteSpace(tenant.Title))
|
if (string.IsNullOrWhiteSpace(tenant.Title))
|
||||||
tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == SqlSugarConst.DefaultTenantId);
|
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<bool>(ConfigConst.SysForceChangePassword); // 强制修改密码
|
var forceChangePassword = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysForceChangePassword); // 强制修改密码
|
||||||
var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordExpirationTime); // 密码有效期
|
var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordExpirationTime); // 密码有效期
|
||||||
@ -611,7 +611,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
ForceChangePassword = forceChangePassword,
|
ForceChangePassword = forceChangePassword,
|
||||||
PasswordExpirationTime = passwordExpirationTime,
|
PasswordExpirationTime = passwordExpirationTime,
|
||||||
PublicKey = publicKey,
|
PublicKey = publicKey,
|
||||||
CarouselFiles = carouselFiles,
|
//CarouselFiles = carouselFiles,
|
||||||
I18NSwitch = i18NSwitch,
|
I18NSwitch = i18NSwitch,
|
||||||
IdleTimeout = idleTimeout,
|
IdleTimeout = idleTimeout,
|
||||||
};
|
};
|
||||||
@ -721,9 +721,9 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
// 保存轮播图文件
|
// 保存轮播图文件
|
||||||
var sysFile = await _sysFileService.UploadFile(new UploadFileInput { File = file, FileType = "Carousel", SavePath = path });
|
var sysFile = await _sysFileService.UploadFile(new UploadFileInput { File = file, FileType = "Carousel", SavePath = path });
|
||||||
|
|
||||||
// 保存轮播图配置
|
//// 保存轮播图配置
|
||||||
sysFile.BelongId = tenant.Id;
|
//sysFile.BelongId = tenant.Id;
|
||||||
sysFile.RelationId = tenant.Id;
|
//sysFile.RelationId = tenant.Id;
|
||||||
|
|
||||||
await _sysFileService.UpdateFile(sysFile);
|
await _sysFileService.UpdateFile(sysFile);
|
||||||
|
|
||||||
|
|||||||
@ -80,8 +80,8 @@
|
|||||||
"vue-signature-pad": "^3.0.2",
|
"vue-signature-pad": "^3.0.2",
|
||||||
"vue3-flag-icons": "^0.0.3",
|
"vue3-flag-icons": "^0.0.3",
|
||||||
"vue3-tree-org": "^4.2.2",
|
"vue3-tree-org": "^4.2.2",
|
||||||
"vxe-pc-ui": "^4.6.13",
|
"vxe-pc-ui": "^4.6.14",
|
||||||
"vxe-table": "^4.13.32",
|
"vxe-table": "^4.13.33",
|
||||||
"xe-utils": "^3.7.4",
|
"xe-utils": "^3.7.4",
|
||||||
"xlsx-js-style": "^1.2.0"
|
"xlsx-js-style": "^1.2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -418,69 +418,6 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
options: localVarRequestOptions,
|
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<RequestArgs> => {
|
|
||||||
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 更新文件 🔖
|
* @summary 更新文件 🔖
|
||||||
@ -634,6 +571,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
* @summary 上传文件 🔖
|
* @summary 上传文件 🔖
|
||||||
* @param {Blob} [file]
|
* @param {Blob} [file]
|
||||||
* @param {string} [fileType]
|
* @param {string} [fileType]
|
||||||
|
* @param {string} [fileAlias]
|
||||||
* @param {boolean} [isPublic]
|
* @param {boolean} [isPublic]
|
||||||
* @param {string} [path]
|
* @param {string} [path]
|
||||||
* @param {string} [savePath]
|
* @param {string} [savePath]
|
||||||
@ -641,7 +579,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysFileUploadFilePostForm: async (file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysFileUploadFilePostForm: async (file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/sysFile/uploadFile`;
|
const localVarPath = `/api/sysFile/uploadFile`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
@ -672,6 +610,10 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
localVarFormParams.append('FileType', fileType as any);
|
localVarFormParams.append('FileType', fileType as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fileAlias !== undefined) {
|
||||||
|
localVarFormParams.append('FileAlias', fileAlias as any);
|
||||||
|
}
|
||||||
|
|
||||||
if (isPublic !== undefined) {
|
if (isPublic !== undefined) {
|
||||||
localVarFormParams.append('IsPublic', isPublic as any);
|
localVarFormParams.append('IsPublic', isPublic as any);
|
||||||
}
|
}
|
||||||
@ -932,23 +874,6 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
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<AxiosResponse<AdminNETResultListSysFile>>> {
|
|
||||||
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 更新文件 🔖
|
* @summary 更新文件 🔖
|
||||||
@ -996,6 +921,7 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|||||||
* @summary 上传文件 🔖
|
* @summary 上传文件 🔖
|
||||||
* @param {Blob} [file]
|
* @param {Blob} [file]
|
||||||
* @param {string} [fileType]
|
* @param {string} [fileType]
|
||||||
|
* @param {string} [fileAlias]
|
||||||
* @param {boolean} [isPublic]
|
* @param {boolean} [isPublic]
|
||||||
* @param {string} [path]
|
* @param {string} [path]
|
||||||
* @param {string} [savePath]
|
* @param {string} [savePath]
|
||||||
@ -1003,8 +929,8 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSysFile>>> {
|
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSysFile>>> {
|
||||||
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options);
|
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, fileAlias, isPublic, path, savePath, allowSuffix, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
@ -1127,19 +1053,6 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|||||||
async apiSysFilePreviewIdGet(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultIActionResult>> {
|
async apiSysFilePreviewIdGet(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultIActionResult>> {
|
||||||
return SysFileApiFp(configuration).apiSysFilePreviewIdGet(id, options).then((request) => request(axios, basePath));
|
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<AxiosResponse<AdminNETResultListSysFile>> {
|
|
||||||
return SysFileApiFp(configuration).apiSysFileRelationFilesGet(relationName, relationId, fileTypes, belongId, options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新文件 🔖
|
* @summary 更新文件 🔖
|
||||||
@ -1175,6 +1088,7 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|||||||
* @summary 上传文件 🔖
|
* @summary 上传文件 🔖
|
||||||
* @param {Blob} [file]
|
* @param {Blob} [file]
|
||||||
* @param {string} [fileType]
|
* @param {string} [fileType]
|
||||||
|
* @param {string} [fileAlias]
|
||||||
* @param {boolean} [isPublic]
|
* @param {boolean} [isPublic]
|
||||||
* @param {string} [path]
|
* @param {string} [path]
|
||||||
* @param {string} [savePath]
|
* @param {string} [savePath]
|
||||||
@ -1182,8 +1096,8 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysFile>> {
|
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysFile>> {
|
||||||
return SysFileApiFp(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(axios, basePath));
|
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<AxiosResponse<AdminNETResultIActionResult>> {
|
public async apiSysFilePreviewIdGet(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultIActionResult>> {
|
||||||
return SysFileApiFp(this.configuration).apiSysFilePreviewIdGet(id, options).then((request) => request(this.axios, this.basePath));
|
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<AxiosResponse<AdminNETResultListSysFile>> {
|
|
||||||
return SysFileApiFp(this.configuration).apiSysFileRelationFilesGet(relationName, relationId, fileTypes, belongId, options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新文件 🔖
|
* @summary 更新文件 🔖
|
||||||
@ -1355,6 +1255,7 @@ export class SysFileApi extends BaseAPI {
|
|||||||
* @summary 上传文件 🔖
|
* @summary 上传文件 🔖
|
||||||
* @param {Blob} [file]
|
* @param {Blob} [file]
|
||||||
* @param {string} [fileType]
|
* @param {string} [fileType]
|
||||||
|
* @param {string} [fileAlias]
|
||||||
* @param {boolean} [isPublic]
|
* @param {boolean} [isPublic]
|
||||||
* @param {string} [path]
|
* @param {string} [path]
|
||||||
* @param {string} [savePath]
|
* @param {string} [savePath]
|
||||||
@ -1363,8 +1264,8 @@ export class SysFileApi extends BaseAPI {
|
|||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysFileApi
|
* @memberof SysFileApi
|
||||||
*/
|
*/
|
||||||
public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysFile>> {
|
public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, fileAlias?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysFile>> {
|
||||||
return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath));
|
return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, fileAlias, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -36,6 +36,14 @@ export interface SysFileUploadFileBody {
|
|||||||
*/
|
*/
|
||||||
fileType?: string;
|
fileType?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件别名
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SysFileUploadFileBody
|
||||||
|
*/
|
||||||
|
fileAlias?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否公开
|
* 是否公开
|
||||||
*
|
*
|
||||||
|
|||||||
@ -188,30 +188,6 @@ export interface SysFile {
|
|||||||
*/
|
*/
|
||||||
fileMd5?: string | null;
|
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;
|
fileType?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件别名
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SysFile
|
||||||
|
*/
|
||||||
|
fileAlias?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
* 是否公开 若为true则所有人都可以查看,默认只有自己或有权限的可以查看
|
||||||
*
|
*
|
||||||
|
|||||||
@ -44,6 +44,30 @@ export interface UploadFileFromBase64Input {
|
|||||||
*/
|
*/
|
||||||
contentType?: string | null;
|
contentType?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类别
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof UploadFileFromBase64Input
|
||||||
|
*/
|
||||||
|
fileType?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件别名
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof UploadFileFromBase64Input
|
||||||
|
*/
|
||||||
|
fileAlias?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否公开
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof UploadFileFromBase64Input
|
||||||
|
*/
|
||||||
|
isPublic?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存路径
|
* 保存路径
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user