48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using Common.CommonModel;
|
|||
|
|
using MongoDB.Bson;
|
||
|
|
using MongoDB.Bson.Serialization.Attributes;
|
||
|
|
using MongoRepository;
|
||
|
|
using MongoRepository.Attributes;
|
||
|
|
using MongoRepository.Config;
|
||
|
|
|
||
|
|
namespace Domain.Admin.Admin
|
||
|
|
{
|
||
|
|
[BsonCollection("system_user", ServiceDatabases.Admin)]
|
||
|
|
[BsonIgnoreExtraElements]
|
||
|
|
public class SystemUser:MongoBaseEntity
|
||
|
|
{
|
||
|
|
[BsonElement("username")]
|
||
|
|
public string? UserName { get; set; }
|
||
|
|
|
||
|
|
|
||
|
|
[BsonElement("displayname")]
|
||
|
|
public string? DisplayName { get; set; }
|
||
|
|
|
||
|
|
[BsonElement("icon")]
|
||
|
|
public string? Icon { get; set; }
|
||
|
|
|
||
|
|
[BsonElement("password")]
|
||
|
|
public string? Password { get; set; }
|
||
|
|
|
||
|
|
|
||
|
|
[BsonElement("registertime")]
|
||
|
|
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
|
||
|
|
public DateTime RegisterTime { get; set; } = DateTime.Now;
|
||
|
|
|
||
|
|
[BsonElement("state")]
|
||
|
|
public int State { get; set; } = 1;
|
||
|
|
|
||
|
|
[BsonElement("systemrole")]
|
||
|
|
public BaseIdName SystemRole { get; set; }
|
||
|
|
|
||
|
|
|
||
|
|
public void Init()
|
||
|
|
{
|
||
|
|
Id = ObjectId.GenerateNewId().ToString();
|
||
|
|
State = 1;
|
||
|
|
RegisterTime=DateTime.Now;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|