초기커밋
This commit is contained in:
68
ServerCommon/Doc/OwnerContents/RentalInstanceVisitDoc.cs
Normal file
68
ServerCommon/Doc/OwnerContents/RentalInstanceVisitDoc.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class RentalInstanceVisitAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("rental_guid")]
|
||||
public Dictionary<string, DateTime> 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<RentalInstanceVisitAttrib>());
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user