xxe 2年前
コミット
7e3fe34168
4個のファイルの変更55行の追加7行の削除
  1. +1
    -0
      HKCardOUT/Helper/DataBus.cs
  2. +5
    -2
      HKCardOUT/Logic/RemoteService.cs
  3. +33
    -0
      HKLib/Dto/TimeSpilte.cs
  4. +16
    -5
      HKLib/Interfaces/HKLibHelper.cs

+ 1
- 0
HKCardOUT/Helper/DataBus.cs ファイルの表示

@@ -40,6 +40,7 @@ namespace HKCardOUT.Helper
}
public class ApiRoute
{
public static string GetTime = "http://192.168.1.22:5000/api/one-card/eat-time-interval";
/// <summary>
/// 获取所有卡
/// </summary>


+ 5
- 2
HKCardOUT/Logic/RemoteService.cs ファイルの表示

@@ -43,11 +43,14 @@ namespace HKCardOUT.Logic
/// </summary>
public static void SyncTime()
{
/*
{"statusCode":200,"data":{"isSuccess":true,"msg":null,"data":{"amStartTime":"17:50","amEndTime":"17:50","pmStartTime":"17:50","pmEndTime":"17:50","atStartTime":"17:50","atEndTime":"17:50"}},"succeeded":true,"errors":null,"extras":null,"timestamp":1665654784093}
*/
var data = IHttpMultiClient.HttpMulti.AddNode(t =>
{
t.NodePath = ApiRoute.CheckCardStatus;
t.NodePath = ApiRoute.GetTime;
t.ReqType = MultiType.GET;
}).Build().RunStringFirst().ToModel<JObject>()["data"]["data"];
}).Build().RunStringFirst();

}



+ 33
- 0
HKLib/Dto/TimeSpilte.cs ファイルの表示

@@ -38,6 +38,39 @@ namespace HKLib.Dto
public DateTime ATEndTime { get; set; }

}
public class TimeSpilteDto
{

/// <summary>
/// 早上开始时间
/// </summary>
public string AMStartTime { get; set; }

/// <summary>
/// 早上结束时间
/// </summary>
public string AMEndTime { get; set; }

/// <summary>
/// 中午开始时间
/// </summary>
public string PMStartTime { get; set; }

/// <summary>
/// 中午结束时间
/// </summary>
public string PMEndTime { get; set; }

/// <summary>
/// 晚上开始时间
/// </summary>
public string ATStartTime { get; set; }

/// <summary>
/// 晚上结束时间
/// </summary>
public string ATEndTime { get; set; }

}

}

+ 16
- 5
HKLib/Interfaces/HKLibHelper.cs ファイルの表示

@@ -20,14 +20,25 @@ namespace HKLib.Interfaces
/// </summary>
public static bool SetTime(TimeSpilte input)
{
return IHttpMultiClient.HttpMulti
TimeSpilteDto dto = new TimeSpilteDto
{
AMEndTime = input.AMEndTime.ToShortTimeString(),
AMStartTime = input.AMStartTime.ToShortTimeString(),
PMEndTime = input.PMEndTime.ToShortTimeString(),
PMStartTime = input.PMStartTime.ToShortTimeString(),
ATEndTime = input.ATEndTime.ToShortTimeString(),
ATStartTime = input.ATStartTime.ToShortTimeString(),
};

var data = IHttpMultiClient.HttpMulti
.AddHeader(t => t.Headers = Header)
.AddNode(t =>
{
t.NodePath = $"{Configer.SaasRoute}";
t.JsonParam = input.ToJson();
t.ReqType = MultiType.POST;
}).Build().RunStringFirst().ToModel<JObject>()["isSuccess"].ToString().AsBool();
t.NodePath = $"{Configer.SaasRoute}api/one-card/eat-time-interval";
t.JsonParam = dto.ToJson();
t.ReqType = MultiType.PUT;
}).Build().RunStringFirst();
return data.ToModel<JObject>()["data"]["isSuccess"].ToString().AsBool();
}

/// <summary>


読み込み中…
キャンセル
保存