Пример #1
0
        /// <summary>
        /// 获取商品详情
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        public async Task <ProductDetailRD> GetProductDetail(string productId)
        {
            string          url             = "/goods/productDet?productId=" + productId;
            ProductDetailRD productDetailRD = await RestSharpHelper <ProductDetailRD> .GetAsync(url);

            return(productDetailRD);
        }
Пример #2
0
        /// <summary>
        /// 获取收藏商品列表
        /// </summary>
        /// <returns></returns>
        public async Task <ProductListRD> GetCollections()
        {
            string url = "/goods/GetCollection?userId=" + GlobalVariables.LoggedUser.id;

            ProductListRD productListRD = await RestSharpHelper <ProductListRD> .GetAsync(url);

            return(productListRD);
        }
Пример #3
0
        /// <summary>
        /// 发送验证码 ok
        /// </summary>
        /// <param name="tel">手机号</param>
        /// <returns></returns>
        public async Task <SimpleRD> SendAuthCode(string tel)
        {
            string url = "/member/getAuthCode?tel=" + tel;

            SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .GetAsync(url);

            return(simpleRD);
        }
Пример #4
0
        /// <summary>
        /// 取消收藏商品
        /// </summary>
        /// <returns></returns>
        public async Task <StupidRD> DeleteCollection(string productId)
        {
            string url = string.Format("/goods/deleteCollection?userId={0}&productId={1}", GlobalVariables.LoggedUser.id, productId);

            StupidRD stupidRD = await RestSharpHelper <StupidRD> .GetAsync(url);

            return(stupidRD);
        }
Пример #5
0
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task <StupidRD> DeleteOrder(string orderId)
        {
            string url = "/member/delOrder?orderId=" + orderId;

            StupidRD stupidRD = await RestSharpHelper <StupidRD> .GetAsync(url);

            return(stupidRD);
        }
Пример #6
0
        /// <summary>
        /// 获取首页相关内容信息
        /// </summary>
        /// <returns></returns>
        public async Task <HomeContentRD> GetHomeContent()
        {
            string url = "/goods/home";

            HomeContentRD homeContentRD = await RestSharpHelper <HomeContentRD> .GetAsync(url);

            return(homeContentRD);
        }
Пример #7
0
        /// <summary>
        /// 获取分类列表
        /// </summary>
        /// <returns></returns>
        public async Task <CategoryRD> GetCategories()
        {
            string url = "/goods/SearchAllItemCat";

            CategoryRD categoryRD = await RestSharpHelper <CategoryRD> .GetAsync(url);

            return(categoryRD);
        }
Пример #8
0
        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <param name="tel"></param>
        /// <returns></returns>
        public async Task <CustomerListRD> GetCustomers(string tel)
        {
            string url = "/member/getClient?phone=" + tel;

            CustomerListRD customerListRD = await RestSharpHelper <CustomerListRD> .GetAsync(url);

            return(customerListRD);
        }
Пример #9
0
        /// <summary>
        /// 根据用户id获取订单列表
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task <OrderListRD> GetOrderListById(int userId, int page, int size)
        {
            string url = "/member/orderList?userId=" + userId.ToString()
                         + "&page=" + page.ToString()
                         + "&size=" + size.ToString();

            OrderListRD orderListRD = await RestSharpHelper <OrderListRD> .GetAsync(url);

            return(orderListRD);
        }
Пример #10
0
        /// <summary>
        /// 获取商品列表
        /// </summary>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <param name="sort"></param>
        /// <param name="cid"></param>
        /// <param name="priceGt"></param>
        /// <param name="priceLte"></param>
        /// <returns></returns>
        public async Task <ProductListRD> GetProductList(int page, int size, string sort, long cid, int priceGt, int priceLte)
        {
            string url = "/goods/allGoods?page=" + page.ToString()
                         + "&size=" + size.ToString()
                         + "&sort=" + sort
                         + "&cid=" + cid.ToString()
                         + "&priceGt=" + priceGt.ToString()
                         + "&priceLte=" + priceLte.ToString();

            ProductListRD productListRD = await RestSharpHelper <ProductListRD> .GetAsync(url);

            return(productListRD);
        }
Пример #11
0
        /// <summary>
        /// 模糊搜索
        /// </summary>
        /// <param name="index"></param>
        /// <param name="sequence"></param>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <param name="sort"></param>
        /// <param name="priceGt"></param>
        /// <param name="priceLte"></param>
        /// <returns></returns>
        public async Task <ProductListRD> FuzzySearch(string index, int sequence, int page, int size, string sort, int priceGt, int priceLte)
        {
            string url = "/goods/SearchLike?page=" + page.ToString()
                         + "&index=" + index
                         + "&size=" + size.ToString()
                         + "&sort=" + sort
                         + "&sequence=" + sequence.ToString()
                         + "&priceGt=" + priceGt.ToString()
                         + "&priceLte=" + priceLte.ToString();

            ProductListRD productListRD = await RestSharpHelper <ProductListRD> .GetAsync(url);

            return(productListRD);
        }
