コード例 #1
0
        public async Task Recover(
            DeveloperUser user,
            DeveloperApp appInDb,
            CoreApiService coreApiService,
            AppsContainer appsContainer,
            SitesService sitesService,
            EventService eventService,
            ChannelService channelService,
            RecordsService recordsService,
            int pageNumber)
        {
            RootRecover(user);
            var token = await appsContainer.AccessToken(appInDb.AppId, appInDb.AppSecret);

            Grants = await coreApiService.AllUserGrantedAsync(token, pageNumber, 15);

            var sites = await sitesService.ViewMySitesAsync(token);

            Sites = sites.Sites;

            var errorLogs = await eventService.ViewAsync(token);

            ErrorLogs = errorLogs.Logs;

            var channels = await channelService.ViewMyChannelsAsync(token);

            Channels = channels.Channels;

            var records = await recordsService.ViewMyRecordsAsync(token, Array.Empty <string>());

            Records = records.Records;

            Trusted = appInDb.TrustedApp;
        }
コード例 #2
0
ファイル: ViewAppViewModel.cs プロジェクト: wangyaoDgit/Nexus
        public async Task Recover(
            DeveloperUser user,
            App thisApp,
            CoreApiService coreApiService,
            AppsContainer appsContainer,
            SitesService sitesService,
            EventService eventService,
            ChannelService channelService,
            int pageNumber)
        {
            RootRecover(user);
            var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret);

            Grants = await coreApiService.AllUserGrantedAsync(token, pageNumber, 15);

            var sites = await sitesService.ViewMySitesAsync(token);

            Sites = sites.Sites;

            var errorLogs = await eventService.ViewAsync(token);

            ErrorLogs = errorLogs.Logs;

            var channels = await channelService.ViewMyChannelsAsync(token);

            Channels = channels.Channels;
        }
        public async Task <IActionResult> Index()
        {
            var user = await GetCurrentUserAsync();

            var sites = await _sitesService.ViewMySitesAsync(await accesstoken);

            if (string.IsNullOrEmpty(user.SiteName) || !sites.Sites.Any(t => t.SiteName == user.SiteName))
            {
                return(RedirectToAction(nameof(CreateSite)));
            }
            var model = new IndexViewModel(user)
            {
                SiteName = user.SiteName
            };

            return(View(model));
        }
コード例 #4
0
        public async Task Recover(
            DeveloperUser user,
            App thisApp,
            CoreApiService coreApiService,
            OSSApiService ossApiService,
            AppsContainer appsContainer,
            SitesService sitesService)
        {
            base.RootRecover(user, 1);
            var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret);

            var buckets = await ossApiService.ViewMyBucketsAsync(token);

            Buckets = buckets.Buckets;

            var grants = await coreApiService.AllUserGrantedAsync(token);

            Grants = grants.Grants;

            var sites = await sitesService.ViewMySitesAsync(token);

            Sites = sites.Sites;
        }
コード例 #5
0
        public async Task Recover(
            DeveloperUser user,
            App thisApp,
            CoreApiService coreApiService,
            AppsContainer appsContainer,
            SitesService sitesService,
            EventService eventService)
        {
            RootRecover(user);
            var token = await appsContainer.AccessToken(thisApp.AppId, thisApp.AppSecret);


            var grants = await coreApiService.AllUserGrantedAsync(token);

            Grants = grants.Grants;

            var sites = await sitesService.ViewMySitesAsync(token);

            Sites = sites.Sites;

            var errorLogs = await eventService.ViewAsync(token);

            ErrorLogs = errorLogs.Logs;
        }