using Newtonsoft.Json; using ServerCore; using ServerBase; namespace ServerCommon; public class RentalInstanceVisitAttrib : AttribBase { [JsonProperty("rental_guid")] public Dictionary m_rental_instance_visit_guid { get; set; } = new(); [JsonProperty("next_refresh_time")] public DateTime m_next_refresh_time { get; set; } = DateTime.Now; public RentalInstanceVisitAttrib() : base(typeof(RentalInstanceVisitAttrib).Name) { } } //============================================================================================= // PK(Partition Key) : "rental_instance_visit#owner_guid" // SK(Sort Key) : // DocType : RentalInstanceVisitDoc //============================================================================================= public class RentalInstanceVisitDoc : DynamoDbDocBase { public RentalInstanceVisitDoc() : base(typeof(RentalInstanceVisitDoc).Name) { appendAttribWrapperAll(); } public RentalInstanceVisitDoc(string guid) : base(typeof(RentalInstanceVisitDoc).Name) { setCombinationKeyForPK(guid); appendAttribWrapperAll(); fillUpPrimaryKey(onMakePK(), onMakeSK()); } private void appendAttribWrapperAll() { appendAttribWrapper(new AttribWrapper()); } protected override string onGetPrefixOfPK() { return "rental_instance_visit#"; } protected override string onMakePK() { return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}"; } protected override ServerErrorCode onCheckAndSetPK(string pk) { getPrimaryKey().fillUpPK(pk); return ServerErrorCode.Success; } }