Пример #12
0
        /// <summary>
        /// 获取分类列表
        /// </summary>
        /// <returns></returns>
        public static async Task <CategoryRD> GetCategories()
        {
            try
            {
                string url = "/goods/SearchAllItemCat";

                CategoryRD categoryRD = await RestSharpHelper <CategoryRD> .GetAsync(url);

                return(categoryRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #13
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        public static async Task <LoginRD> GetUserInfo()
        {
            try
            {
                string url = "/member/getMemberInfo?id=" + GlobalVariables.LoggedUser.id;

                LoginRD loginRD = await RestSharpHelper <LoginRD> .GetAsync(url);

                return(loginRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #14
0
        //private static readonly Lazy<RestSharpService> lazy = new Lazy<RestSharpService>(() => new RestSharpService());
        //
        //public static RestSharpService Instance { get { return lazy.Value; } }
        //
        //private RestSharpService()
        //{
        //
        //}

        #region 会员注册登录
        /// <summary>
        /// 发送验证码 ok
        /// </summary>
        /// <param name="tel">手机号</param>
        /// <returns></returns>
        public static async Task <SimpleRD> SendAuthCode(string tel)
        {
            try
            {
                string url = "/member/getAuthCode?tel=" + tel;

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .GetAsync(url);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #15
0
        public static async Task <RebateRD> GetAllRebate(string designerId)
        {
            try
            {
                string url = "/member/getAllRebate?designerId=" + designerId;

                RebateRD rebateRD = await RestSharpHelper <RebateRD> .GetAsync(url);

                return(rebateRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #16
0
        /// <summary>
        /// 验证验证码
        /// </summary>
        /// <param name="tel"></param>
        /// <param name="authCode"></param>
        /// <returns></returns>
        public static async Task <SimpleRD> CheckAuthCode(string tel, string authCode)
        {
            try
            {
                string url = "/member/checkAuthCode?tel=" + tel + "&authcode=" + authCode;

                SimpleRD simpleRD = await RestSharpHelper <SimpleRD> .GetAsync(url);

                return(simpleRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #17
0
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public static async Task <StupidRD> DeleteOrder(string orderId)
        {
            try
            {
                string url = "/member/delOrder?orderId=" + orderId;

                StupidRD stupidRD = await RestSharpHelper <StupidRD> .GetAsync(url);

                return(stupidRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #18
0
        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <param name="tel"></param>
        /// <returns></returns>
        public static async Task <CustomerListRD> GetCustomers(string tel)
        {
            try
            {
                string url = "/member/getClient?phone=" + tel;

                CustomerListRD customerListRD = await RestSharpHelper <CustomerListRD> .GetAsync(url);

                return(customerListRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #19
0
        /// <summary>
        /// 添加收藏
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        public static async Task <StupidRD> AddToCollection(string productId)
        {
            try
            {
                string url = string.Format("/goods/AddCollection?userId={0}&productId={1}", GlobalVariables.LoggedUser.id, productId);

                StupidRD stupidRD = await RestSharpHelper <StupidRD> .GetAsync(url);

                return(stupidRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #20
0
        /// <summary>
        /// 获取收藏商品列表
        /// </summary>
        /// <returns></returns>
        public static async Task <ProductListRD> GetCollections()
        {
            try
            {
                string url = "/goods/GetCollection?userId=" + GlobalVariables.LoggedUser.id;

                ProductListRD productListRD = await RestSharpHelper <ProductListRD> .GetAsync(url);

                return(productListRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #21
0
        /// <summary>
        /// openid登录
        /// </summary>
        /// <returns></returns>
        public static async Task <LoginRD> LoginByOpenId(string openId)
        {
            try
            {
                string url = "/member/loginByOpenId?openId=" + openId;

                LoginRD loginRD = await RestSharpHelper <LoginRD> .GetAsync(url);

                return(loginRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #22
0
        /// <summary>
        /// 获取首页相关内容信息
        /// </summary>
        /// <returns></returns>
        public static async Task <HomeContentRD> GetHomeContent()
        {
            try
            {
                string url = "/goods/home";

                HomeContentRD homeContentRD = await RestSharpHelper <HomeContentRD> .GetAsync(url);

                //HomeContentRD homeContentRD = RestSharpHelper<HomeContentRD>.Get(url);
                return(homeContentRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #23
0
        /// <summary>
        /// 根据用户id获取订单列表
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public static async Task <OrderListRD> GetOrderListById(int userId, int page, int size)
        {
            try
            {
                string url = "/member/orderList?userId=" + userId.ToString()
                             + "&page=" + page.ToString()
                             + "&size=" + size.ToString();

                OrderListRD orderListRD = await RestSharpHelper <OrderListRD> .GetAsync(url);

                return(orderListRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }
Пример #24
0
        /// <summary>
        /// 获取商品详情
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        public static async Task <ProductDetailRD> GetProductDetail(string productId)
        {
            try
            {
                string url = "/goods/productDet?productId=" + productId;
                if (GlobalVariables.IsLogged)
                {
                    url += "&userId=" + GlobalVariables.LoggedUser.id;
                }
                ProductDetailRD productDetailRD = await RestSharpHelper <ProductDetailRD> .GetAsync(url);

                return(productDetailRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }