コード例 #1
0
 public WebWorkContext(IHttpContextAccessor httpContextAccessor,
                       IGrandAuthenticationService authenticationService,
                       IApiAuthenticationService apiauthenticationService,
                       ICurrencyService currencyService,
                       ICustomerService customerService,
                       IGenericAttributeService genericAttributeService,
                       ILanguageService languageService,
                       IStoreContext storeContext,
                       IStoreMappingService storeMappingService,
                       IVendorService vendorService,
                       LocalizationSettings localizationSettings,
                       TaxSettings taxSettings,
                       GrandConfig config)
 {
     _httpContextAccessor      = httpContextAccessor;
     _authenticationService    = authenticationService;
     _apiauthenticationService = apiauthenticationService;
     _currencyService          = currencyService;
     _customerService          = customerService;
     _genericAttributeService  = genericAttributeService;
     _languageService          = languageService;
     _storeContext             = storeContext;
     _storeMappingService      = storeMappingService;
     _vendorService            = vendorService;
     _localizationSettings     = localizationSettings;
     _taxSettings = taxSettings;
     _config      = config;
 }
コード例 #2
0
 public WebWorkContext(IHttpContextAccessor httpContextAccessor,
                       IGrandAuthenticationService authenticationService,
                       IApiAuthenticationService apiauthenticationService,
                       ICurrencyService currencyService,
                       ICustomerService customerService,
                       IGenericAttributeService genericAttributeService,
                       ILanguageService languageService,
                       IStoreContext storeContext,
                       IStoreMappingService storeMappingService,
                       IUserAgentHelper userAgentHelper,
                       IVendorService vendorService,
                       LocalizationSettings localizationSettings,
                       TaxSettings taxSettings)
 {
     this._httpContextAccessor      = httpContextAccessor;
     this._authenticationService    = authenticationService;
     this._apiauthenticationService = apiauthenticationService;
     this._currencyService          = currencyService;
     this._customerService          = customerService;
     this._genericAttributeService  = genericAttributeService;
     this._languageService          = languageService;
     this._storeContext             = storeContext;
     this._storeMappingService      = storeMappingService;
     this._userAgentHelper          = userAgentHelper;
     this._vendorService            = vendorService;
     this._localizationSettings     = localizationSettings;
     this._taxSettings = taxSettings;
 }
コード例 #3
0
 public WorkContext(
     IHttpContextAccessor httpContextAccessor,
     IGrandAuthenticationService authenticationService,
     IApiAuthenticationService apiauthenticationService,
     ICurrencyService currencyService,
     ICustomerService customerService,
     IGroupService groupService,
     IUserFieldService userFieldService,
     ILanguageService languageService,
     IStoreHelper storeHelper,
     IAclService aclService,
     IVendorService vendorService,
     IDetectionService detectionService,
     LanguageSettings languageSettings,
     TaxSettings taxSettings,
     AppConfig config)
 {
     _httpContextAccessor      = httpContextAccessor;
     _authenticationService    = authenticationService;
     _apiauthenticationService = apiauthenticationService;
     _currencyService          = currencyService;
     _customerService          = customerService;
     _groupService             = groupService;
     _userFieldService         = userFieldService;
     _languageService          = languageService;
     _storeHelper      = storeHelper;
     _aclService       = aclService;
     _vendorService    = vendorService;
     _detectionService = detectionService;
     _languageSettings = languageSettings;
     _taxSettings      = taxSettings;
     _config           = config;
 }
コード例 #4
0
 public void Init()
 {
     _httpContextAccessorMoc = new Mock <IHttpContextAccessor>();
     _customerService        = new Mock <ICustomerService>();
     _userApiServiceMock     = new Mock <IUserApiService>();
     _httpContextMock        = new Mock <HttpContext>();
     _authService            = new ApiAuthenticationService(_httpContextAccessorMoc.Object, _customerService.Object, _userApiServiceMock.Object);
 }
コード例 #5
0
 public UserController(IAuthenticationService authenticationService, IMessageQueueService messageQueueService, IProjectService projectService, IUserService userService, IWebHelper webHelper, IWorkContext workContext, IApiAuthenticationService apiAuthenticationService)
 {
     _authenticationService = authenticationService;
     _apiAuthenticationService = apiAuthenticationService;
     _messageQueueService = messageQueueService;
     _projectService = projectService;
     _userService = userService;
     _webHelper = webHelper;
     _workContext = workContext;
 }
