示例#1
0
 public async Task RunAsync()
 {
     var output = await _profileAppService.GetAsync();
     Console.WriteLine($"UserName : {output.UserName}");
     Console.WriteLine($"Email    : {output.Email}");
     Console.WriteLine($"Name     : {output.Name}");
     Console.WriteLine($"Surname  : {output.Surname}");
 }
        public async Task RunAsync()
        {
            var output = await _profileAppService.GetAsync();

            Console.WriteLine($"UserName : {output.UserName}");
            Console.WriteLine($"Email    : {output.Email}");
            Console.WriteLine($"Name     : {output.Name}");
            Console.WriteLine($"Surname  : {output.Surname}");
            var value = _andonService.GetAndonAsync("1", "1", "1");

            Console.WriteLine(JsonConvert.SerializeObject(value));
        }
示例#3
0
    public async Task GetAsync()
    {
        //Arrange
        _currentUser.Id.Returns(_testData.UserJohnId);
        _currentUser.IsAuthenticated.Returns(true);

        //Act
        var result = await _profileAppService.GetAsync();

        //Assert
        var johnNash = GetUser("john.nash");

        result.UserName.ShouldBe(johnNash.UserName);
        result.Email.ShouldBe(johnNash.Email);
        result.PhoneNumber.ShouldBe(johnNash.PhoneNumber);
    }
示例#4
0
        public async Task <IActionResult> Info()
        {
            var profile = await _profileAppService.GetAsync();

            //var user = await _userAppService.GetAsync(CurrentUser.GetId());
            var roles = await _userAppService.GetRolesAsync(CurrentUser.GetId());

            var auth = await GetAuthConfigAsync();

            var data = new Dictionary <string, object>(3);

            data.Add("profile", profile);
            data.Add("roles", roles.Items);
            data.Add("auth", auth);

            return(Json(new { code = 1, data = data }));
        }
示例#5
0
        public async Task RunAsync()
        {
            var profileDto = await _profileAppService.GetAsync();

            Console.WriteLine($"UserName : {profileDto.UserName}");
            Console.WriteLine($"Email    : {profileDto.Email}");
            Console.WriteLine($"Name     : {profileDto.Name}");
            Console.WriteLine($"Surname  : {profileDto.Surname}");
            Console.WriteLine();

            var resultDto = await _identityUserAppService.GetListAsync(new GetIdentityUsersInput());

            Console.WriteLine($"Total users: {resultDto.TotalCount}");
            foreach (var identityUserDto in resultDto.Items)
            {
                Console.WriteLine($"- [{identityUserDto.Id}] {identityUserDto.Name}");
            }
        }
示例#6
0
        public async Task RunAsync()
        {
            var output = await _profileAppService.GetAsync();

            Console.WriteLine($"UserName : {output.UserName}");
            Console.WriteLine($"Email    : {output.Email}");
            Console.WriteLine($"Name     : {output.Name}");
            Console.WriteLine($"Surname  : {output.Surname}");

            await _demoAppService.AccessWithDefaultPasswordAuthAsync();

            // await _demoAppService.AccessWithClientAuthAsync();// will throw

            using (PluzIdentityClientSwitcher.Use("client"))
            {
                await _demoAppService.AccessWithClientAuthAsync();// will not throw
            }
        }
        public async Task RunAsync()
        {
            var output = await _profileAppService.GetAsync();

            Console.WriteLine($"UserName : {output.UserName}");
            Console.WriteLine($"Email    : {output.Email}");
            Console.WriteLine($"Name     : {output.Name}");
            Console.WriteLine($"Surname  : {output.Surname}");

            var id            = Guid.NewGuid();
            var remoteContent = new RemoteStreamContent(new MemoryStream(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }))
            {
                ContentType = "application/octet-stream"
            };
            await _testAppService.Upload(remoteContent, id);

            var dl = await _testAppService.Download(id);

            var ms = new MemoryStream();
            await dl.GetStream().CopyToAsync(ms);
        }
示例#8
0
        public async Task OnGetAsync()
        {
            var user = await _profileAppService.GetAsync();

            PersonalSettingsInfoModel = ObjectMapper.Map <ProfileDto, PersonalSettingsInfoModel>(user);
        }
 public Task <ProfileDto> GetAsync()
 {
     return(_profileAppService.GetAsync());
 }
示例#10
0
 /// <summary>
 /// 获取基本信息
 /// </summary>
 /// <returns>Task&lt;ProfileDto&gt;.</returns>
 public virtual Task <ProfileDto> Get()
 {
     return(_appService.GetAsync());
 }