Exemple #1
0
        public ApiResult <List <BillResModel> > GetBill(BillReqModel req)
        {
            //查询开始时间和结束时间必须30天内
            if (req == null || req.StartTime >= req.EndTime || (req.EndTime - req.StartTime).TotalDays > 30)
            {
                return(Error <List <BillResModel> >(ApiResultCode.BadRequest));
            }
            var data   = BillBLL.GetBill(req.Member, req.Type, req.StartTime, req.EndTime);
            var result = data.Select(s =>
            {
                var temp    = new BillResModel();
                temp.Id     = s.Id;
                temp.Member = s.member;
                return(temp);
            }).ToList();

            return(Success(result));
        }
Exemple #2
0
        /// <summary>
        /// 测试请求api用
        /// </summary>
        /// <returns></returns>
        public async Task <ApiResult <List <BillResModel> > > GetBillService(BillReqModel model)
        {
            string url = GenerateUrl(ApiUrl.APIURL);

            return(await SendRequest <ApiResult <List <BillResModel> > >(url, HttpMethod.Post, model));
        }