private bool InitOrder() { #if DEBUG if (Request.HttpMethod.Equals("GET")) { _aqm = new Model.APIRquestModel() { cid = 123, imei = "866568022922909", imsi = "460023192787105", iccid = "898600161315F1003574", lac = 456, mobile = "13570830935", id = 0x40000000 | (int)((DateTime.Now.Ticks / 100000) & 0x7FffFFFF) }; return(true); } #endif if (Request.TotalBytes < 10) { return(false); } var bin = new byte[Request.TotalBytes]; Request.InputStream.Read(bin, 0, Request.TotalBytes); WriteLog("Request:" + ASCIIEncoding.UTF8.GetString(bin)); Request.InputStream.Seek(0, SeekOrigin.Begin); _aqm = Shotgun.Library.Static.JsonParser <sdk_Request.Model.APIRquestModel>(Request.InputStream); return(true); }
public object Clone() { var t = this.GetType(); var fields = t.GetFields(); var ret = new APIRquestModel(); foreach (var f in fields) { var val = f.GetValue(this); f.SetValue(ret, val); } return(ret); }
public APIResponseModel(SP_RESULT cmd, APIRquestModel request) { this._cmd = cmd; this.Request = request; if (cmd == null) { return; } if (request == null) { return; } if (cmd == null) { request.status = Logical.API_ERROR.INNER_ERROR; } else { request.status = cmd.status; } }