using Microsoft.AspNetCore.Mvc; using Nirvana.Common.ApiBase; using YBDevice.Entity; using YBDevice.Entity.ViewModel; using YBDevice.NApi.Application.ChildBody; using YBDevice.NApi.Application.Prescription; namespace YBDevice.NApi.Controllers { /// /// 儿童信息处理 /// public class ChildController : BaseController { private readonly IChildService _childService; private readonly IChildBodyService _childBodyService; private readonly IPrescriptionService _prescriptionService; public ChildController(IChildService childService, IPrescriptionService prescriptionService, IChildBodyService childBodyService) { _childService = childService; _prescriptionService = prescriptionService; _childBodyService = childBodyService; } /// /// 获取儿童信息 /// /// /// 设备类型 /// 小程序appid /// [HttpGet] public async Task GetInfoAsync(int familyid = 0, int devtype = 1, string appid = "") { return await _childService.GetInfoAsync(familyid, devtype, appid); } /// /// 身高/体重历史曲线图 /// /// /// [HttpPost] public async Task GetGrowthCurveAsync([FromBody] ChildGrowthQueryModel model) { return await _childService.GetGrowthCurveAsync(model); } /// /// 获取身高/体重成长测评报告,与标准身高进行对比 /// /// /// 设备类型 /// [HttpGet] public async Task GetHWListAsync(int familyid, int devtype = 1) { return await _childService.GetHWListAsync(familyid, devtype); } /// /// 计算遗传身高和成年身高 /// /// /// [HttpPost] public async Task PredictHeightAsync([FromBody] ChildPredictHeightModel model) { return await _childService.PredictHeightAsync(model); } /// /// 获取儿童增量信息 /// /// 家庭成员ID /// 设备类型 /// 小程序appid /// [HttpGet] public async Task GetYearHeightInfoAsync(string appid,int familyid, int devtype = 0) { return await _childService.GetYearHeightInfoAsync(familyid, devtype,appid); } /// /// 获取儿童体质评测列表 /// /// 是否重新测评,1-是,0-否 /// 家庭成员ID /// [HttpGet] public async Task GetChildPhysiqueAsync(int isrestart = 0, int familyid = 0) { return await _prescriptionService.GetChildPhysiqueAsync(isrestart, familyid); } /// /// 计算儿童体质 /// /// [HttpPost] public async Task ChildPhysiqueAsync([FromBody] ChildPhysiqueCalcC2SDto data) { return await _prescriptionService.ChildPhysiqueAsync(data); } /// /// 获取儿童中医体质已经计算的结果 /// /// /// [HttpPost] public async Task GetBodyInfoAsync([FromBody] ChildBodyInfoC2SDto input) { return await _childBodyService.GetInfoAsync(input); } /// /// 获取儿童中医体质问答列表 /// /// /// [HttpPost] public async Task GetBodyListAsync([FromBody] ChildBodyListC2SDto input) { return await _childBodyService.GetListAsync(input); } /// /// 获取儿童中医体质结果计算 /// /// /// [HttpPost] public async Task GetBodyResultInfoAsync([FromBody] ChildBodySumitC2SDto input) { return await _childBodyService.GetResultInfoAsync(input); } } }