using Newtonsoft.Json; using ServerCore; using ServerBase; using USER_GUID = System.String; namespace ServerCommon; public class CraftHelpAttrib : AttribBase { [JsonProperty("help_user_guids")] public List HelpUserGuids { get; set; } = new(); [JsonProperty("helped_user_guids")] public List HelpedUserGuids { get; set; } = new(); [JsonProperty("craft_help_updateday")] public DateTime CraftHelpUpdateDay { get; set; } = DateTime.UtcNow; public CraftHelpAttrib() : base(typeof(CraftHelpAttrib).Name) { } } //============================================================================================= // PK(Partition Key) : "crafthelp#user_guid" // SK(Sort Key) : "" // DocType : CraftHelpDoc // Attrib : CraftHelpAttrib // ... //============================================================================================= public class CraftHelpDoc : DynamoDbDocBase { private static string getPrefixOfPK() { return "crafthelp#"; } public CraftHelpDoc() : base(typeof(CraftHelpDoc).Name) { appendAttribWrapperAll(); } public CraftHelpDoc(string ownerGuid) : base(typeof(CraftHelpDoc).Name) { setCombinationKeyForPK(ownerGuid); appendAttribWrapperAll(); fillUpPrimaryKey(onMakePK(), onMakeSK()); setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftHelpDocException)); } private void appendAttribWrapperAll() { appendAttribWrapper(new AttribWrapper()); } protected override string onGetPrefixOfPK() { return getPrefixOfPK(); } }