/// <summary> /// 消费消息 /// </summary> /// <returns></returns> public static string GetMsg2() { var model = new MSG2 { SequenceID = 1, Status = 0, ErrorMSG = "错误内容", CreateTime = DateTime.Now, UpdateTime = DateTime.Now, TargetSystem = UserEnum.ERP.ToString(), //消费方,谁来消费的 TargetDB = null, //消费方数据库,暂时无用 TargetType = "Response Message Model", TargetValue = "Response Message Model PK", }; return(JsonHelper.DataContractJsonSerialize <MSG2>(model)); }
public static string SetMessageOperationResult() { string result = string.Empty; Hashtable ht = new Hashtable(); // todo 判断acctoken是否过期 ht.Add("Authorization", string.Format("Bearer {0}", _accToken)); string pReqPar = string.Empty; MSG2 model = ModelHelper.SetMsg2Model(); pReqPar = JsonConvert.SerializeObject(model); //string pReqPar = string.Format("top={0}", count); string url = string.Format("{0}{1}", BaseUrl, _setMessageOperationResult); result = HttpHelper.GetData(pReqPar, url, _timeout, ht); return(result); }
public static MSG2 SetMsg2Model() { var model = new MSG2 { SequenceID = 10001,//设定指定的消息消费结果 Status = 0, ErrorMSG = "消费的结果", CreateTime = DateTime.Now, UpdateTime = DateTime.Now, TargetSystem = UserEnum.ERP.ToString(), //消费方,谁来消费的 TargetDB = null, //消费方数据库,暂时无用 TargetType = "Response Message Model", TargetValue = "Response Message Model PK", }; return(model); //return JsonHelper.DataContractJsonSerialize<MSG2>(model); }