using System; using System.Collections.Generic; using System.Linq; using System.Data; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.AspNetCore.Authorization; using MySystem.MainModels; using LitJson; using Library; using System.Security.Cryptography; using System.Text; namespace MySystem.Areas.Api.Controllers.v1 { [Area("Api")] [Route("/v1/QrCodePlateMain/[controller]/[action]")] public class PageInfoController : ConsumersController { public PageInfoController(IHttpContextAccessor accessor, ILogger logger, IOptions setting) : base(accessor, logger, setting) { } #region 用户协议 // [Authorize] public JsonResult AgreeMentInfo(string value) { value = DesDecrypt(value); JsonData data = JsonMapper.ToObject(value); Dictionary Other = new Dictionary(); List> dataList = AgreeMentInfoDo(value, out Other); return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other }); } private List> AgreeMentInfoDo(string value, out Dictionary Other) { JsonData data = JsonMapper.ToObject(value); int Id = int.Parse(function.CheckInt(data["Id"].ToString())); //Id List relationData = new List(); List> dataList = new List>(); DataTable dt = CustomerSqlConn.dtable("SELECT Title,Contents FROM PageInfo WHERE Id=" + Id + "", AppConfig.Base.BsSqlConnStr); foreach (DataRow dr in dt.Rows) { Dictionary curData = new Dictionary(); curData.Add("Title", dr["Title"].ToString()); //标题 curData.Add("Contents", dr["Contents"].ToString()); //创建时间 dataList.Add(curData); } Other = new Dictionary(); Other.Add("count", dt.Rows.Count); return dataList; } #endregion } }