using ivf_tl_Entity.ControlEntity; using ivf_tl_Entity.Entity.balance; using ivf_tl_Entity.Entity.Mark; using ivf_tl_Entity.Entity.Result; using ivf_tl_Entity.Enums; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace ivf_tl_Service.HttpProvider { public class MarkProvider { LogService LogService { get; set; } HttpServiceCall httpServiceCall1 { get; set; } public MarkProvider(HttpServiceCall _httpServiceCall, LogService _logService) { httpServiceCall1 = _httpServiceCall; LogService = _logService; } private void ExLog(Exception ex, string name) { LogService.ExceptionLog(ex, $"MarkProvider.{name}", LogEnum.RunException); } private void ErrorLog(string message, LogEnum logType) { LogService.TLLog($"MarkProvider.{message}", logType); } public Dish GetMarkResultByRecordIdApi(long id) { string funcName = "GetMarkResultByRecordIdApi"; try { string url = "/api/businessManage/pc/embryoMark/getMarkResultByRecordId"; Dictionary body = new Dictionary(); body.Add("id", id.ToString()); string resultString = httpServiceCall1.callWebService(url, body); if (string.IsNullOrEmpty(resultString)) return new Dish(); ResultEntity rs = JsonConvert.DeserializeObject>(resultString); if (!rs.success) { ErrorLog($"{funcName}接口返回失败 {resultString}", LogEnum.RunError); return null; } if (rs.data != null) return rs.data; ErrorLog($"{funcName}接口返回成功但是无数据 {resultString}", LogEnum.RunError); return new Dish(); } catch (Exception ex) { ExLog(ex, funcName); return new Dish(); } } } }