2020-08-08 08:53:35 +02:00
|
|
|
|
namespace Giants.Services
|
|
|
|
|
{
|
|
|
|
|
using System;
|
2020-08-09 01:31:16 +02:00
|
|
|
|
using Giants.Services.Core.Entities;
|
2020-08-08 08:53:35 +02:00
|
|
|
|
|
2020-08-09 01:31:16 +02:00
|
|
|
|
public class ServerInfo : DataContract.ServerInfo, IIdentifiable
|
2020-08-08 08:53:35 +02:00
|
|
|
|
{
|
2020-08-09 01:31:16 +02:00
|
|
|
|
public string id => HostIpAddress;
|
|
|
|
|
|
2020-08-08 08:53:35 +02:00
|
|
|
|
public string HostIpAddress { get; set; }
|
|
|
|
|
|
|
|
|
|
public DateTime LastHeartbeat { get; set; }
|
2020-08-09 01:31:16 +02:00
|
|
|
|
|
|
|
|
|
public string DocumentType => nameof(ServerInfo);
|
2020-08-09 11:10:33 +02:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
return obj is ServerInfo info &&
|
|
|
|
|
base.Equals(obj) &&
|
|
|
|
|
HostIpAddress == info.HostIpAddress &&
|
|
|
|
|
DocumentType == info.DocumentType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
HashCode hash = new HashCode();
|
|
|
|
|
hash.Add(base.GetHashCode());
|
|
|
|
|
hash.Add(id);
|
|
|
|
|
hash.Add(HostIpAddress);
|
|
|
|
|
hash.Add(DocumentType);
|
|
|
|
|
return hash.ToHashCode();
|
|
|
|
|
}
|
2020-08-08 08:53:35 +02:00
|
|
|
|
}
|
|
|
|
|
}
|