Exemplo n.º 1
0
        public static IEnumerable <DicCityModel> GetCites(int?provinceId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/DicCity/GetsByProvince", new Dictionary <string, string>
            {
                { "provinceId", provinceId?.ToString() }
            });

            return(ParseResponseJsonContent.ParseList <DicCityModel>(RestClientUtil.GetUnToken(url), out string msg));
        }
Exemplo n.º 2
0
        public static IEnumerable <DicAreaModel> GetAreas(int?cityId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/DicArea/GetsByCity", new Dictionary <string, string>
            {
                { "cityId", cityId?.ToString() }
            });

            return(ParseResponseJsonContent.ParseList <DicAreaModel>(RestClientUtil.GetUnToken(url), out string msg));
        }
Exemplo n.º 3
0
        public static async Task <ObservableCollection <DoctorViewModel> > GetDoctorsByName(string hosCode, string name)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/DoctorInfo/GetsByName", new Dictionary <string, string>
            {
                { "hosCode", hosCode }, { "name", name }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <DoctorViewModel>(content, out string msg)));
        }
Exemplo n.º 4
0
        public static async Task <PageDataModel <DoctorViewModel> > GetDoctorsPage(string hosCode, int index, int size)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/DoctorInfo/GetsPage", new Dictionary <string, string>
            {
                { "hosCode", hosCode }, { "index", index.ToString() }, { "size", size.ToString() }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObj <PageDataModel <DoctorViewModel> >(content, out string msg)));
        }
Exemplo n.º 5
0
        public static async Task <NewsPageModel> GetNews(PageInquireModel page)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/News/GetsPage", new Dictionary <string, string>
            {
                { "Index", page.Index.ToString() }, { "Size", page.Size.ToString() }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(function : () => ParseResponseJsonContent.ParseObj <NewsPageModel>(content, out string msg)));
        }
Exemplo n.º 6
0
        public static async Task <ObservableCollection <NewsModel> > GetCollectNewsDetails(Guid userId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserCollectNews/GetsNewsDetail", new Dictionary <string, string>
            {
                { "uid", userId.ToString() }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <NewsModel>(content, out string msg)));
        }
Exemplo n.º 7
0
        public static async Task <IEnumerable <HospitalViewModel> > GetHospitalsByName(string input)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/HospitalInfo/GetsByName", new Dictionary <string, string>
            {
                { "name", input }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseList <HospitalViewModel>(content, out string msg)));
        }
Exemplo n.º 8
0
        public static async Task <List <FollowDoctorModel> > GetStartDoctors(Guid userId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserFollowDoctor/Gets", new Dictionary <string, string>
            {
                { "uid", userId.ToString() }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return((List <FollowDoctorModel>) await Task.Run(() => ParseResponseJsonContent.ParseList <FollowDoctorModel>(content, out string msg)));
        }
Exemplo n.º 9
0
        public static async Task <ObservableCollection <ChatContentViewModel> > GetChatContent(int chatId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/ChatContent/Gets", new Dictionary <string, string>
            {
                { "chatId", chatId.ToString() }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <ChatContentViewModel>(content, out string msg)));
        }
Exemplo n.º 10
0
        public static async Task <IEnumerable <RecipeRecordPreviewModel> > GetTimeLinePreview(string idNo, int year)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserRecipeRecord/GetPageByIdNoYear", new Dictionary <string, string>
            {
                { "IdNo", idNo }, { "Year", year.ToString() },
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseList <RecipeRecordPreviewModel>(content, out string msg)));
        }
Exemplo n.º 11
0
        public static async Task <RecipeRecordModel> GetRecipeRecord(int id)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserRecipeRecord/GetById", new Dictionary <string, string>
            {
                { "Id", id.ToString() }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObj <RecipeRecordModel>(content, out string msg)));
        }
Exemplo n.º 12
0
        public static async Task <ChatMainModel> GetChatInfo(Guid userId, Guid anotherId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/ChatMain/Get", new Dictionary <string, string>
            {
                { "userId", userId.ToString() }, { "anotherId", anotherId.ToString() },
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObj <ChatMainModel>(content, out string msg)));
        }
Exemplo n.º 13
0
        public static async Task <ObservableCollection <ReserveDoctorViewModel> > GetReserveDoctors(Guid uid)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserReserveRecord/Gets", new Dictionary <string, string>
            {
                { "uid", uid.ToString() }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <ReserveDoctorViewModel>(content, out string msg)));
        }
Exemplo n.º 14
0
        public static async Task <ObservableCollection <RecipeDetailModel> > GetRecipeDetail(string registeredNo)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserRecipeDetail/GetsByRegisteredNo", new Dictionary <string, string>
            {
                { "registeredNo", registeredNo }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <RecipeDetailModel>(content, out string msg)));
        }
Exemplo n.º 15
0
        public static async Task <IEnumerable <RecipeRecordPreviewModel> > GetMedicalRecord(string idNo)
        {
            string url = RestClientUtil.GetSpliceUrl("", new Dictionary <string, string>
            {
                { "IdNo", idNo }
            });
            string content = await RestClientUtil.GetTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseList <RecipeRecordPreviewModel>(content, out string msg)));
        }
