예제 #1
0
파일: Program.cs 프로젝트: kpocza/thriot
        static void Main(string[] args)
        {
            SettingReolver.Instance.Initialize(args);

            var localConnectionParametersResolver = new LocalConnectionParametersResolver();

            var management            = new AzureCloudStorageClientFactory(localConnectionParametersResolver);
            var tableEntityOperations = management.GetTableEntityOperation();

            tableEntityOperations.EnsureTable("LoginUser");;
            tableEntityOperations.EnsureTable("User");
            tableEntityOperations.EnsureTable("Company");
            tableEntityOperations.EnsureTable("Service");
            tableEntityOperations.EnsureTable("Network");
            tableEntityOperations.EnsureTable("Device");
            tableEntityOperations.EnsureTable("Setting");

            var settingRepository = new GenericRepository <SettingTableEntity>(tableEntityOperations, "Setting");

            CreateSettingIfNotExist(settingRepository, Setting.ServiceProfile, "runtime.serviceprofile", ServiceProfile.ServiceProvider.ToString());
            CreateSettingIfNotExist(settingRepository, Setting.EmailActivation, "runtime.emailactivation", "false");
            CreateSettingIfNotExist(settingRepository, Setting.TelemetrySetupServiceEndpoint, "microservice.telemetrysetupserviceendpoint", "http://localhost:8001/v1/telemetryDataSinkSetup");
            CreateSettingIfNotExist(settingRepository, Setting.TelemetrySetupServiceApiKey, null, Crypto.GenerateSafeRandomToken());
            CreateSettingIfNotExist(settingRepository, Setting.MessagingServiceEndpoint, "microservice.messagingserviceendpoint", "http://localhost:8003/v1/messaging");
            CreateSettingIfNotExist(settingRepository, Setting.MessagingServiceApiKey, null, Crypto.GenerateSafeRandomToken());
            CreateSettingIfNotExist(settingRepository, SettingId.GetConnection("TelemetryConnection"), "telemetry.connection", "UseDevelopmentStorage=true");
            CreateSettingIfNotExist(settingRepository, Setting.WebsiteUrl, "publicurl.web", "http://localhost:7999");
            CreateSettingIfNotExist(settingRepository, Setting.ManagementApiUrl, "publicurl.managementapi", "http://localhost:8000/v1");
            CreateSettingIfNotExist(settingRepository, Setting.PlatformApiUrl, "publicurl.platformapi", "http://localhost:8001/v1");
            CreateSettingIfNotExist(settingRepository, Setting.PlatformWsUrl, "publicurl.platformwebsocket", "ws://localhost:8080");
            CreateSettingIfNotExist(settingRepository, Setting.ReportingApiUrl, "publicurl.reportingapi", "http://localhost:8002/v1");

            CreateOrUpdateSetting(settingRepository, new SettingId("Version", "Database"), "1");
        }
예제 #2
0
        public ICloudStorageClientFactory GetCloudStorageClientFactory()
        {
            var cloudStorageClientFactory = new AzureCloudStorageClientFactory(new DevAzureConnectionParametersResolver());

            EnsureTables(cloudStorageClientFactory.GetTableEntityOperation());

            return(cloudStorageClientFactory);
        }