예제 #1
0
 public RouteService(ISolarSystemService solarSystemService,
                     EveVoidContext context,
                     ILogger <RouteService> logger)
 {
     _solarSystemService = solarSystemService;
     _context            = context;
     _logger             = logger;
 }
예제 #2
0
 public SignatureService(EveVoidContext context,
                         ISolarSystemService solarSystemService,
                         IRouteService routeService)
 {
     _context            = context;
     _solarSystemService = solarSystemService;
     _routeService       = routeService;
 }
예제 #3
0
 public MapController(ISolarSystemService solarSystemService,
                      ICharacterService characterService,
                      IMapper mapper)
 {
     _solarSystemService = solarSystemService;
     _characterService   = characterService;
     _mapper             = mapper;
 }
예제 #4
0
 public SolarSystemController(ISolarSystemService solarSystemService,
                              ICharacterService characterService,
                              IMapper mapper,
                              ISignatureService signatureService)
 {
     _solarSystemService = solarSystemService;
     _characterService   = characterService;
     _mapper             = mapper;
     _signatureService   = signatureService;
 }
        public SolarSystemQueries(ISolarSystemService solarSystemService)
        {
            FieldAsync <ListSolarSystemsQueryModelType>(
                SEARCH_REQUEST_ENDPOINT,
                "Returns a paginated list of SolarSystems",
                new QueryArguments(
                    new QueryArgument <NonNullGraphType <PagedRequestType> > {
                Name = PAGINATION_ARGUMENT_NAME, Description = PagedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <OrderedRequestType> > {
                Name = ORDERING_ARGUMENT_NAME, Description = OrderedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <FilteredRequestType <SolarSystem> > > {
                Name = FILTERING_ARGUMENT_NAME, Description = FilteredRequestType <SolarSystem> .Description
            }
                    ),
                async context =>
            {
                var pagination = context.GetArgument <Pagination>(PAGINATION_ARGUMENT_NAME);
                var ordering   = context.GetArgument <Ordering>(ORDERING_ARGUMENT_NAME);
                var filtering  = context.GetArgument <SolarSystemFilter>(FILTERING_ARGUMENT_NAME);

                var(totalCount, items) = await solarSystemService.SearchSolarSystemAsync(pagination, ordering, filtering);
                try
                {
                    return(new ListResponse <SolarSystem>
                    {
                        TotalCount = totalCount,
                        Items = items
                    });
                }
                catch (Exception e)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(null);
                }
            }
                );
        }
예제 #6
0
 public CharacterService(EveVoidContext context,
                         ICorporationService corporationService,
                         ILocationApi locationApi,
                         ICharacterApi characterApi,
                         ITokenService tokenService,
                         ISolarSystemService solarSystemService,
                         IItemTypeService itemTypeService,
                         ISignatureService signatureService,
                         IStargateService stargateService,
                         IRouteService routeService,
                         IPilotService pilotService)
 {
     _context            = context;
     _corporationService = corporationService;
     _locationApi        = locationApi;
     _characterApi       = characterApi;
     _tokenService       = tokenService;
     _solarSystemService = solarSystemService;
     _itemTypeService    = itemTypeService;
     _signatureService   = signatureService;
     _stargateService    = stargateService;
     _routeService       = routeService;
     _pilotService       = pilotService;
 }
예제 #7
0
 public SolarSystemNoteService(EveVoidContext context, ISolarSystemService solarSystemService)
 {
     _context            = context;
     _solarSystemService = solarSystemService;
 }
예제 #8
0
 public RunPlanetSimulationJob(ISolarSystemService solarSystemService)
 {
     this.solarSystemService = solarSystemService;
 }
 public WeatherForecastController(ISolarSystemService solarSystemService)
 {
     this.solarSystemService = solarSystemService;
 }
예제 #10
0
 public SolarSystemsController(ISolarSystemService service, ILogger <SolarSystemsController> logger)
 {
     _service = service;
     _logger  = logger;
 }
        public SolarSystemMutations(ISolarSystemService service)
        {
            FieldAsync <ActionResponseType>(
                CREATE_REQUEST_ENDPOINT,
                "Creates a new SolarSystem",
                new QueryArguments(
                    new QueryArgument <NonNullGraphType <SolarSystemCreateViewModel> > {
                Name = SOLAR_SYSTEM_ARGUMENT_NAME, Description = "SolarSystem Entity to be Created"
            }
                    ),
                async context =>
            {
                var solarSystem = context.GetArgument <SolarSystem>(SOLAR_SYSTEM_ARGUMENT_NAME);

                try
                {
                    await service.CreateSolarSystemAsync(solarSystem);
                }
                catch (ValidationException e)
                {
                    context.Errors.Add(new ExecutionError(e.Message));
                    return(new ActionResponse(false));
                }
                catch (Exception)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(new ActionResponse(false));
                }

                return(new ActionResponse(true, solarSystem.Id));
            });

            FieldAsync <ActionResponseType>(
                UPDATE_REQUEST_ENDPOINT,
                "Updates an existing SolarSystem",
                new QueryArguments(
                    new QueryArgument <NonNullGraphType <SolarSystemUpdateViewModel> >
            {
                Name = SOLAR_SYSTEM_ARGUMENT_NAME, Description = "SolarSystem to be Updated"
            }),
                async context =>
            {
                var solarSystem = context.GetArgument <SolarSystem>(SOLAR_SYSTEM_ARGUMENT_NAME);
                try
                {
                    await service.UpdateSolarSystemAsync(solarSystem);
                }
                catch (ValidationException e)
                {
                    context.Errors.Add(new ExecutionError(e.Message));
                    return(new ActionResponse(false));
                }
                catch (Exception)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(new ActionResponse(false));
                }

                return(new ActionResponse(true, solarSystem.Id));
            });

            FieldAsync <ActionResponseType>(
                DELETE_REQUEST_ENDPOINT,
                "Removes an existing SolarSystem",
                new QueryArguments(
                    new QueryArgument <GuidGraphType>
            {
                Name = DELETE_ARGUMENT_NAME, Description = "SolarSystem Id used to identify which SolarSystem will be deleted"
            }),
                async context =>
            {
                var id = context.GetArgument <Guid>(DELETE_ARGUMENT_NAME);
                try
                {
                    await service.DeleteSolarSystemAsync(id);
                }
                catch (ValidationException e)
                {
                    context.Errors.Add(new ExecutionError(e.Message));
                    return(new ActionResponse(false));
                }
                catch (Exception)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(new ActionResponse(false));
                }

                return(new ActionResponse(true));
            });
        }