You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Group.cs 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.Json.Serialization;
  4. namespace Shadowsocks.Models
  5. {
  6. public class Group : IGroup<Server>
  7. {
  8. /// <summary>
  9. /// Gets or sets the group name.
  10. /// </summary>
  11. public string Name { get; set; }
  12. /// <summary>
  13. /// Gets or sets the UUID of the group.
  14. /// </summary>
  15. public Guid Id { get; set; }
  16. /// <inheritdoc/>
  17. public int Version { get; set; }
  18. /// <inheritdoc/>
  19. public List<Server> Servers { get; set; }
  20. /// <summary>
  21. /// Gets or sets the data usage in bytes.
  22. /// The value is fetched from SIP008 provider.
  23. /// </summary>
  24. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
  25. public ulong BytesUsed { get; set; }
  26. /// <summary>
  27. /// Gets or sets the data remaining to be used in bytes.
  28. /// The value is fetched from SIP008 provider.
  29. /// </summary>
  30. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
  31. public ulong BytesRemaining { get; set; }
  32. public Group(string name = "")
  33. {
  34. Name = name;
  35. Id = Guid.NewGuid();
  36. Version = 1;
  37. BytesUsed = 0UL;
  38. BytesRemaining = 0UL;
  39. Servers = new List<Server>();
  40. }
  41. }
  42. }