新增速率限制,调整本地文件上传,服务监控IP取本机网络IP,仓储增加方法

This commit is contained in:
2023-09-22 15:46:43 +08:00
parent d3556cc058
commit ee9f6bacf3
24 changed files with 822 additions and 24 deletions
+26
View File
@@ -0,0 +1,26 @@
namespace ZR.ServiceCore.Model;
[SugarTable("ip_rate_limit_log")]
[Tenant("0")]
public class IpRateLimitLog
{
[SugarColumn(IsPrimaryKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Id { get; set;}
public string HttpVerb { get; set; }
public string Path { get; set; }
public string ClientIp { get; set; }
public double Limit { get; set; }
public string Period { get; set; }
public double Exceeded { get; set; }
public string Endpoint { get; set; }
public DateTime CreateTime { get; set; }
}
+17
View File
@@ -0,0 +1,17 @@
namespace ZR.ServiceCore.Model;
[SugarTable("ip_rate_limit_policy")]
[Tenant("0")]
public class IpRateLimitPolicy
{
[SugarColumn(IsPrimaryKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Id { get; set; }
public string Ip { get; set; }
[Navigate(NavigateType.OneToMany, nameof(RateLimitRule.IpRateLimitPolicyId))]
public List<RateLimitRule> Rules { get; set; }
public char Flag { get; set; } = '0';
}
+21
View File
@@ -0,0 +1,21 @@
namespace ZR.ServiceCore.Model;
[SugarTable("rate_limit_rule")]
[Tenant("0")]
public class RateLimitRule
{
[SugarColumn(IsPrimaryKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Id { get; set; }
[JsonConverter(typeof(ValueToStringConverter))]
public long IpRateLimitPolicyId { get; set; }
public string Endpoint { get; set; }
public string Period { get; set; }
public double Limit { get; set; }
public char Flag { get; set; } = '0';
}
+20
View File
@@ -0,0 +1,20 @@
namespace ZR.ServiceCore.Model;
[SugarTable("sys_login_limit")]
[Tenant("0")]
public class SysLoginLimit
{
[SugarColumn(IsPrimaryKey = true)]
[JsonConverter(typeof(ValueToStringConverter))]
public long Id { get; set; }
public string UserName { get; set; }
public int? ErrorCount { get; set; }
public DateTime? ErrorTime { get; set; }
public string Ip { get; set; }
public char Flag { get; set; }
}