56 lines
2.0 KiB
C#
56 lines
2.0 KiB
C#
//using Amazon.DynamoDBv2.DocumentModel;
|
|
//using Newtonsoft.Json;
|
|
//using ServerCore; using ServerBase;
|
|
//using Google.Protobuf.WellKnownTypes;
|
|
|
|
|
|
//namespace ServerCommon.DB
|
|
//{
|
|
// public class UserReportAttr
|
|
// {
|
|
// public string ReporterGuid = string.Empty;
|
|
// public string ReporterNickName = string.Empty;
|
|
// public string TargetGuid = string.Empty;
|
|
// public string TargetNickName = string.Empty;
|
|
|
|
// public string Reason = string.Empty;
|
|
// public string Title = string.Empty;
|
|
// public string Detail = string.Empty;
|
|
// public int State = 0;
|
|
// public Timestamp CreateTime = new();
|
|
// public Timestamp ResolutionTime = new();
|
|
// }
|
|
|
|
// public class UserReportEntity
|
|
// {
|
|
// public string PK_Date { get; private set; } = string.Empty;
|
|
// public string SK_TimeNickName { get; private set; } = string.Empty;
|
|
// public UserReportAttr Attr { get; private set; } = new();
|
|
|
|
// public UserReportEntity(Document document)
|
|
// {
|
|
// ReadFrom(document);
|
|
// }
|
|
|
|
// void ReadFrom(Document document)
|
|
// {
|
|
// PK_Date = document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.UserReport), "");
|
|
// SK_TimeNickName = document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.UserReport), "");
|
|
|
|
// UserReportAttr? attr = JsonConvert.DeserializeObject<UserReportAttr>(document["Attr"].AsString());
|
|
// if (attr == null)
|
|
// throw new Exception("Attr DeserializeObject error");
|
|
|
|
// Attr = attr;
|
|
// }
|
|
|
|
// public Document DocumentForUpdate()
|
|
// {
|
|
// var document = new Document();
|
|
// document["PK"] = MainDB.MakePK(EEntityType.UserReport, PK_Date);
|
|
// document["SK"] = MainDB.MakeSK(EEntityType.UserReport, SK_TimeNickName);
|
|
// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
|
// return document;
|
|
// }
|
|
// }
|
|
//} |