초기커밋
This commit is contained in:
58
ServerCommon/z.Backup/LandEntity.cs
Normal file
58
ServerCommon/z.Backup/LandEntity.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
//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 LandAttr
|
||||
// {
|
||||
// public string Owner = string.Empty;
|
||||
// public string Name = string.Empty;
|
||||
// public string Description = string.Empty;
|
||||
// public int BuildingId;
|
||||
// public Dictionary<string, AnchorProp> PropInfo = new();
|
||||
// public DateTime NFTUpdateTime;
|
||||
// }
|
||||
|
||||
// public class LandEntity
|
||||
// {
|
||||
// public int PK_Id { get; private set; } = 0;
|
||||
// public int SK_Id { get; private set; } = 0;
|
||||
// public LandAttr Attr { get; private set; } = new();
|
||||
|
||||
// public LandEntity(Document document)
|
||||
// {
|
||||
// ReadFrom(document);
|
||||
// }
|
||||
|
||||
// void ReadFrom(Document document)
|
||||
// {
|
||||
// if (!int.TryParse(document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.Land), ""), out var pk))
|
||||
// throw new Exception("PK int.TryParse error");
|
||||
|
||||
// if (!int.TryParse(document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.Land), ""), out var sk))
|
||||
// throw new Exception("SK int.TryParse error");
|
||||
|
||||
// LandAttr? attr = JsonConvert.DeserializeObject<LandAttr>(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.Land, PK_Id.ToString());
|
||||
// document["SK"] = MainDB.MakeSK(EEntityType.Land, SK_Id.ToString());
|
||||
// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
||||
// return document;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user