コード例 #1
0
        /// <summary>
        /// 根据患者Id获取患者详细信息
        /// </summary>
        /// <param name="patientId">患者Id</param>
        /// <returns>患者详细信息</returns>
        public async Task <WebAPIOutput <PatientDto> > GetPatientById(long patientId)
        {
            var patient = Mapper.Map <Patient, PatientDto>(await _repository.GetPatientById(patientId));

            patient.HasWeightData = await _weightRepository.IsExistWeightData(patientId);

            return(WebAPIOutput <PatientDto> .Success(patient));
        }
コード例 #2
0
        public WebAPIOutput <int> Add([FromBody] AddTreatDto treatDto)
        {
            var treat = new Treat()
            {
                UserId       = treatDto.UserId,
                TreatDate    = treatDto.TreatDate,
                TreatDoctor  = treatDto.TreatDoctor,
                TreatPlace   = treatDto.TreatPlace,
                TreateDetail = treatDto.TreateDetail
            };
            var treatId = _treatService.Add(treat);

            return(WebAPIOutput <int> .Success(treatId));
        }
コード例 #3
0
        public async Task <WebAPIOutput <List <TreatImage> > > GetList(int treatId)
        {
            var treatImageList = await _treatImageService.GetList(treatId);

            return(WebAPIOutput <List <TreatImage> > .Success(treatImageList));
        }
コード例 #4
0
        /// <summary>
        /// 获取最新top数量血压列表
        /// </summary>
        /// <param name="patientId"></param>
        /// <param name="topNumber"></param>
        /// <returns></returns>
        public async Task <WebAPIOutput <List <BloodPressureDto> > > GetTopList(long patientId, int topNumber)
        {
            var bloodPressureList = await _bloodPressureRepository.GetTopList(patientId, topNumber);

            return(WebAPIOutput <List <BloodPressureDto> > .Success(Mapper.Map <List <BloodPressure>, List <BloodPressureDto> >(bloodPressureList)));
        }
コード例 #5
0
        public async Task <WebAPIOutput <GetPatientByIdNoOutput> > GetByIdNo(string idNo)
        {
            var result = await _service.GetByIdNo(idNo);

            return(WebAPIOutput <GetPatientByIdNoOutput> .Success(result));
        }
コード例 #6
0
        public async Task <OutputBase> BindWeixin(BindWeixinInput input)
        {
            var result = await _service.BindWeixin(input);

            return(WebAPIOutput <OutputBase> .Success(result));
        }
コード例 #7
0
        public async Task <WebAPIOutput <DictDto> > GetByOpenId(string openId)
        {
            var result = await _service.GetByOpenId(openId);

            return(WebAPIOutput <DictDto> .Success(result));
        }
コード例 #8
0
        public async Task <WebAPIOutput <Diagnose> > Get(int userId)
        {
            var diagnose = await _diagnoseService.Get(userId);

            return(WebAPIOutput <Diagnose> .Success(diagnose));
        }
コード例 #9
0
        public async Task <WebAPIOutput <List <Treat> > > GetList(int userId)
        {
            var treatList = await _treatService.GetList(userId);

            return(WebAPIOutput <List <Treat> > .Success(treatList));
        }
コード例 #10
0
        public async Task <WebAPIOutput <Treat> > Get(int id)
        {
            var treat = await _treatService.Get(id);

            return(WebAPIOutput <Treat> .Success(treat));
        }
コード例 #11
0
        public async Task <WebAPIOutput <User> > GetUser(int userId)
        {
            var user = await _userService.Get(userId);

            return(WebAPIOutput <User> .Success(user));
        }
コード例 #12
0
        public async Task <WebAPIOutput <User> > GetUserByWeixinOpenId(string weixinOpenId)
        {
            var user = await _userService.Get(weixinOpenId);

            return(WebAPIOutput <User> .Success(user));
        }
コード例 #13
0
        /// <summary>
        /// 上传图片
        /// </summary>
        /// <param name="input">上传图片请求</param>
        /// <returns></returns>
        public async Task <WebAPIOutput <string> > UploadImage(UploadImageInput input)
        {
            var avatar = await _ossRepository.UploadImage(input);

            return(string.IsNullOrEmpty(avatar) ? WebAPIOutput <string> .Fail("上传失败") : WebAPIOutput <string> .Success(CommConstant.OssUrl + avatar));
        }