Ejemplo n.º 1
0
 public FileCrawlerAppService(IFileCrawlerRepository fileCrawlerRepository,
                              FileCrawlerDomainService fileCrawlerDomainService,
                              ParameterCombinationDomainService parameterCombinationDomainService,
                              FileCrawlerRecordDomainService fileCrawlerRecordDomainService)
 {
     FileCrawlerRepository             = fileCrawlerRepository;
     FileCrawlerDomainService          = fileCrawlerDomainService;
     ParameterCombinationDomainService = parameterCombinationDomainService;
     FileCrawlerRecordDomainService    = fileCrawlerRecordDomainService;
 }
Ejemplo n.º 2
0
        public async Task <FileCrawlerDto> CreateAsync(CreateFileCrawlerDto input)
        {
            FileCrawler fileCrawler = ObjectMapper.Map <CreateFileCrawlerDto, FileCrawler>(input);
            await FileCrawlerDomainService.CreateAsync(fileCrawler);

            await FileCrawlerRepository.InsertAsync(fileCrawler);

            await ParameterCombinationDomainService.InsertAsync(fileCrawler);

            return(ObjectMapper.Map <FileCrawler, FileCrawlerDto>(fileCrawler));
        }
Ejemplo n.º 3
0
        public async Task UpdateAsync(Guid id, UpdateFileCrawlerDto input)
        {
            FileCrawler fileCrawler = await FileCrawlerRepository.GetAsync(id);

            if (fileCrawler.Code != input.Code)
            {
                await FileCrawlerDomainService.ChangeCodeAsync(fileCrawler, input.Code);
            }

            fileCrawler.SetName(input.Name);
            fileCrawler.Type            = input.Type;
            fileCrawler.DelaySeconds    = input.DelaySeconds;
            fileCrawler.UrlDateTimeKind = input.UrlDateTimeKind;
            fileCrawler.UrlFormat       = input.UrlFormat;
            fileCrawler.FileNameFormat  = input.FileNameFormat;
            fileCrawler.StampFormat     = input.StampFormat;
            fileCrawler.Periods         = input.Periods;
            fileCrawler.Parameters      = input.Parameters;

            await FileCrawlerRepository.UpdateAsync(fileCrawler);

            await ParameterCombinationDomainService.UpdateAsync(fileCrawler);
        }