Skip to content

Commit

Permalink
增加用户在线表Page字段长度
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 14, 2024
1 parent a3ea86c commit f98a7e7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion NewLife.Cube/Entity/Cube.htm
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ <h3>用户在线(UserOnline)</h3>
<td>Page</td>
<td>页面</td>
<td>String</td>
<td>50</td>
<td>200</td>
<td></td>
<td></td>
<td></td>
Expand Down
2 changes: 1 addition & 1 deletion NewLife.Cube/Entity/Cube.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<Column Name="SessionID" DataType="String" Description="会话。Web的SessionID或Server的会话编号" />
<Column Name="OAuthProvider" DataType="String" Description="登录方。OAuth提供商,从哪个渠道登录" />
<Column Name="Times" DataType="Int32" Description="次数" />
<Column Name="Page" DataType="String" Description="页面" />
<Column Name="Page" DataType="String" Length="200" Description="页面" />
<Column Name="Platform" DataType="String" Description="平台。操作系统平台,Windows/Linux/Android等" />
<Column Name="OS" DataType="String" Description="系统。操作系统,带版本" />
<Column Name="Device" DataType="String" Description="设备。手机品牌型号" />
Expand Down
File renamed without changes.
Binary file modified NewLife.Cube/Entity/xcodetool.exe
Binary file not shown.
35 changes: 18 additions & 17 deletions NewLife.Cube/Entity/用户在线.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,29 @@ public override void Valid(Boolean isNew)
if (!HasDirty) return;

// 截取长度
CutField(_.Status, _.Page, _.Platform, _.OS, _.Device, _.Brower, _.NetType);
//CutField(_.Status, _.Page, _.Platform, _.OS, _.Device, _.Brower, _.NetType);
this.TrimExtraLong(__.Status, __.Page, __.Platform, __.OS, __.Device, __.Brower, __.NetType);

// 建议先调用基类方法,基类方法会做一些统一处理
base.Valid(isNew);
}

void CutField(params FieldItem[] fields)
{
foreach (var field in fields)
{
var len = field.Length;
if (len > 0 && field.Type == typeof(String))
{
var str = this[field.Name] as String;
if (!str.IsNullOrEmpty() && str.Length > len)
{
str = str[..len];
SetItem(field.Name, str);
}
}
}
}
//void CutField(params FieldItem[] fields)
//{
// foreach (var field in fields)
// {
// var len = field.Length;
// if (len > 0 && field.Type == typeof(String))
// {
// var str = this[field.Name] as String;
// if (!str.IsNullOrEmpty() && str.Length > len)
// {
// str = str[..len];
// SetItem(field.Name, str);
// }
// }
// }
//}
#endregion

#region 扩展属性
Expand Down
2 changes: 1 addition & 1 deletion NewLife.Cube/Entity/用户在线.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public partial class UserOnline
/// <summary>页面</summary>
[DisplayName("页面")]
[Description("页面")]
[DataObjectField(false, false, true, 50)]
[DataObjectField(false, false, true, 200)]
[BindColumn("Page", "页面", "")]
public String Page { get => _Page; set { if (OnPropertyChanging("Page", value)) { _Page = value; OnPropertyChanged("Page"); } } }

Expand Down

0 comments on commit f98a7e7

Please sign in to comment.