// using System;
// using System.Collections.Generic;
// using System.Linq;
// 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;

// namespace MySystem.Areas.Api.Controllers.v1
// {
//     [Area("Api")]
//     [Route("Api/v1/[controller]/[action]")]
//     public class MerchantDepositOrderController : BaseController
//     {
//         public MerchantDepositOrderController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
//         {
//         }




//         #region 商户激活-确认支付
//         [Authorize]
//         public JsonResult Pay(string value)
//         {
//             value = DesDecrypt(value);
//             JsonData data = JsonMapper.ToObject(value);
//             AppResultJson result = PayDo(value);
//             return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
//         }
//         private AppResultJson PayDo(string value)
//         {
//             JsonData data = JsonMapper.ToObject(value);
//             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
//             string PayMode = data["PayMode"].ToString(); //支付方式(1 支付宝)
//             if (string.IsNullOrEmpty(data["MerchantId"].ToString()))
//             {
//                 return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
//             }
//             if (!function.IsInt(data["MerchantId"].ToString()))
//             {
//                 return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
//             }
//             Dictionary<string, object> Obj = new Dictionary<string, object>();
//             MerchantDepositOrder query = new MerchantDepositOrder();
//             Dictionary<string, object> fields = new Dictionary<string, object>();
//             fields.Add("create_date", DateTime.Now); //创建时间
//             fields.Add("update_date", DateTime.Now); //修改时间
//             fields.Add("MerchantId", MerchantId); //商户Id
//             AppResultJson resultJson = MerchantDepositOrderService.Add(fields, false);

//             return new AppResultJson() { Status = "1", Info = "", Data = Obj };
//         }
//         #endregion



//         #region 商户激活-确认订单
//         [Authorize]
//         public JsonResult ConfirmOrder(string value)
//         {
//             value = PublicFunction.DesDecrypt(value); ;
//             JsonData data = JsonMapper.ToObject(value);
//             AppResultJson result = ConfirmOrderDo(value);
//             return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
//         }
//         private AppResultJson ConfirmOrderDo(string value)
//         {
//             JsonData data = JsonMapper.ToObject(value);
//             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
//             if (string.IsNullOrEmpty(data["MerchantId"].ToString()))
//             {
//                 return new AppResultJson() { Status = "-1", Info = "请填写商户Id" };
//             }
//             if (!function.IsInt(data["MerchantId"].ToString()))
//             {
//                 return new AppResultJson() { Status = "-1", Info = "请填写正确的商户Id" };
//             }
//             Dictionary<string, object> Obj = new Dictionary<string, object>();
//             MerchantDepositOrder query = new MerchantDepositOrder();
//             Dictionary<string, object> fields = new Dictionary<string, object>();
//             fields.Add("create_date", DateTime.Now); //创建时间
//             fields.Add("update_date", DateTime.Now); //修改时间
//             fields.Add("MerchantId", MerchantId); //商户Id
//             AppResultJson resultJson = MerchantDepositOrderService.Add(fields, false);
//             Obj.Add("id", query.Id); //id
//             Obj.Add("create_date", query.CreateDate); //创建时间

//             return new AppResultJson() { Status = "1", Info = "", Data = Obj };
//         }
//         #endregion



//         #region 已激活商户-活动时间
//         [Authorize]
//         public JsonResult Info(string value)
//         {
//             value = PublicFunction.DesDecrypt(value); ;
//             JsonData data = JsonMapper.ToObject(value);
//             Dictionary<string, object> Obj = InfoDo(value);
//             return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
//         }
//         private Dictionary<string, object> InfoDo(string value)
//         {
//             JsonData data = JsonMapper.ToObject(value);
//             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
//             Dictionary<string, object> Obj = new Dictionary<string, object>();
//             MerchantDepositOrder query = new MerchantDepositOrder();
//             query = MerchantDepositOrderService.Query(id);
//             Obj.Add("StartDate", ""); //考核开始时间
//             Obj.Add("EndDate", ""); //考核结束时间

//             return Obj;
//         }
//         #endregion



//         #region 检查签名是否合法,合法返回1,不合法返回提示信息

//         /// <summary>
//         /// 检查签名是否合法,合法返回1,不合法返回提示信息
//         /// </summary>
//         /// <param name="value">请求的参数(json字符串)</param>
//         /// <param name="signField">要签名的字段</param>
//         /// <returns></returns>
//         private string CheckSign(string value, string[] signField)
//         {
//             JsonData json = JsonMapper.ToObject(value);
//             Dictionary<string, string> dic = new Dictionary<string, string>();
//             for (int i = 0; i < signField.Length; i++)
//             {
//                 dic.Add(signField[i], json[signField[i]].ToString());
//             }
//             string sign = json["sign"].ToString(); //客户端签名字符串
//             return new Sign().sign(dic, sign);
//         }

//         #endregion

//     }
// }