Browse Source

标准化接口

Lishi
xxe 2 years ago
parent
commit
596f4e4e04
4 changed files with 45 additions and 4 deletions
  1. +2
    -2
      HKCardIN/Helper/DataBus.cs
  2. +2
    -2
      HKCardIN/Logic/BaseLogic.cs
  3. +5
    -0
      HKCardOUT/Helper/DataBus.cs
  4. +36
    -0
      HKCardOUT/Logic/RemoteService.cs

+ 2
- 2
HKCardIN/Helper/DataBus.cs View File

@@ -18,7 +18,7 @@ namespace HKCardIN.Helper
}
public class ApiRoute
{
public const string PullUserAndCardInfo = "";
public const string PushMoneyToServer = "";
public static string PullUserAndCardInfo = DataBus.SaasRoute + "";
public static string PushMoneyToServer = DataBus.SaasRoute + "";
}
}

+ 2
- 2
HKCardIN/Logic/BaseLogic.cs View File

@@ -14,14 +14,14 @@ namespace HKCardIN.Logic
{
return await IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = DataBus.SaasRoute + ApiRoute.PullUserAndCardInfo;
t.NodePath = ApiRoute.PullUserAndCardInfo;
}).Build().RunStringFirstAsync();
}
public async Task<dynamic> PushMoneyToServer(dynamic input)
{
return await IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = DataBus.SaasRoute + ApiRoute.PushMoneyToServer;
t.NodePath = ApiRoute.PushMoneyToServer;
}).Build().RunStringFirstAsync();
}
}


+ 5
- 0
HKCardOUT/Helper/DataBus.cs View File

@@ -24,4 +24,9 @@ namespace HKCardOUT.Helper
public static string Cron { get; set; }
public static string SaasRoute { get; set; }
}
public class ApiRoute
{
public static string CheckCardStatus = DataBus.SaasRoute + "";
public static string SyncSaleLog = DataBus.SaasRoute + "";
}
}

+ 36
- 0
HKCardOUT/Logic/RemoteService.cs View File

@@ -0,0 +1,36 @@
using HKCardOUT.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XExten.Advance.HttpFramework.MultiFactory;

namespace HKCardOUT.Logic
{
public class RemoteService
{
/// <summary>
/// 判断卡状态
/// </summary>
/// <param name="input"></param>
public static void CheckCardStuatas(string input)
{
IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.CheckCardStatus;
}).Build().RunStringFirst();
}
/// <summary>
/// 同步消费记录
/// </summary>
/// <param name="input"></param>
public static void SyncSaleLog(dynamic input)
{
IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.SyncSaleLog;
}).Build().RunStringFirst();
}
}
}

Loading…
Cancel
Save