UserSwapWhiteController.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Http;
  6. using Microsoft.Extensions.Logging;
  7. using Microsoft.Extensions.Options;
  8. using Microsoft.AspNetCore.Authorization;
  9. using System.Web;
  10. using MySystem.Models.Main1;
  11. using MySystem.Service.Main1;
  12. using LitJson;
  13. using Library;
  14. namespace MySystem.Areas.Api.Controllers.v1
  15. {
  16. [Area("Api")]
  17. [Route("/v1/QrCodePlateMain/[controller]/[action]")]
  18. public class UserSwapWhiteController : BaseController
  19. {
  20. public UserSwapWhiteController(IHttpContextAccessor accessor) : base(accessor)
  21. {
  22. }
  23. #region 风险管理-风险创客列表
  24. // [Authorize]
  25. public JsonResult QueryUserRiskFlag(string value)
  26. {
  27. value = PublicFunction.DesDecrypt(value);
  28. JsonData data = JsonMapper.ToObject(value);
  29. Dictionary<string, object> Obj = QueryUserRiskFlagDo(value);
  30. return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
  31. }
  32. private Dictionary<string, object> QueryUserRiskFlagDo(string value)
  33. {
  34. JsonData data = JsonMapper.ToObject(value);
  35. int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //风控创客Id
  36. var RiskFlag = 0;
  37. var Remark = "";
  38. var info = UserSwapWhiteService.QueryByUserId(UserId);
  39. if (info.Id > 0)
  40. {
  41. RiskFlag = 1;
  42. Remark = info.Remark;
  43. }
  44. Dictionary<string, object> Obj = new Dictionary<string, object>();
  45. Obj.Add("RiskFlag", RiskFlag);
  46. Obj.Add("Remark", Remark);
  47. return Obj;
  48. }
  49. #endregion
  50. }
  51. }