using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using ServerCore; using ServerBase; using SESSION_ID = System.Int32; using META_ID = System.UInt32; using ENTITY_GUID = System.String; using ACCOUNT_ID = System.String; using OWNER_GUID = System.String; using USER_GUID = System.String; using CHARACTER_GUID = System.String; using ITEM_GUID = System.String; namespace ServerCommon; public class MailProfileAttrib : AttribBase { [JsonProperty("send_mail_count")] public Int32 SendMailCount { get; set; } = 0; [JsonProperty("send_mail_updateday")] public Int64 SendMailUpdateDay { get; set; } = 0; [JsonProperty("last_systemmail_id")] public Int32 LastSystemMailId { get; set; } = 0; [JsonProperty("received_system_mails")] public Dictionary ReceivedSystemMails { get; set; } = new(); public MailProfileAttrib() : base(typeof(MailProfileAttrib).Name) { } } //============================================================================================= // PK(Partition Key) : "mail_profile#user_guid" // SK(Sort Key) : "" // DocType : MailProfileDoc // MailProfileAttrib : {} // ... //============================================================================================= public class MailProfileDoc : DynamoDbDocBase { public MailProfileDoc() : base(typeof(MailProfileDoc).Name) { appendAttribWrapperAll(); } public MailProfileDoc(string ownerGuid) : base(typeof(MailProfileDoc).Name) { setCombinationKeyForPK(ownerGuid); appendAttribWrapperAll(); fillUpPrimaryKey(onMakePK(), onMakeSK()); setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.MailProfileDocException)); } private void appendAttribWrapperAll() { appendAttribWrapper(new AttribWrapper()); } protected override string onGetPrefixOfPK() { return "mail_profile#"; } }