配置放在一个文件中
This commit is contained in:
parent
b67760b6a7
commit
1a52e87d46
|
|
@ -161,15 +161,15 @@ namespace Waste.Application.Device
|
|||
if (param.queryParam != null && param.queryParam.Count > 0)
|
||||
{
|
||||
List<IConditionalModel> conModels = new List<IConditionalModel>();
|
||||
param.queryParam.ForEach(x =>
|
||||
param.queryParam.ForEach(e =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(x.Value))
|
||||
if (!string.IsNullOrEmpty(e.Value))
|
||||
{
|
||||
conModels.Add(new ConditionalModel()
|
||||
{
|
||||
FieldName = x.Name,
|
||||
ConditionalType = (ConditionalType)x.Type,
|
||||
FieldValue = x.Value.Trim()
|
||||
FieldName = e.Name,
|
||||
ConditionalType = (ConditionalType)e.Type,
|
||||
FieldValue = e.Value.Trim()
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ namespace WasteConsoleTest
|
|||
class Program
|
||||
{
|
||||
private static WSocketClientHelp wSocketClient = null;
|
||||
public static string Secret = "MbMH8rycrclA18ZH";
|
||||
public static string SecretHash = "ke3/kUj8Om9rXYYh2cnQ7QlA0f3bZyHkgDFmtMnA1N4==";
|
||||
public static string SocketURL = "wss://api.device.suzhou.ljflytjl.cn/device_rpc";
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
|
|
@ -194,11 +192,11 @@ namespace WasteConsoleTest
|
|||
string[] paramlist = new string[] {
|
||||
garbageC2SDto.weight.ToString(),garbageC2SDto.trash,garbageC2SDto.type.ToString(),garbageC2SDto.scanningTime.ToString(),garbageC2SDto.d_status.ToString()
|
||||
};
|
||||
string sign = GetUserApiSign(Secret, paramlist);
|
||||
string sign = GetUserApiSign(WSocketClientHelp.Secret, paramlist);
|
||||
var request = new HttpRequestMessage(HttpMethod.Post,
|
||||
"https://api.data.suzhou.ljflytjl.cn/api/Garbages");
|
||||
request.Headers.Add("Authorization", $"Bearer {token}");
|
||||
request.Headers.Add("secret", Secret);
|
||||
request.Headers.Add("secret", WSocketClientHelp.Secret);
|
||||
request.Headers.Add("nonce", nonce.ToString());
|
||||
request.Headers.Add("time", timestamp.ToString());
|
||||
request.Headers.Add("sign", sign);
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ namespace WasteConsoleTest
|
|||
ClientWebSocket ws = null;
|
||||
Uri uri = null;
|
||||
bool isUserClose = false;//是否最后由用户手动关闭
|
||||
public static string Secret = "MbMH8rycrclA18ZH";
|
||||
public static string SecretHash = "ke3/kUj8Om9rXYYh2cnQ7QlA0f3bZyHkgDFmtMnA1N4=";
|
||||
public static string deviceid = "08d96e7b-a488-468d-8f54-8bf45dccb9b9";
|
||||
public static string Secret = "GBS4f3ffffQ6WPaD";
|
||||
public static string SecretHash = "73130755226b2c00";
|
||||
public static string deviceid = "08d98e20-dc60-4766-8af0-c1f8d6e0110c";
|
||||
|
||||
// <summary>
|
||||
/// WebSocket状态
|
||||
|
|
|
|||
Loading…
Reference in New Issue