초기커밋
This commit is contained in:
69
ServerCommon/Doc/OwnerContents/CraftRecipeDoc.cs
Normal file
69
ServerCommon/Doc/OwnerContents/CraftRecipeDoc.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CraftRecipeAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("craft_meta_id")]
|
||||
public META_ID CraftMetaId { get; set; } = 0;
|
||||
|
||||
public CraftRecipeAttrib()
|
||||
: base(typeof(CraftRecipeAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "craftrecipe#user_guid"
|
||||
// SK(Sort Key) : "craft_meta_id"
|
||||
// DocType : CraftRecipeDoc
|
||||
// CraftRecipeAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CraftRecipeDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "craftrecipe#"; }
|
||||
|
||||
public CraftRecipeDoc()
|
||||
: base(typeof(CraftRecipeDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CraftRecipeDoc(string ownerGuid, META_ID craftMetaId)
|
||||
: base(typeof(CraftRecipeDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, craftMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftRecipeDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CraftRecipeAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user