71 lines
1.5 KiB
C#
71 lines
1.5 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.ComponentModel.DataAnnotations.Schema;
|
|||
|
using System.Data.Entity;
|
|||
|
using System.Data.Entity.ModelConfiguration;
|
|||
|
|
|||
|
namespace ChatRoomServer.Db.Entities
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
///举报记录
|
|||
|
///</summary>
|
|||
|
public class AbuseReport
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// ID
|
|||
|
/// </summary>
|
|||
|
public int Id { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 举报人
|
|||
|
/// </summary>
|
|||
|
public string ReportUser { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 举报时间
|
|||
|
/// </summary>
|
|||
|
public DateTime ReportTime { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 举报内容
|
|||
|
/// </summary>
|
|||
|
public long TargetId { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 举报对象
|
|||
|
/// </summary>
|
|||
|
public string TargetUser { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 举报记录状态:0-未处理;1-已处理;2-无效;3-已自动处理
|
|||
|
/// </summary>
|
|||
|
public ReportState Status { get; set; } = ReportState.Submited;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public enum ReportState : byte
|
|||
|
{
|
|||
|
Submited = 0,
|
|||
|
Processed = 1,
|
|||
|
Invalid = 2,
|
|||
|
AutoProcessed = 3
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 实体类 <see cref="AbuseReport" /> 的配置对象
|
|||
|
/// </summary>
|
|||
|
internal class AbuseReportConfiguration : EntityTypeConfiguration<AbuseReport>
|
|||
|
{
|
|||
|
public AbuseReportConfiguration()
|
|||
|
{
|
|||
|
ToTable("Chat_AbuseReport");
|
|||
|
HasKey(m => m.Id);
|
|||
|
Property(s => s.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
|
|||
|
Property(s => s.ReportUser).HasMaxLength(200).IsRequired();
|
|||
|
Property(s => s.TargetUser).HasMaxLength(200).IsRequired();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|