static void exe() { string urlAdd = "http://localhost:3301/api/node/add"; for (int i = 0; i < 1800; i++) { GPS gps = new GPS(); gps.GetTime = DateTime.Now; gps.Lat = 12.33342m + i % 100; gps.Lng = 12.33452m; gps.TEID = "a00023" + i % 10; OBD obd = new OBD(); obd.GetTime = DateTime.Now; obd.TEID = gps.TEID; obd.Speed = 20 + i % 30; obd.OilPressure = 30; GpsObdContainer r = new GpsObdContainer(); r.Gps = gps; r.Obd = obd; Console.WriteLine("开始上传"); int nID = AngleX.AppXGlobal.IHttp.PostData <int>(urlAdd, r); Console.WriteLine(nID); System.Threading.Thread.Sleep(100); } }
public ActionResult <int> Add(GpsObdContainer model) { GDBContext db = GDBContextManager.Find(model.Gps.GetTime); return(db.AddR(model.Gps, model.Obd)); }