using Google.Protobuf.WellKnownTypes; 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; using MAIL_GUID = System.String; namespace ServerCommon; public class NoticeChatDetail { [JsonProperty] public LanguageType Languagetype { get; set; } = LanguageType.None; [JsonProperty] public string ChatMessage { get; set; } = string.Empty; } public class NoticeChatAttrib : AttribBase { [JsonProperty("chat_id")] public Int32 ChatId { get; set; } = 0; [JsonProperty("next_notice_time")] public DateTime NextNoticeTime { get; set; } = new(); [JsonProperty("repeat_minute_time")] public Int32 RepeatMinuteTime { get; set; } = 0; [JsonProperty("repeat_count")] public Int32 RepeatCount { get; set; } = 0; [JsonProperty("sender")] public string Sender { get; set; } = string.Empty; [JsonProperty("message_type")] public Int32 MessageType { get; set; } = 0; [JsonProperty("detail_list")] public List DetailList { get; set; } = new(); public NoticeChatAttrib() : base(typeof(NoticeChatAttrib).Name) { } } //============================================================================================= // PK(Partition Key) : "management_notice_chat#" // SK(Sort Key) : "notice_chat_id" // DocType : NoticeChatDoc // NoticeChatAttrib : {} // ... //============================================================================================= public class NoticeChatDoc : DynamoDbDocBase { public NoticeChatDoc() : base(typeof(NoticeChatDoc).Name) { setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL); appendAttribWrapperAll(); fillUpPrimaryKey(onMakePK(), onMakeSK()); } public NoticeChatDoc(string chat_id) : base(typeof(NoticeChatDoc).Name) { setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, chat_id); appendAttribWrapperAll(); fillUpPrimaryKey(onMakePK(), onMakeSK()); } private void appendAttribWrapperAll() { appendAttribWrapper(new AttribWrapper()); } protected override string onGetPrefixOfPK() { return "management_notice_chat#"; } protected override ServerErrorCode onCheckAndSetSK(string sortKey) { getPrimaryKey().fillUpSK(sortKey); setCombinationKeyForSK(sortKey); return ServerErrorCode.Success; } }