56 lines
1.9 KiB
C#
56 lines
1.9 KiB
C#
//using Amazon.DynamoDBv2.DocumentModel;
|
|
//using Newtonsoft.Json;
|
|
//using ServerCore; using ServerBase;
|
|
|
|
//namespace ServerCommon.DB
|
|
//{
|
|
// public class SocialActionCollectionAttr
|
|
// {
|
|
// public HashSet<int> collectionInfos = new HashSet<int>();
|
|
// }
|
|
|
|
// public class SocialActionCollectionEntity
|
|
// {
|
|
// public string PK_Guid { get; private set; } = string.Empty;
|
|
// public string SK_Empty { get; private set; } = string.Empty;
|
|
// public SocialActionCollectionAttr Attr { get; private set; } = new SocialActionCollectionAttr();
|
|
|
|
// public SocialActionCollectionEntity() { }
|
|
|
|
// public SocialActionCollectionEntity(Document document)
|
|
// {
|
|
// if (!ReadFrom(document))
|
|
// {
|
|
// throw new Exception("Attr DeserializeObject error");
|
|
// }
|
|
// }
|
|
|
|
// public bool ReadFrom(Document document)
|
|
// {
|
|
// PK_Guid = document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.SocialActionCollection), "");
|
|
// SK_Empty = document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.SocialActionCollection), "");
|
|
|
|
// var attr = JsonConvert.DeserializeObject<SocialActionCollectionAttr>(document["Attr"].AsString());
|
|
// if (attr == null)
|
|
// {
|
|
// Log.getLogger().error($"{PK_Guid} Attr DeserializeObject error");
|
|
// return false;
|
|
// }
|
|
|
|
// Attr = attr;
|
|
|
|
// return true;
|
|
// }
|
|
|
|
// public Document DocumentForUpdate()
|
|
// {
|
|
// var document = new Document();
|
|
// document["PK"] = MainDB.MakePK(EEntityType.SocialActionCollection, PK_Guid);
|
|
// document["SK"] = MainDB.MakeSK(EEntityType.SocialActionCollection, SK_Empty);
|
|
// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
|
|
|
// return document;
|
|
// }
|
|
// }
|
|
//}
|