| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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<string, string> body = new Dictionary<string, string>();
- body.Add("id", id.ToString());
- string resultString = httpServiceCall1.callWebService(url, body);
- if (string.IsNullOrEmpty(resultString)) return new Dish();
- ResultEntity<Dish> rs = JsonConvert.DeserializeObject<ResultEntity<Dish>>(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();
- }
- }
- }
- }
|