using FreeSql.DataAnnotations; namespace F9WebAiTest.Domain.Entities.SYS.RBAC; /// /// 用户角色关联:用户与角色的多对多关系。 /// DDD 中作为独立关联实体,应用层直接操作其仓储(不通过 User 聚合)。 /// [Table(Name = "sys_rbac_user_roles")] public class UserRole : BusinessEntity { [Column(Name = "user_id")] public long UserId { get; private set; } [Column(Name = "role_id")] public long RoleId { get; private set; } public UserRole() { } public UserRole(long id, long userId, long roleId) { Id = id; UserId = userId; RoleId = roleId; CreatedAt = DateTime.UtcNow; } }