From 6d7f3ef7ce6d9847bc87f3467b1bd94058c7188b Mon Sep 17 00:00:00 2001 From: wtp <1813748440@qq.com> Date: Thu, 20 Apr 2023 16:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GDZZ.Core/GDZZ.Core.xml | 12 +++++++++ GDZZ.Core/Service/File/Dto/FileInput.cs | 5 ++++ GDZZ.Core/Service/File/SysFileService.cs | 31 +++++++++++++++++++++--- GDZZ.Web.Entry/appsettings.json | 2 +- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/GDZZ.Core/GDZZ.Core.xml b/GDZZ.Core/GDZZ.Core.xml index 7b49196..3ff130b 100644 --- a/GDZZ.Core/GDZZ.Core.xml +++ b/GDZZ.Core/GDZZ.Core.xml @@ -6047,6 +6047,11 @@ 文件类型 + + + 课程ID + + 文件Id @@ -6079,6 +6084,13 @@ + + + 分页获取MP文件列表 + + + + 分页获取MP文件列表 diff --git a/GDZZ.Core/Service/File/Dto/FileInput.cs b/GDZZ.Core/Service/File/Dto/FileInput.cs index 591b416..458a760 100644 --- a/GDZZ.Core/Service/File/Dto/FileInput.cs +++ b/GDZZ.Core/Service/File/Dto/FileInput.cs @@ -53,6 +53,11 @@ public class FileInput : PageInputBase /// 文件类型 /// public int FileType { get; set; } + + /// + /// 课程ID + /// + public long CID { get; set; } } public class DeleteFileInfoInput diff --git a/GDZZ.Core/Service/File/SysFileService.cs b/GDZZ.Core/Service/File/SysFileService.cs index 140ee82..11df905 100644 --- a/GDZZ.Core/Service/File/SysFileService.cs +++ b/GDZZ.Core/Service/File/SysFileService.cs @@ -56,6 +56,31 @@ public class SysFileService : ISysFileService, IDynamicApiController, ITransient } + /// + /// 分页获取MP文件列表 + /// + /// + /// + [HttpGet("/Mini/sysFileInfo/list")] + public async Task QueryMP4FileInfoList([FromQuery] FileInput input) + { + var fileBucket = !string.IsNullOrEmpty(input.FileBucket?.Trim()); + var fileOriginName = !string.IsNullOrEmpty(input.FileOriginName?.Trim()); + + //rmrf- + + var files = await _sysFileInfoRep.AsQueryable() + .WhereIF(input.FileLocation > 0, u => u.FileLocation == input.FileLocation) + .Where(u => u.FileSuffix == "MP4") + .WhereIF(!input.CID.IsNullOrZero(), u => u.CID == input.CID) + .WhereIF(!string.IsNullOrWhiteSpace(input.FileBucket), u => u.FileBucket.Contains(input.FileBucket.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.FileOriginName), u => u.FileOriginName.Contains(input.FileOriginName.Trim())) + .Select() + .ToListAsync(); + return files; + } + + /// /// 分页获取MP文件列表 /// @@ -72,9 +97,9 @@ public class SysFileService : ISysFileService, IDynamicApiController, ITransient var files = await _sysFileInfoRep.AsQueryable() .WhereIF(input.FileLocation > 0, u => u.FileLocation == input.FileLocation) .Where(u=>u.FileSuffix =="MP4") - .WhereIF(input.FileType == 1,u=> u.CID == 0) - .WhereIF(input.FileType == 2, u => u.CID != 0) - .WhereIF(!UserManager.IsSuperAdmin, u => u.CreatedUserId == UserManager.UserId) + .WhereIF(input.FileType == 1,u=> u.CID == 0 ) + .WhereIF(input.FileType == 2, u => u.CID == input.CID ) + .WhereIF(!UserManager.IsSuperAdmin && input.FileType == 2, u => u.CreatedUserId == UserManager.UserId) .WhereIF(!string.IsNullOrWhiteSpace(input.FileBucket), u => u.FileBucket.Contains(input.FileBucket.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.FileOriginName), u => u.FileOriginName.Contains(input.FileOriginName.Trim())) .Select() diff --git a/GDZZ.Web.Entry/appsettings.json b/GDZZ.Web.Entry/appsettings.json index bd75b94..bd5986d 100644 --- a/GDZZ.Web.Entry/appsettings.json +++ b/GDZZ.Web.Entry/appsettings.json @@ -1,5 +1,5 @@ { - "MaxRequestBodySize": 41943040, //单位是字节(byte) 1kb=1024byte,此处限制40M + "MaxRequestBodySize": 104857600, //单位是字节(byte) 1kb=1024byte,此处限制40M //"Serilog": { // "MinimumLevel": { // "Default": "Information",