コード例 #6
0
 public AuthenticationController(
     IApiAuthenticationService authenticationService,
     IMapper mapper,
     ILogger <AuthenticationController> logger
     )
 {
     _logger = logger;
     _mapper = mapper;
     _authenticationService = authenticationService;
 }
コード例 #7
0
        static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile($"appsettings.json");

            _configuration = builder.Build();

            var rabbitMQConfigurations = new RabbitMQConfigurations();

            LoadRabbitMQConfig(rabbitMQConfigurations);

            var botConfiguration = new BotConfiguration();

            LoadBotConfig(botConfiguration);

            _chatApiServiceClient     = new ChatApiServiceClient(botConfiguration);
            _apiAuthenticationService = new ApiAuthenticationService(botConfiguration);

            var user = new UserLogin {
                Email = botConfiguration.User, Password = botConfiguration.Password
            };
            var userToken = _apiAuthenticationService.Login().Result;
            ConnectionFactory connectionFactory = GetConnectionFactory(rabbitMQConfigurations);

            using var connection = connectionFactory.CreateConnection();
            using var channel    = connection.CreateModel();
            channel.QueueDeclare(
                queue: "tests",
                durable: false,
                exclusive: false,
                autoDelete: false,
                arguments: null);

            var consumer = new EventingBasicConsumer(channel);

            consumer.Received += (sender, eventArgs) =>
            {
                var body    = eventArgs.Body.Span;
                var message = Encoding.UTF8.GetString(body);

                Console.WriteLine(Environment.NewLine + "[New message received] " + message);


                var options = new JsonSerializerOptions
                {
                    PropertyNameCaseInsensitive = true
                };
                Post post = DeserializeObject(message, options);

                if (post.IsInvalidCommand())
                {
                    var result = _chatApiServiceClient.SendMessage(new PostCreateRequest {
                        Message = $"{post.User} you must enter a Symbol to use the command, like /stock=xp.us"
                    }, userToken).Result;
                }

                else if (post.IsCommand())
                {
                    IStockService service   = new StockService();
                    var           stockCode = post.GetStockFromCommand();

                    var stockInfo = service.GetStock(stockCode).Result;

                    var msg_ = stockInfo.GetStockQuoteFormatted();

                    var result = _chatApiServiceClient.SendMessage(new PostCreateRequest {
                        Message = msg_
                    }, userToken).Result;
                }

                channel.BasicAck(deliveryTag: eventArgs.DeliveryTag, multiple: false);
            };

            channel.BasicConsume(queue: "tests",
                                 autoAck: false,
                                 consumer: consumer);

            Console.WriteLine("Waiting messages to proccess");
            Console.WriteLine("Press some key to exit...");
            Console.ReadKey();
        }
コード例 #8
0
 public ProtectedApiBearerTokenHandler(IApiAuthenticationService authServerConnect)
 {
     _authServerConnect = authServerConnect;
 }
コード例 #9
0
 public AccountController(IUserStore<IdentityUser, long> store, IApiAuthenticationService authenticationService)
 {
     _userManager = new UserManager<IdentityUser, long>(store);
     _authenticationService = authenticationService;
 }
コード例 #10
0
 public AuthorizeAccessTokenAttribute()
 {
     var container = UnityConfig.GetConfiguredContainer();
     _authenticationService = container.Resolve<IApiAuthenticationService>();
 }
コード例 #11
0
 public ProjectController(IProjectService projectService, ILocationService locationService, IApiAuthenticationService apiAuthenticationService)
 {
     _projectService = projectService;
     _locationService = locationService;
     _apiAuthenticationService = apiAuthenticationService;
 }
コード例 #12
0
 public MqttBrokerPlugin(ILoggerFactory loggerFactory, IApiAuthenticationService apiAuthenticationService)
 {
     _log = loggerFactory.CreateLogger <MqttBrokerPlugin>();
     _apiAuthenticationService = apiAuthenticationService;
 }