// 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 MerchantDepositBackController : BaseController // { // public MerchantDepositBackController(IHttpContextAccessor accessor, ILogger logger, IOptions setting) : base(accessor, logger, setting) // { // } // #region 商户激活-商户服务费退还 // [Authorize] // public JsonResult AddMerchantDepositBack(string value) // { // value = DesDecrypt(value); // JsonData data = JsonMapper.ToObject(value); // AppResultJson result = AddMerchantDepositBackDo(value); // return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data }); // } // private AppResultJson AddMerchantDepositBackDo(string value) // { // JsonData data = JsonMapper.ToObject(value); // int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id // int ReturnWay = int.Parse(function.CheckInt(data["ReturnWay"].ToString())); //退还方式 // string MobileCode = data["MobileCode"].ToString(); //短信验证码 // string ReturnNo = data["ReturnNo"].ToString(); //退还账号 // 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" }; // } // if (string.IsNullOrEmpty(data["ReturnWay"].ToString())) // { // return new AppResultJson() { Status = "-1", Info = "请填写退还方式" }; // } // if (!function.IsInt(data["ReturnWay"].ToString())) // { // return new AppResultJson() { Status = "-1", Info = "请填写正确的退还方式" }; // } // MobileCodeCheck mobilecheck = RedisDbconn.Instance.Get("MobileCodeCheck:手机号"); // if (mobilecheck == null) // { // return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" }; // } // if (mobilecheck.CheckCode != MobileCode) // { // return new AppResultJson() { Status = "-1", Info = "短信验证码不正确" }; // } // RedisDbconn.Instance.Clear("MobileCodeCheck:手机号"); // Dictionary Obj = new Dictionary(); // MerchantDepositBack query = new MerchantDepositBack(); // Dictionary fields = new Dictionary(); // fields.Add("create_date", DateTime.Now); //创建时间 // fields.Add("update_date", DateTime.Now); //修改时间 // fields.Add("MerchantId", MerchantId); //商户Id // fields.Add("ReturnWay", ReturnWay); //退还方式 // AppResultJson resultJson = MerchantDepositBackService.Add(fields, false); // return new AppResultJson() { Status = "1", Info = "", Data = Obj }; // } // #endregion // #region 检查签名是否合法,合法返回1,不合法返回提示信息 // /// // /// 检查签名是否合法,合法返回1,不合法返回提示信息 // /// // /// 请求的参数(json字符串) // /// 要签名的字段 // /// // private string CheckSign(string value, string[] signField) // { // JsonData json = JsonMapper.ToObject(value); // Dictionary dic = new Dictionary(); // 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 // } // }