namespace YLErp.Modules.ApiModule { public static class TradeApiHelper { static readonly HttpClientWrap _httpClientWrap; static TradeApiHelper() { _httpClientWrap = new HttpClientWrap(PS.Config.ErpElement.HedgingTradeUrl); } public static string PostJson(string apiPath, object postData) { if (_httpClientWrap.BaseAddress == null) { throw new ServiceException("HedgingTradeUrl未配置"); } try { return _httpClientWrap.PostJson(apiPath, postData, null); } catch (Exception ex) { LogFactory.GetLogger("TradingAPI-Post").Error(apiPath, ex); throw; } } public static T PostJson(string apiPath, object postData) { var res = PostJson(apiPath, postData); return JsonHelper.Parse(res); } } }