Esempio n. 1
0
        public ExpressAddressesResponse ExpressAddresses()
        {
            var currentAccount = _contextService.GetCurrentAccount(HttpContext);
            //用户登录成功就可用通过token 初始化_user 对象 ,代表当前登录用户

            //应该从缓存中获取用户的地址信息
            var addresses = _userQueryService.GetExpressAddresses(currentAccount.UserId.ToGuid());

            return(new ExpressAddressesResponse
            {
                ExpressAddresses = addresses.Select(x => new ApiResponse.ExpressAddress
                {
                    Id = x.Id,
                    Name = x.Name,
                    Mobile = x.Mobile,
                    Address = x.Address,
                    Region = x.Region,
                    Zip = x.Zip
                }).ToList()
            });
        }