초기커밋
This commit is contained in:
74
ServerCommon/Doc/OwnerContents/SeasonPassDoc.cs
Normal file
74
ServerCommon/Doc/OwnerContents/SeasonPassDoc.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class SeasonPassAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public META_ID SeasonPassMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public UInt32 Exp { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public Int32 Grade { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public List<Int32> takenRewards { get; set; } = new();
|
||||
|
||||
[JsonProperty]
|
||||
public bool IsChargedPass { get; set; } = false;
|
||||
|
||||
public SeasonPassAttrib()
|
||||
: base(typeof(SeasonPassAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "season_pass#owner_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : SeasonPassDoc
|
||||
// Attrib : SeasonPassAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class SeasonPassDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "season_pass#"; }
|
||||
|
||||
public SeasonPassDoc()
|
||||
: base(typeof(SeasonPassDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public SeasonPassDoc(string ownerGuid)
|
||||
: base(typeof(SeasonPassDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.SeasonPassDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SeasonPassAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user