private static ResponseModel <bool?> CallCRMApi(string ApiName) { try { var ClientUrl = $"api/task/{ApiName}"; var param = new RequestModel <int> { Shared = new Shared(), Data = 1 }; var result = PlatformCommunication.PostCRM <bool?>(ClientUrl, param); if (result == null || result.Result == null) { throw new Exception("服务请求失败,请查看中台"); } if (result.Result.HasError) { throw new Exception($"Code:{result.Result.ErrorCode},Message:{result.Result.ErrorMessage}"); } if (!result.Data.HasValue || !result.Data.Value) { throw new Exception("接口执行失败"); } return(result); } catch (Exception ex) { throw ex; } }
public static object PlatformExcute(string Url, object data) { try { return(PlatformCommunication.PostCRM <object>(Url, data)); } catch (Exception ex) { throw ex; } }