Files
2025-05-01 07:20:41 +09:00

62 lines
1.6 KiB
C#

using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class RepeatQuestAttrib : AttribBase
{
[JsonProperty("next_allocate_time")]
public DateTime m_next_allocate_time { get; set; } = new();
[JsonProperty("is_checking")]
public Int32 m_is_checking { get; set; } = 0;
public RepeatQuestAttrib()
: base(typeof(RepeatQuestAttrib).Name)
{}
}
//=============================================================================================
// PK(Partition Key) : "repeat_quest#owner_guid"
// SK(Sort Key) :
// DocType : RepeatQuestDoc
// RepeatQuestAttrib : {}
// ...
//=============================================================================================
public class RepeatQuestDoc : DynamoDbDocBase
{
public RepeatQuestDoc()
: base(typeof(RepeatQuestDoc).Name)
{
appendAttribWrapper(new AttribWrapper<RepeatQuestAttrib>());
}
public RepeatQuestDoc(string guid)
: base(typeof(RepeatQuestDoc).Name)
{
setCombinationKeyForPK(guid);
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapper(new AttribWrapper<RepeatQuestAttrib>());
}
protected override string onGetPrefixOfPK()
{
return "repeat_quest#";
}
protected override string onMakePK()
{
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
}
protected override ServerErrorCode onCheckAndSetPK(string pk)
{
getPrimaryKey().fillUpPK(pk);
return ServerErrorCode.Success;
}
}