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