using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace POSV.Proxy.GuoPan.Entity { public class GuoPanRequest where G : class where P : class { public Actions action { get; set; } public G get { set; get; } public P post { set; get; } public string ToJson() { //string _json = string.Empty; //string _action = string.Empty; //string _get = string.Empty; //string _post = string.Empty; //_action = Newtonsoft.Json.JsonConvert.SerializeObject(action); //if (get == null) // _get = Newtonsoft.Json.JsonConvert.SerializeObject(get); //if (post == null) // _post = Newtonsoft.Json.JsonConvert.SerializeObject(post); //_json = "{ \"action\": {" // + _action + // " },\"" // if (get == null) // + _requesttype + // "\": {" // + _get + // "}}"; return Newtonsoft.Json.JsonConvert.SerializeObject(this); } } public enum RequestType { POST, GET, ACTION } public class Actions { public string action { get; set; } } }