-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
308 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/CAServer.Application.Contracts/Commons/HMACSHA256Helper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace CAServer.Commons; | ||
|
||
public class HMACSHA256Helper | ||
{ | ||
|
||
public static string ComputeHash(string data, string key) | ||
{ | ||
var encoding = new UTF8Encoding(); | ||
byte[] keyBytes = encoding.GetBytes(key); | ||
byte[] messageBytes = encoding.GetBytes(data); | ||
using (var hmacsha256 = new HMACSHA256(keyBytes)) | ||
{ | ||
byte[] hashBytes = hmacsha256.ComputeHash(messageBytes); | ||
return Convert.ToBase64String(hashBytes); | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/CAServer.Application.Contracts/Growth/Dtos/TonGiftsRequestDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace CAServer.Growth.Dtos; | ||
|
||
public class TonGiftsRequestDto | ||
{ | ||
|
||
[JsonProperty("status")] | ||
public string Status { get; set; } | ||
|
||
[JsonProperty("userIds")] | ||
public List<string> UserIds { get; set; } | ||
|
||
[JsonProperty("taskId")] | ||
public string TaskId { get; set; } | ||
} |
26 changes: 26 additions & 0 deletions
26
src/CAServer.Application.Contracts/Growth/Dtos/TonGiftsResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace CAServer.Growth.Dtos; | ||
|
||
public class TonGiftsResponseDto | ||
{ | ||
public List<SuccessfulUpdate> SuccessfulUpdates { get; set; } | ||
|
||
public List<FailedUpdate> FailedUpdates { get; set; } | ||
} | ||
|
||
public class SuccessfulUpdate : TonGiftsBase | ||
{ | ||
} | ||
|
||
public class FailedUpdate : TonGiftsBase | ||
{ | ||
public string Error { get; set; } | ||
} | ||
|
||
public class TonGiftsBase | ||
{ | ||
public string UserId { get; set; } | ||
public string TaskId { get; set; } | ||
public string Status { get; set; } | ||
} |
19 changes: 19 additions & 0 deletions
19
src/CAServer.Application.Contracts/Growth/Dtos/ValidateHamsterScoreResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace CAServer.Growth.Dtos; | ||
|
||
public class ValidateHamsterScoreResponseDto | ||
{ | ||
public Result Result { get; set; } | ||
|
||
public ErrorMsg ErrorMsg { get; set; } | ||
} | ||
|
||
|
||
public class ErrorMsg | ||
{ | ||
public string Message { get; set; } | ||
} | ||
|
||
public class Result | ||
{ | ||
public bool ValidateResult { get; set; } = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace CAServer.Options; | ||
|
||
public class TonGiftsOptions | ||
{ | ||
public string ApiKey { get; set; } | ||
|
||
|
||
public string TaskId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.