초기커밋
This commit is contained in:
67
ServerCommon/Doc/OwnerContents/CraftHelpDoc.cs
Normal file
67
ServerCommon/Doc/OwnerContents/CraftHelpDoc.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CraftHelpAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("help_user_guids")]
|
||||
public List<USER_GUID> HelpUserGuids { get; set; } = new();
|
||||
|
||||
[JsonProperty("helped_user_guids")]
|
||||
public List<USER_GUID> HelpedUserGuids { get; set; } = new();
|
||||
|
||||
[JsonProperty("craft_help_updateday")]
|
||||
public DateTime CraftHelpUpdateDay { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public CraftHelpAttrib()
|
||||
: base(typeof(CraftHelpAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "crafthelp#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CraftHelpDoc
|
||||
// Attrib : CraftHelpAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CraftHelpDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "crafthelp#"; }
|
||||
|
||||
public CraftHelpDoc()
|
||||
: base(typeof(CraftHelpDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CraftHelpDoc(string ownerGuid)
|
||||
: base(typeof(CraftHelpDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftHelpDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CraftHelpAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user