1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using Nancy;
- using Nancy.Json;
- using Nancy.ModelBinding;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace xicheji
- {
- public class HomeModule : NancyModule
- {
- public HomeModule()
- {
- Get("/hello", (req) =>
- {
- return "ok~";
- });
- Get("/update-test", (req) =>
- {
- Program.MainForm.UpdateTest(DateTime.Now);
- return "ok~";
- });
- Post("/update-car", (req) =>
- {
- var requestRoot = this.Bind<RequestRoot>();
- Program.MainForm.UpdateCar(requestRoot.AlarmInfoPlate.result.PlateResult);
-
- return JsonConvert.SerializeObject(new
- {
- Response_AlarmInfoPlate = new
- {
- info = "ok",
- content = "...",
- is_pay = "true",
- }
- });
- });
- }
- }
- public class RequestRoot
- {
- public Alarminfoplate AlarmInfoPlate { get; set; }
- }
- public class Alarminfoplate
- {
- public Result result { get; set; }
- }
- public class Result
- {
- public Plateresult PlateResult { get; set; }
- }
- public class Plateresult
- {
- public string license { get; set; }//车牌号字符串,如 “京AAAAAA”
- public string imageFile { get; set; }//识别大图片内容经过base64后的字符串,需要开启发送大图片
- public ColorType colorType { get; set; }
- }
- public enum ColorType
- {
- Unknown,
- Blue,
- Yellow,
- White,
- Black,
- Green,
- YellowGreen,
- }
- }
|