초기커밋
This commit is contained in:
72
ServerCommon/Doc/OwnerContents/TaskReservationDoc.cs
Normal file
72
ServerCommon/Doc/OwnerContents/TaskReservationDoc.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using RESERVATION_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class TaskReservationAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public RESERVATION_GUID ReservationGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public TaskReservationActionType ReservationType { get; set; } = TaskReservationActionType.None;
|
||||
|
||||
[JsonProperty]
|
||||
public string JsonValue { get; set; } = string.Empty;
|
||||
|
||||
public TaskReservationAttrib()
|
||||
: base(typeof(TaskReservationAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "taskReservation#owner_guid"
|
||||
// SK(Sort Key) : "reservation_guid"
|
||||
// DocType : TaskReservationDoc
|
||||
// Attrib : TaskReservationAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class TaskReservationDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "taskReservation#"; }
|
||||
|
||||
public TaskReservationDoc()
|
||||
: base(typeof(TaskReservationDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public TaskReservationDoc(string ownerGuid, RESERVATION_GUID reservationGuid)
|
||||
: base(typeof(TaskReservationDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, reservationGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<TaskReservationAttrib>());
|
||||
}
|
||||
|
||||
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