초기커밋
This commit is contained in:
56
ServerCommon/z.Backup/RoomEntity.cs
Normal file
56
ServerCommon/z.Backup/RoomEntity.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using Amazon.DynamoDBv2.DocumentModel;
|
||||
//using Newtonsoft.Json;
|
||||
|
||||
//namespace ServerCommon.DB
|
||||
//{
|
||||
// public class RoomAttr
|
||||
// {
|
||||
// public string Owner = string.Empty;
|
||||
// public string Name = string.Empty;
|
||||
// public string Description = string.Empty;
|
||||
// public Dictionary<string, AnchorProp> PropInfo = new();
|
||||
// }
|
||||
|
||||
// public class RoomEntity
|
||||
// {
|
||||
// public int PK_Id { get; private set; } = 0;
|
||||
// public int SK_Id { get; private set; } = 0;
|
||||
// public RoomAttr Attr { get; private set; } = new();
|
||||
|
||||
// public RoomEntity(Document document)
|
||||
// {
|
||||
// ReadFrom(document);
|
||||
// }
|
||||
|
||||
// void ReadFrom(Document document)
|
||||
// {
|
||||
// if (!int.TryParse(document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.Room), ""), out var pk))
|
||||
// throw new Exception("PK int.TryParse error");
|
||||
|
||||
// if (!int.TryParse(document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.Room), ""), out var sk))
|
||||
// throw new Exception("SK int.TryParse error");
|
||||
|
||||
// RoomAttr? attr = JsonConvert.DeserializeObject<RoomAttr>(document["Attr"].AsString());
|
||||
// if (attr == null)
|
||||
// throw new Exception("Attr DeserializeObject error");
|
||||
|
||||
// PK_Id = pk;
|
||||
// SK_Id = sk;
|
||||
// Attr = attr;
|
||||
// }
|
||||
|
||||
// public Document DocumentForUpdate()
|
||||
// {
|
||||
// var document = new Document();
|
||||
// document["PK"] = MainDB.MakePK(EEntityType.Room, PK_Id.ToString());
|
||||
// document["SK"] = MainDB.MakeSK(EEntityType.Room, SK_Id.ToString());
|
||||
// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
||||
// return document;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user