public CreateFileInfoCommandHandler(
     IFileInfoRepository fileInfoRepository,
     ILogger <CreateFileInfoCommandHandler> logger)
 {
     _fileInfoRepository = fileInfoRepository ?? throw new ArgumentNullException(nameof(fileInfoRepository));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Пример #2
0
 public FileService(
     IFileInfoRepository fileInfoRepository,
     IFileRepository fileRepository)
 {
     _fileInfoRepository = fileInfoRepository;
     _fileRepository     = fileRepository;
 }
Пример #3
0
 public FileItemService(
     IFileInfoRepository repository,
     ICommandBus commandBus,
     ILogger <FileItemService> logger
     ) : base(repository, commandBus, logger)
 {
 }
Пример #4
0
 public FileService(
     MerchantSettings merchantSettings,
     IFileInfoRepository fileInfoRepository,
     IFileRepository fileRepository)
 {
     _fileRepository     = fileRepository;
     _merchantSettings   = merchantSettings;
     _fileInfoRepository = fileInfoRepository;
 }
Пример #5
0
 public FileInfoStore(
     IFileInfoRepository <FileInfo> fileInfoRepository,
     ILogger <FileInfoStore> logger,
     ICacheManager cacheManager)
 {
     _fileInfoRepository = fileInfoRepository;
     _cacheManager       = cacheManager;
     _logger             = logger;
 }
Пример #6
0
 public FileService(IFileRepository fileRepository,
                    IFileInfoRepository fileInfoRepository,
                    ILogFactory logFactory)
 {
     _fileRepository = fileRepository ??
                       throw new ArgumentNullException(nameof(fileRepository));
     _fileInfoRepository = fileInfoRepository ??
                           throw new ArgumentNullException(nameof(fileInfoRepository));
     _log = logFactory.CreateLog(this);
 }
Пример #7
0
 public StreamingController(
     IFileInfoRepository fileInfoRepository,
     IMediator mediator,
     ILogger <StreamingController> logger,
     IOptionsSnapshot <StreamingSettings> streamingSettings)
 {
     _fileInfoRepository = fileInfoRepository ?? throw new ArgumentNullException(nameof(fileInfoRepository));
     _mediator           = mediator ?? throw new ArgumentNullException(nameof(mediator));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _streamingSettings  = streamingSettings ?? throw new ArgumentNullException(nameof(streamingSettings));
 }
Пример #8
0
        /// <summary>
        /// 按类别清理文件
        /// </summary>
        /// <param name="tag">文件类别</param>
        /// <param name="repository"></param>
        /// <returns></returns>
        private async Task CleanFilesWithTagAsync(FileTag tag, IFileInfoRepository repository)
        {
            List <Domain.AggregatesModel.FileInfoAggregate.FileInfo> notUsedFileInfos;

            switch (tag)
            {
            case FileTag.App:
            case FileTag.AppOriginal:
            case FileTag.AppThumbnail:
                notUsedFileInfos = await repository.GetNotUsedAppImagesAsync(tag);

                break;

            case FileTag.AppVideo:
                notUsedFileInfos = await repository.GetNotUsedAppVideosAsync(tag);

                break;

            case FileTag.Chat:
            case FileTag.ChatThumbnail:
            case FileTag.ChatVideo:
                // 删除早于距当前时间超过任务执行间隔的聊天文件
                var oldestTime = DateTime.UtcNow.AddHours(-_chatCleanSettings.IntervalHours);
                notUsedFileInfos = await repository.GetAllChatFileInfosAsync(oldestTime);

                break;

            default:
                return;
            }

            notUsedFileInfos.ForEach(fi =>
            {
                var delResult = false;

                // 由于聊天文件是统一删除,因此如果类别是聊天中的任意一种,则删除所有聊天文件
                // app内文件按传入类别删除
                if (tag == FileTag.Chat || tag == FileTag.ChatThumbnail || tag == FileTag.ChatVideo)
                {
                    delResult = DeleteFile(fi.Name, FileTag.Chat) && DeleteFile(fi.Name, FileTag.ChatThumbnail) && DeleteFile(fi.Name, FileTag.ChatVideo);
                }
                else
                {
                    delResult = DeleteFile(fi.Name, tag);
                }

                // 如果删除文件成功则删除数据库数据
                if (delResult)
                {
                    repository.Remove(fi);
                }
            });
        }
Пример #9
0
        public FileInfoRepositoryTests()
        {
            RepositoryContext = GetNewContext();
            Repository        = new FileInfoRepository(RepositoryContext, null);

            using (var setupContext = new FileInfoContext(ContextOptions))
            {
                setupContext.RemoveRange(setupContext.FilesInfo.ToList());
                setupContext.Add(_sampleList[0]);
                setupContext.SaveChanges();
            }
        }
Пример #10
0
 public ImageController(IImageRepository imageRepository, IMapper mapper, ITagRepository tagRepository, IImageTagRepository imagetagRepository, IUserRepository userRepository, IContentCollectionRepository contentCollectionRepository, IFileInfoRepository fileInfoRepository,
                        IImageColorRepository imageColorRepository,
                        IColorRepository colorRepository)
 {
     _imageRepository             = imageRepository;
     _mapper                      = mapper;
     _tagRepository               = tagRepository;
     _imagetagRepository          = imagetagRepository;
     _userRepository              = userRepository;
     _contentCollectionRepository = contentCollectionRepository;
     _fileInfoRepository          = fileInfoRepository;
     _imageColorRepository        = imageColorRepository;
     _colorRepository             = colorRepository;
 }
Пример #11
0
 public InvoiceService(
     IInvoiceRepository invoiceRepository,
     IFileInfoRepository fileInfoRepository,
     IFileRepository fileRepository,
     ILykkePayServiceClient lykkePayServiceClient,
     ICallbackUrlFormatter callbackUrlFormatter,
     ILog log)
 {
     _invoiceRepository     = invoiceRepository;
     _fileInfoRepository    = fileInfoRepository;
     _fileRepository        = fileRepository;
     _lykkePayServiceClient = lykkePayServiceClient;
     _callbackUrlFormatter  = callbackUrlFormatter;
     _log = log;
 }
Пример #12
0
 public QuestionController(IExpertQuestion expertQuestionService,
                           IFileInfoRepository fileInfoRepositoryService,
                           IExpertQuestionReply expertQuestionReplyService,
                           IExpertPermission expertPermissionService,
                           IUser userService,
                           INotification notificationService,
                           IUser_Role userRoleRelationService
                           )
 {
     _expertQuestionService      = expertQuestionService;
     _fileInfoRepository         = fileInfoRepositoryService;
     _expertQuestionReplyService = expertQuestionReplyService;
     _expertPermissionService    = expertPermissionService;
     _userService             = userService;
     _notificationService     = notificationService;
     _userRoleRelationService = userRoleRelationService;
 }
Пример #13
0
 public VerificationController(IPermissionProvider permissionManage,
                               IRoleVerification roleVerificationRepository,
                               IAdminUser adminUserRepository,
                               IFarmerVerficationInfoRepository farmerVerificationRepository,
                               IOperatorInfoVerifciationRepository machineryOperatorVerificationRepository,
                               IBusinessVerificationRepository businessVerificationRepository,
                               IArea areaRepository,
                               IFileInfoRepository fileInfoRepository,
                               ISys_Dictionary sysDictionaryRespository,
                               ISuppliers_Sarea suppliers_SareaRespository, IUser user)
     : base(permissionManage, adminUserRepository)
 {
     this.suppliers_SareaRespository              = suppliers_SareaRespository;
     this.roleVerificationRepository              = roleVerificationRepository;
     this.adminUserRepository                     = adminUserRepository;
     this.farmerVerificationRepository            = farmerVerificationRepository;
     this.machineryOperatorVerificationRepository = machineryOperatorVerificationRepository;
     this.businessVerificationRepository          = businessVerificationRepository;
     this.areaRepository           = areaRepository;
     this.fileInfoRepository       = fileInfoRepository;
     this.sysDictionaryRespository = sysDictionaryRespository;
 }