-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPLocation.cs
80 lines (66 loc) · 2.46 KB
/
IPLocation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System;
using System.Diagnostics;
using System.Xml.Serialization;
using Newtonsoft.Json;
using MongoDB.Bson.Serialization.Attributes;
using net.vieapps.Components.Security;
using net.vieapps.Components.Repository;
namespace net.vieapps.Services.IPLocations
{
[BsonIgnoreExtraElements, DebuggerDisplay("IP = {IP}, City = {City}, Country = {Country}")]
[Entity(CollectionName = "IPLocations", TableName = "T_IPLocations", CacheClass = typeof(Utility), CacheName = "Cache")]
public class IPLocation : Repository<IPLocation>
{
public IPLocation() : base() { }
/// <summary>
/// Gets or sets the IP address
/// </summary>
[Property(MaxLength = 50, NotNull = true), Sortable(UniqueIndexName = "Address")]
public string IP { get; set; } = "";
/// <summary>
/// Gets or sets the city name
/// </summary>
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "GEO")]
public string City { get; set; } = "";
/// <summary>
/// Gets or sets the region name
/// </summary>
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "GEO")]
public string Region { get; set; } = "";
/// <summary>
/// Gets or sets the country
/// </summary>
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "GEO")]
public string Country { get; set; } = "";
/// <summary>
/// Gets or sets the continent name (earth area)
/// </summary>
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "GEO")]
public string Continent { get; set; } = "";
/// <summary>
/// Gets or sets the latitude
/// </summary>
[Property(MaxLength = 50, NotNull = true)]
public string Latitude { get; set; } = "";
/// <summary>
/// Gets or sets the longitude
/// </summary>
[Property(MaxLength = 50, NotNull = true)]
public string Longitude { get; set; } = "";
/// <summary>
/// Gets or sets the last-updated time
/// </summary>
[Sortable(IndexName = "Time")]
public DateTime LastUpdated { get; set; } = DateTime.Now.AddDays(-31);
[Ignore, JsonIgnore, XmlIgnore, BsonIgnore]
public override string Title { get; set; }
[Ignore, JsonIgnore, XmlIgnore, BsonIgnore]
public override string SystemID { get; set; }
[Ignore, JsonIgnore, XmlIgnore, BsonIgnore]
public override string RepositoryID { get; set; }
[Ignore, JsonIgnore, XmlIgnore, BsonIgnore]
public override string RepositoryEntityID { get; set; }
[Ignore, JsonIgnore, XmlIgnore, BsonIgnore]
public override Privileges OriginalPrivileges { get; set; }
}
}