Exemple #1
0
        public async Task <IActionResult> ScrapRepository(string repositorySiteUrl)
        {
            try
            {
                Uri repositoryUri;

                if (Uri.TryCreate(repositorySiteUrl, UriKind.Absolute, out repositoryUri))
                {
                    var scrapService = new ScrapService(repositoryUri);

                    var result = await scrapService.CollectData();

                    return(new OkObjectResult(result));
                }
                else
                {
                    throw new ScrapException("MSG_0001");
                }
            }
            catch (ScrapException ex)
            {
                return(new NotFoundObjectResult(JsonConvert.SerializeObject(new ExceptionModel(ex))));
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
                Log.Error(ex.StackTrace);
                return(new BadRequestObjectResult("Internal Server Error."));
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            ScrapService scrapService = new ScrapService();

            scrapService.scrapReadDC();
            Console.WriteLine("Hello World!");
        }
Exemple #3
0
        public async Task CollectDataTesteSuccess()
        {
            var uriSite = new Uri("https://github.com/pixijs/pixi.js");
            var service = new ScrapService(uriSite);

            var result = await service.CollectData();

            Assert.True(result.Any());
        }
 public CustomsReportController(ScrapService scrapService, WIPService wipService, FactBeacukaiService factBeacukaiService, FactItemMutationService factItemMutationService, FinishedGoodService finishedGoodService, MachineMutationService machineMutationService)
 {
     this.scrapService            = scrapService;
     this.factBeacukaiService     = factBeacukaiService;
     this.factItemMutationService = factItemMutationService;
     this.wipService             = wipService;
     this.finishedGoodService    = finishedGoodService;
     this.machineMutationService = machineMutationService;
 }
Exemple #5
0
        static void Main(string[] args)
        {
            Config.LoadConfig();
            MegaApiClient mega = new MegaApiClient();

            mega.LoginAnonymous();
            ScrapService scrapService = new ScrapService(mega);

            scrapService.CheckHealth();
        }
Exemple #6
0
 public CustomsReportController(ScrapService scrapService, WIPService wipService, FactBeacukaiService factBeacukaiService, FactItemMutationService factItemMutationService, FinishedGoodService finishedGoodService, MachineMutationService machineMutationService, HOrderService hOrderService, ExpenditureGoodsService expenditureGoodsService, TraceableInService traceableInService, TraceableOutService traceableOutService)
 {
     this.scrapService            = scrapService;
     this.factBeacukaiService     = factBeacukaiService;
     this.factItemMutationService = factItemMutationService;
     this.wipService              = wipService;
     this.finishedGoodService     = finishedGoodService;
     this.machineMutationService  = machineMutationService;
     this.hOrderService           = hOrderService;
     this.expenditureGoodsService = expenditureGoodsService;
     this.traceableInService      = traceableInService;
     this.traceableOutService     = traceableOutService;
 }