/// <summary> /// 点融接口的请求对象,4个字段 /// </summary> /// <param name="model"></param> /// <returns></returns> public static DianrongReqModel BuildReqModel(DianrongBaseReqModel model, string channelId) { var randomStr = GetRandomStr(); var nonce = GetNonce(randomStr); var reqJsonStr = JsonConvert.SerializeObject(model, formatting: Formatting.None); // reqLogger.Trace($"请求参数:{reqJsonStr}"); var reqModel = new DianrongReqModel(channelId) { Nonce = nonce, ReqData = GetReqData(model, randomStr), Signature = GetSignature(reqJsonStr) }; return(reqModel); }
public async static Task <T> GetDianrongRsp <T>(string url, DianrongBaseReqModel model, string channelId) where T : class { var reqModel = BuildReqModel(model, channelId); return(await GetDianrongRsp <T>(url, reqModel)); }