초기커밋
This commit is contained in:
77
ServerCommon/Doc/Global/CaliumConverterForUserDoc.cs
Normal file
77
ServerCommon/Doc/Global/CaliumConverterForUserDoc.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CaliumConverterForUserAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("data")] public Dictionary<USER_GUID, double> UserCalium { get; set; } = new();
|
||||
|
||||
public CaliumConverterForUserAttrib() : base(nameof(CaliumConverterForUserAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
|
||||
// PK(Partition Key) : "caliumconverter#user"
|
||||
// SK(Sort Key) : "dd"
|
||||
// DocType : CaliumConverterForUserDoc
|
||||
// Attrib : CaliumConverterForUserAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumConverterForUserDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "caliumconverter#user";
|
||||
|
||||
private static string getPrefixOfPK() => "";
|
||||
private static string getPrefixOfSK() => "";
|
||||
|
||||
public CaliumConverterForUserDoc(int day, Int64 ttlSeconds) : base(nameof(CaliumConverterForUserDoc), ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForSK(day.ToString());
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CaliumConverterForUserDoc() : base(nameof(CaliumConverterForUserDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumConverterForUserAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user