You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 line
1.9 KiB

  1. using HKCardIN.Helper;
  2. using HKCardIN.Logic.Model;
  3. using Newtonsoft.Json.Linq;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Security.Policy;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using XExten.Advance.HttpFramework.MultiCommon;
  11. using XExten.Advance.HttpFramework.MultiFactory;
  12. using XExten.Advance.LinqFramework;
  13. namespace HKCardIN.Logic
  14. {
  15. public class BaseLogic : Singleton<BaseLogic>
  16. {
  17. /// <summary>
  18. /// 同步用户和卡信息
  19. /// </summary>
  20. /// <returns></returns>
  21. public UserAndCardInfo PullUserAndCardInfo(string CardNo)
  22. {
  23. return IHttpMultiClient.HttpMulti.AddNode(t =>
  24. {
  25. t.NodePath = ApiRoute.PullUserAndCardInfo + CardNo;
  26. }).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>();
  27. }
  28. /// <summary>
  29. /// 同步充值记录
  30. /// </summary>
  31. /// <param name="input"></param>
  32. /// <returns></returns>
  33. public bool PushMoneyToServer(string CardNo, decimal Money)
  34. {
  35. var data = IHttpMultiClient.HttpMulti.AddNode(t =>
  36. {
  37. t.NodePath = ApiRoute.PushMoneyToServer;
  38. t.ReqType = MultiType.POST;
  39. t.JsonParam = (new { Money, Type = 1, CardNum = CardNo }).ToJson();
  40. }).Build().RunStringFirst();
  41. return bool.Parse(data.ToModel<JObject>()["data"].ToString());
  42. }
  43. /// <summary>
  44. /// 根据会员手机获取卡号
  45. /// </summary>
  46. /// <param name="Phone"></param>
  47. /// <returns></returns>
  48. public string GetCardNoByPhone(string Phone)
  49. {
  50. var data = IHttpMultiClient.HttpMulti.AddNode(t => {
  51. t.NodePath = ApiRoute.GetCardNoByPhone;
  52. }).Build().RunStringFirst();
  53. return data;
  54. }
  55. }
  56. }