Exemplo n.º 16
0
        public static async Task <ObservableCollection <NewsCommentModel> > GetNewsComments(int id)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/NewsComment/Gets", new Dictionary <string, string>
            {
                { "Id", id.ToString() }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObCollection <NewsCommentModel>(content, out string msg)));
        }
Exemplo n.º 17
0
        public static async Task <NewsModel> GetNewsDetail(int id)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/News/Get", new Dictionary <string, string>
            {
                { "Id", id.ToString() }
            });
            string content = await RestClientUtil.GetUnTokenAsync(url);

            return(await Task.Run(() => ParseResponseJsonContent.ParseObj <NewsModel>(content, out string msg)));
        }
Exemplo n.º 18
0
        public static bool SendChatContent(ChatContentModel chatContent)
        {
            string url    = "/api/ChatContent/Add";
            string input  = JsonConvert.SerializeObject(chatContent);
            bool   result = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg);

            if (!result)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            return(result);
        }
Exemplo n.º 19
0
        public static UserInfoModel Login(LoginModel info)
        {
            string url   = "/api/UserInfo/Login";
            string input = JsonConvert.SerializeObject(info);
            RegisteredReturnModel returnModel = ParseResponseJsonContent.ParseObj <RegisteredReturnModel>(RestClientUtil.PostUnToken(url, input), out string msg);

            if (returnModel == null)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            RestClientUtil.Token = returnModel?.Access_token;
            return(returnModel?.UserInfo);
        }
Exemplo n.º 20
0
        public static bool AddReserveDoctor(ReserveDoctorAddModel info)
        {
            string url   = "/api/UserReserveRecord/Add";
            string input = JsonConvert.SerializeObject(info);
            bool   res   = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("预约成功!"));
            }
            return(res);
        }
Exemplo n.º 21
0
        public static bool AddNewsComment(NewsCommentAddModel comment)
        {
            string url   = "/api/NewsComment/Add";
            string input = JsonConvert.SerializeObject(comment);
            bool   res   = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("评论成功!"));
            }
            return(res);
        }
Exemplo n.º 22
0
        public static async Task <DoctorViewModel> GetDoctorDetail(Guid doctorId)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/DoctorInfo/Get", new Dictionary <string, string>
            {
                { "id", doctorId.ToString() }
            });
            string msg     = String.Empty;
            string content = await RestClientUtil.GetUnTokenAsync(url);

            var data = await Task.Run(() => ParseResponseJsonContent.ParseObj <DoctorViewModel>(content, out msg));

            if (data == null)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            return(data);
        }
Exemplo n.º 23
0
        public static bool StartDoctor(FollowDoctorModel info)
        {
            string url   = "/api/UserFollowDoctor/Add";
            string input = JsonConvert.SerializeObject(info);
            bool   res   = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                string hint = info.IsFollow ? "取消关注医生成功!" : "关注医生成功!";
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(hint));
            }
            return(res);
        }
Exemplo n.º 24
0
        public static bool AddCollectNews(CollectNewsAddModel info, bool isCollect)
        {
            string url   = "/api/UserCollectNews/Add";
            string input = JsonConvert.SerializeObject(info);
            bool   res   = ParseResponseJsonContent.ParseBool(RestClientUtil.PostToken(url, input), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                string hint = isCollect ? "取消收藏成功!" : "收藏成功!";
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(hint));
            }
            return(res);
        }
Exemplo n.º 25
0
        public static bool CancelReserveDoctor(int id)
        {
            string url = RestClientUtil.GetSpliceUrl("/api/UserReserveRecord/Delete", new Dictionary <string, string>
            {
                { "id", id.ToString() }
            });
            bool res = ParseResponseJsonContent.ParseBool(RestClientUtil.DeleteToken(url), out string msg);

            if (!res)
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert(msg));
            }
            else
            {
                Device.BeginInvokeOnMainThread(() => DependencyService.Get <IToast>().ShortAlert("取消预约成功!"));
            }
            return(res);
        }
Exemplo n.º 26
0
 public static IEnumerable <DicRecipeTypeModel> GetRecipeTypes()
 {
     return(ParseResponseJsonContent.ParseList <DicRecipeTypeModel>(RestClientUtil.GetUnToken("/api/DicRecipeType/Gets"), out string msg));
 }
Exemplo n.º 27
0
 public static IEnumerable <DicFrequencyModel> GetFrequencys()
 {
     return(ParseResponseJsonContent.ParseList <DicFrequencyModel>(RestClientUtil.GetUnToken("/api/DicFrequency/Gets"), out string msg));
 }
Exemplo n.º 28
0
        public static async Task <IEnumerable <HospitalViewModel> > GetHospitals()
        {
            string content = await RestClientUtil.GetUnTokenAsync("/api/HospitalInfo/Gets");

            return(await Task.Run(() => ParseResponseJsonContent.ParseList <HospitalViewModel>(content, out string msg)));
        }