84 lines
2.4 KiB
C#
84 lines
2.4 KiB
C#
using System;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
|
|
|
|
namespace ServerCommon;
|
|
|
|
|
|
using META_ID = System.UInt32;
|
|
using LAND_AUCTION_NUMBER = System.Int32;
|
|
|
|
|
|
public class LandAuctionActivityAttrib : AttribBase
|
|
{
|
|
[JsonProperty("land_meta_id")]
|
|
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
|
|
|
|
[JsonProperty("auction_number")]
|
|
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
|
|
|
|
public LandAuctionActivityAttrib()
|
|
: base(nameof(LandAuctionActivityAttrib), false)
|
|
{
|
|
}
|
|
}
|
|
|
|
//=============================================================================================
|
|
// Desc : 활성화중인 랜드 경매별 등록 정보
|
|
// Primary Key
|
|
// PK(Partition Key) : land_auction_activity#global
|
|
// SK(Sort Key) : "{land_meta_id}"
|
|
// DocType : LandAuctionActiveDoc
|
|
// Attrib : LandAuctionActiveAttrib
|
|
// ...
|
|
//=============================================================================================
|
|
public class LandAuctionActivityDoc : DynamoDbDocBase
|
|
{
|
|
private static string getPrefixOfPK() => "land_auction_activity#";
|
|
|
|
public LandAuctionActivityDoc() :
|
|
base(nameof(LandAuctionActivityDoc))
|
|
{
|
|
appendAttribWrapperAll();
|
|
}
|
|
|
|
public LandAuctionActivityDoc(META_ID landMetaId)
|
|
: base(nameof(LandAuctionActivityDoc))
|
|
{
|
|
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
|
setCombinationKeyForSK(landMetaId.ToString());
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
|
|
appendAttribWrapperAll();
|
|
|
|
var land_auction_activity_attrib = getAttrib<LandAuctionActivityAttrib>();
|
|
NullReferenceCheckHelper.throwIfNull(land_auction_activity_attrib, () => $"land_auction_activity_attrib is null !!!");
|
|
|
|
land_auction_activity_attrib.LandMetaId = landMetaId;
|
|
}
|
|
|
|
private void appendAttribWrapperAll()
|
|
{
|
|
appendAttribWrapper(new AttribWrapper<LandAuctionActivityAttrib>());
|
|
}
|
|
|
|
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
|
|
|
protected override string onMakeSK()
|
|
{
|
|
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
|
}
|
|
|
|
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
|
{
|
|
getPrimaryKey().fillUpSK(sortKey);
|
|
setCombinationKeyForSK(sortKey);
|
|
return ServerErrorCode.Success;
|
|
}
|
|
} |