59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
//using Newtonsoft.Json;
|
|
//using Amazon.DynamoDBv2.DocumentModel;
|
|
//using System;
|
|
//using System.Collections.Generic;
|
|
//using System.Linq;
|
|
//using System.Text;
|
|
//using System.Threading.Tasks;
|
|
//using Google.Protobuf.WellKnownTypes;
|
|
|
|
//namespace ServerCommon.DB
|
|
//{
|
|
// public class ShopInfo
|
|
// {
|
|
// public List<ShopItemInfo> ShopItemList = new();
|
|
// public Timestamp EndTime = Timestamp.FromDateTime(DateTime.UtcNow);
|
|
// }
|
|
|
|
// public class MyShopEntityAttr
|
|
// {
|
|
// public Dictionary<int, ShopInfo> shopInfo = new();
|
|
// }
|
|
// public class MyShopEntity
|
|
// {
|
|
// public string PK_Guid { get; private set; } = string.Empty;
|
|
// public string SK_Empty { get; private set; } = string.Empty;
|
|
|
|
// public MyShopEntityAttr Attr { get; private set; } = new();
|
|
|
|
// public MyShopEntity()
|
|
// {
|
|
|
|
// }
|
|
// public MyShopEntity(Document document)
|
|
// {
|
|
// ReadFrom(document);
|
|
// }
|
|
|
|
// public void ReadFrom(Document document)
|
|
// {
|
|
// PK_Guid = document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.MyShop), "");
|
|
// SK_Empty = document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.MyShop), "");
|
|
|
|
// MyShopEntityAttr? attr = JsonConvert.DeserializeObject<MyShopEntityAttr>(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.MyShop, PK_Guid);
|
|
// document["SK"] = MainDB.MakeSK(EEntityType.MyShop, SK_Empty);
|
|
// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
|
// return document;
|
|
// }
|
|
// }
|
|
//}
|