초기커밋
This commit is contained in:
63
ServerCommon/Doc/OwnerContents/SwitchingPropDoc.cs
Normal file
63
ServerCommon/Doc/OwnerContents/SwitchingPropDoc.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class SwitchingPropAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("switching_props")]
|
||||
public ConcurrentDictionary<Int32,Int32> m_switching_props { get; set; } = new();
|
||||
|
||||
public SwitchingPropAttrib()
|
||||
: base(typeof(SwitchingPropAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "switching_prop#owner_guid"
|
||||
// SK(Sort Key) : empty
|
||||
// DocType : SwitchingPropDoc
|
||||
//=============================================================================================
|
||||
public class SwitchingPropDoc : DynamoDbDocBase
|
||||
{
|
||||
public SwitchingPropDoc() : base(typeof(SwitchingPropDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public SwitchingPropDoc(string guid) : base(typeof(SwitchingPropDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SwitchingPropAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "switching_prop#";
|
||||
}
|
||||
|
||||
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