106 lines
3.7 KiB
C#
106 lines
3.7 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 enum EMailType
|
|
//// {
|
|
//// RECEIVED_MAIL = 1,
|
|
//// SENDED_MAIL = 2,
|
|
//// }
|
|
|
|
//// public class MailEntityAttr
|
|
//// {
|
|
//// public string mailKey = string.Empty;
|
|
//// public bool isRead;
|
|
//// public bool isGetItem;
|
|
//// public bool isSystemMail;
|
|
//// public string senderNickName = string.Empty;
|
|
//// public string senderGuid = string.Empty;
|
|
//// public string receiverNickName = string.Empty;
|
|
//// public string receiverGuid = string.Empty;
|
|
//// public string title = string.Empty;
|
|
//// public string text = string.Empty;
|
|
//// public Timestamp createTime = new();
|
|
//// public Timestamp expireTime = new();
|
|
//// public List<MailItem> ItemList = new();
|
|
//// }
|
|
|
|
//// public class MailEntity
|
|
//// {
|
|
//// public string PK_Guid { get; private set; } = string.Empty;
|
|
//// public string SK_DateSequence { get; private set; } = string.Empty;
|
|
//// public MailEntityAttr Attr { get; private set; } = new();
|
|
//// public string TTL { get; private set; } = string.Empty; //MUSTBE: TTL에 의해 메일이 삭제될 경우 메일 삭제 비즈니스 로그를 남기지 못한다. !!! - kangms
|
|
|
|
//// public EEntityType entityType { get; protected set; } = EEntityType.ReceivedMail;
|
|
|
|
//// public MailEntity()
|
|
//// {
|
|
//// }
|
|
//// public MailEntity(Document document)
|
|
//// {
|
|
//// ReadFrom(document);
|
|
//// }
|
|
|
|
//// public void ReadFrom(Document document)
|
|
//// {
|
|
//// PK_Guid = document["PK"].AsString().Replace(MainDB.GetPKPrefix(entityType), "");
|
|
//// SK_DateSequence = document["SK"].AsString().Replace(MainDB.GetSKPrefix(entityType), "");
|
|
//// if (document.ContainsKey("TTL"))
|
|
//// {
|
|
//// document["TTL"].AsString();
|
|
//// }
|
|
//// else TTL = string.Empty;
|
|
|
|
|
|
//// MailEntityAttr? attr = JsonConvert.DeserializeObject<MailEntityAttr>(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(entityType, PK_Guid);
|
|
//// document["SK"] = MainDB.MakeSK(entityType, SK_DateSequence);
|
|
//// document["TTL"] = TTL;
|
|
//// document["Attr"] = JsonConvert.SerializeObject(Attr);
|
|
//// return document;
|
|
//// }
|
|
//// public Document DocumentForDelete()
|
|
//// {
|
|
//// var document = new Document();
|
|
//// document["PK"] = MainDB.MakePK(entityType, PK_Guid);
|
|
//// document["SK"] = MainDB.MakeSK(entityType, SK_DateSequence);
|
|
//// return document;
|
|
//// }
|
|
//// }
|
|
|
|
//// public class ReceivedMailEntity : MailEntity
|
|
//// {
|
|
//// public ReceivedMailEntity(Document document)
|
|
//// {
|
|
//// entityType = EEntityType.ReceivedMail;
|
|
//// ReadFrom(document);
|
|
//// }
|
|
//// }
|
|
|
|
//// public class SendedMailEntity : MailEntity
|
|
//// {
|
|
//// public SendedMailEntity(Document document)
|
|
//// {
|
|
//// entityType = EEntityType.SendedMail;
|
|
//// ReadFrom(document);
|
|
//// }
|
|
//// }
|
|
////}
|