123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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 int plateid { get; set; } = -1;
- 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,
- }
- }
|