Exemplo n.º 1
0
        public BaseRequestResponse <List <ArticleListViewModel> > Get()
        {
            //TODO 调用业务层获取数据库数据
            //此处直接手动写一些数据返回了
            List <ArticleListViewModel> list = new List <ArticleListViewModel> {
                new ArticleListViewModel {
                    Id       = 1,
                    Title    = "文章标题111111111111",
                    ReadNums = 2979
                },
                new ArticleListViewModel {
                    Id       = 2,
                    Title    = "文章标题2222222222222",
                    ReadNums = 8888
                },
                new ArticleListViewModel {
                    Id       = 3,
                    Title    = "文章标题33333333333333",
                    ReadNums = 1791
                }
            };
            BaseRequestResponse <List <ArticleListViewModel> > response
                = new BaseRequestResponse <List <ArticleListViewModel> >
                {
                Code    = ResultCode.NormalCode,
                Result  = list,
                Message = "获取成功"
                };

            return(response);
        }
        public BaseRequestResponse <List <DeliveryAddress> > Get(Guid userGuid)
        {
            //TODO 调用业务层获取数据库数据
            //此处直接手动写一些数据返回了
            IDeliveryAddressService deliveryAddressService = new DeliveryAddressService();
            List <DeliveryAddress>  list = deliveryAddressService.GetAllAsync().Where(m => m.UserGuid == userGuid).ToList();
            BaseRequestResponse <List <DeliveryAddress> > response
                = new BaseRequestResponse <List <DeliveryAddress> >
                {
                Code    = ResultCode.NormalCode,
                Result  = list,
                Message = "获取成功"
                };

            return(response);
        }
Exemplo n.º 3
0
        public async Task <BaseRequestResponse <List <GoodsDTO> > > GetAsync()
        {
            //TODO 调用业务层获取数据库数据
            //此处直接手动写一些数据返回了
            IGoodsManager   goodsManager = new GoodsManager();
            List <GoodsDTO> list         = await goodsManager.GetAllGoods();

            BaseRequestResponse <List <GoodsDTO> > response
                = new BaseRequestResponse <List <GoodsDTO> >
                {
                Code    = ResultCode.NormalCode,
                Result  = list,
                Message = "获取成功"
                };

            return(response);
        }