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 System.Web; using MySystem.MainModels; using LitJson; using Library; namespace MySystem.Areas.Api.Controllers.v1 { [Area("Api")] [Route("Api/[controller]/[action]")] public class HyfController : BaseController { public HyfController(IHttpContextAccessor accessor, ILogger logger, IOptions setting) : base(accessor, logger, setting) { } #region 设置押金 public string SetDeposit(string value) { string content = ""; try { JsonData data = JsonMapper.ToObject(value); string snList = data["snList"].ToString(); string serviceFee = data["serviceFee"].ToString(); content = PublicImportDataService.Instance.BoxServiceFee(snList, serviceFee); } catch(Exception ex) { Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置盒易付押金异常"); } return content; } #endregion #region 设置费率 public string SetFee(string value) { string content = ""; try { JsonData data = JsonMapper.ToObject(value); string merNo = data["merNo"].ToString(); string fee = data["fee"].ToString(); content = PublicImportDataService.Instance.BoxFee(merNo, fee); } catch(Exception ex) { Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置盒易付费率异常"); } return content; } #endregion } }