123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Options;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using System.IO;
- using Library;
- using LitJson;
- namespace MySystem.Areas.Api.Controllers
- {
- public class YcCardOnlineController : Admin.Controllers.BaseController
- {
- public YcCardOnlineController(IHttpContextAccessor accessor, ILogger<Admin.Controllers.BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
- {
- }
- #region 接收订单通知
- [Route("/yc/order/notice")]
- public Dictionary<string, object> Bind(int BrandId)
- {
- StreamReader sr = new StreamReader(Request.Body);
- string requestMes = sr.ReadToEnd();
- if (string.IsNullOrEmpty(requestMes))
- {
- return new Dictionary<string, object>();
- }
- RedisDbconn.Instance.AddList("yc_order_list", requestMes);
- Dictionary<string, object> obj = new Dictionary<string, object>();
- obj.Add("resultCode", 1);
- return obj;
- }
- #endregion
- #region 设备信息初始化回传接口
- [Route("/yc/device/init")]
- public Dictionary<string, object> Init()
- {
- StreamReader sr = new StreamReader(Request.Body);
- string requestMes = sr.ReadToEnd();
- if (string.IsNullOrEmpty(requestMes))
- {
- return new Dictionary<string, object>();
- }
- LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + requestMes, "WIFI设备信息初始化回传接口推送消息");
- RedisDbconn.Instance.AddList("yc_device", "init#cut#" + requestMes);
- Dictionary<string, object> obj = new Dictionary<string, object>();
- obj.Add("resultCode", 1);
- obj.Add("errorCode", null);
- obj.Add("errorDesc", null);
- return obj;
- }
- #endregion
- #region 设备信息变更回传接口
- [Route("/yc/device/change")]
- public Dictionary<string, object> Change()
- {
- StreamReader sr = new StreamReader(Request.Body);
- string requestMes = sr.ReadToEnd();
- if (string.IsNullOrEmpty(requestMes))
- {
- return new Dictionary<string, object>();
- }
- LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + requestMes, "WIFI设备信息变更回传接口推送消息");
- RedisDbconn.Instance.AddList("yc_device", "change#cut#" + requestMes);
- Dictionary<string, object> obj = new Dictionary<string, object>();
- obj.Add("resultCode", 1);
- obj.Add("errorCode", null);
- obj.Add("errorDesc", null);
- return obj;
- }
- #endregion
- #region 订单信息初始化回传接口
- [Route("/yc/order/init")]
- public Dictionary<string, object> OrderInit()
- {
- StreamReader sr = new StreamReader(Request.Body);
- string requestMes = sr.ReadToEnd();
- if (string.IsNullOrEmpty(requestMes))
- {
- return new Dictionary<string, object>();
- }
- LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + requestMes, "WIFI订单信息初始化回传接口推送消息");
- RedisDbconn.Instance.AddList("yc_order", "init#cut#" + requestMes);
- Dictionary<string, object> obj = new Dictionary<string, object>();
- obj.Add("resultCode", 1);
- obj.Add("errorCode", null);
- obj.Add("errorDesc", null);
- return obj;
- }
- #endregion
- #region 订单状态变更回传接口
- [Route("/yc/order/change")]
- public Dictionary<string, object> OrderChange()
- {
- StreamReader sr = new StreamReader(Request.Body);
- string requestMes = sr.ReadToEnd();
- if (string.IsNullOrEmpty(requestMes))
- {
- return new Dictionary<string, object>();
- }
- LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + requestMes, "WIFI订单状态变更回传接口推送消息");
- RedisDbconn.Instance.AddList("yc_order", "change#cut#" + requestMes);
- Dictionary<string, object> obj = new Dictionary<string, object>();
- obj.Add("resultCode", 1);
- obj.Add("errorCode", null);
- obj.Add("errorDesc", null);
- return obj;
- }
- #endregion
- }
- }
|