@ -1132,49 +1132,39 @@ namespace IBKLinker_Minio.Controller.MinioController
return date ;
return date ;
}
}
/// <summary>
/// <summary>
/// 获取 根目录和根目录下一级得菜单信息
/// 获取 所有文件夹
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[HttpPost, Route("GetRecursion")]
[HttpPost, Route("GetRecursion")]
public RequestEntity GetRecursion ( )
public RequestEntity GetRecursion ( )
{
{
MinioBusinessLogic bb = new MinioBusinessLogic ( ) ; //定义业务逻辑方法
RequestEntity request = new RequestEntity ( ) ;
RequestEntity request = new RequestEntity ( ) ;
try
try
{
{
//拿到根目录
List < RequstStoragePath > requstStoragePaths = new List < RequstStoragePath > ( ) ;
List < RequstStoragePath > requstStoragePaths = new List < RequstStoragePath > ( ) ;
List < MinioStoragePath > date = new List < MinioStoragePath > ( ) ;
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
{
string sql = string . Empty ;
List < MinioStoragePath > rootDirectories = db . Query < MinioStoragePath > ( "select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0'and FILE_LEVEL='1' ORDER BY PK" ) . ToList ( ) ; //查询根文件夹
foreach ( var rootDir in rootDirectories )
date = db . Query < MinioStoragePath > ( "select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0'and FILE_TYPE='0' ORDER BY PK" ) . ToList ( ) ;
//UPK=0 AND FILE_LEVEL=1 and
}
if ( date . Count > 0 )
{
foreach ( var item in date )
{
{
RequstStoragePath model = new RequstStoragePath ( ) ;
RequstStoragePath rootModel = new RequstStoragePath ( ) ;
rootModel . Pk = rootDir . Pk ; //主键ID
model . Pk = item . Pk ;
rootModel . Upk = rootDir . Upk ; //父级文件夹pk
model . FileName = item . FileName ;
rootModel . FileName = rootDir . FileName ; //文件名称
model . FilePath = item . FilePath ;
rootModel . FilePath = rootDir . FilePath ; //文件路径
model . FileType = item . FileType ;
rootModel . FileType = rootDir . FileType ; //文件类型
model . FileLever = item . FileLevel ;
rootModel . FileLevel = rootDir . FileLevel ; //层级
model . requstStoragePaths = new List < StoragePath > ( ) ;
rootModel . CreatorTime = rootDir . CreatorTime ; //创建时间
List < MinioStoragePath > ds = GetMenuTree ( item . Pk . ToString ( ) ) ;
rootModel . CreatorUser = rootDir . CreatorUser ; //创建者
foreach ( var items in ds )
rootModel . DownloadNum = rootDir . DownloadNum ; //下载次数
{
rootModel . ModifyUsers = rootDir . ModifyUsers ; //修改用户
StoragePath models = new StoragePath ( ) ;
rootModel . ModifyTime = rootDir . ModifyTime ; //修改时间
models . Pk = items . Pk ;
rootModel . ClearUsers = rootDir . ClearUsers ; //删除用户
models . FileName = items . FileName ;
rootModel . ClearTime = rootDir . ClearTime ; //删除时间
models . FilePath = items . FilePath ;
rootModel . ClearFlag = rootDir . ClearFlag ; //删除标记 0未删除 1删除
models . FileType = items . FileType ;
rootModel . requstStoragePaths = bb . GetSubDirectories ( rootDir . Pk ) ; //子级存进list
models . FileLever = items . FileLevel ;
requstStoragePaths . Add ( rootModel ) ; //添加list
model . requstStoragePaths . Add ( models ) ;
}
requstStoragePaths . Add ( model ) ;
}
}
}
}
request . data = requstStoragePaths ;
request . data = requstStoragePaths ;
@ -1188,8 +1178,6 @@ namespace IBKLinker_Minio.Controller.MinioController
return request ;
return request ;
}
}
/// <summary>
/// <summary>
/// 权限查询
/// 权限查询
/// </summary>
/// </summary>
@ -1346,7 +1334,7 @@ namespace IBKLinker_Minio.Controller.MinioController
{
{
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
{
request . data = db . Query < MinioOperationlog > ( "select * from MINIO_OPERATIONLOG where 1=1 ") ;
request . data = db . Query < MinioOperationlog > ( "select * from MINIO_OPERATIONLOG where 1=1 order by OPERATE_TIME desc ") ;
request . code = "0" ;
request . code = "0" ;
}
}
}
}
@ -1590,42 +1578,6 @@ namespace IBKLinker_Minio.Controller.MinioController
}
}
# endregion
# endregion
#region
[HttpPost, Route("CESHI")]
public RequestEntity CESHI ( )
{
MinioBusinessLogic bb = new MinioBusinessLogic ( ) ; //定义业务逻辑方法
RequestEntity request = new RequestEntity ( ) ;
try
{
List < RequstStoragePath > requstStoragePaths = new List < RequstStoragePath > ( ) ;
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
List < MinioStoragePath > rootDirectories = db . Query < MinioStoragePath > ( "select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0'and FILE_LEVEL='1' ORDER BY PK" ) . ToList ( ) ; //查询根文件夹
foreach ( var rootDir in rootDirectories )
{
RequstStoragePath rootModel = new RequstStoragePath ( ) ;
rootModel . Pk = rootDir . Pk ; //主键ID
rootModel . FileName = rootDir . FileName ; //文件名称
rootModel . FilePath = rootDir . FilePath ; //文件路径
rootModel . FileType = rootDir . FileType ; //文件类型
rootModel . FileLever = rootDir . FileLevel ; //层级
rootModel . requstStoragePaths = bb . GetSubDirectories ( rootDir . Pk ) ; //子级存进list
requstStoragePaths . Add ( rootModel ) ; //添加list
}
}
request . data = requstStoragePaths ;
request . code = "0" ;
}
catch ( Exception )
{
request . code = "1" ;
throw ;
}
return request ;
}
# endregion
}
}
}
}