초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Concurrent;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using META_ID = System.UInt32;
using OWNER_GUID = System.String;
using BUILDING_GUID = System.String;
namespace ServerCommon;
public class BuildingAttrib : AttribBase
{
[JsonProperty("building_guid")]
public BUILDING_GUID BuildingGuid { get; set; } = string.Empty;
[JsonProperty("building_meta_id")]
public META_ID BuildingMetaId { get; set; } = 0;
[JsonProperty("building_name")]
public string BuildingName { get; set; } = string.Empty;
[JsonProperty("description")]
public string Description { get; set; } = string.Empty;
[JsonProperty("owner_user_guid")]
public string OwnerUserGuid { get; set; } = string.Empty;
[JsonProperty]
public CurrencyType RentalCurrencyType { get; set; } = CurrencyType.None;
[JsonProperty]
[JsonConverter(typeof(StringToDoubleEpsilonRoundConverter))]
public double RentalCurrencyAmount { get; set; } = 0;
[JsonProperty]
public bool IsRentalOpen { get; set; } = false;
public BuildingAttrib()
: base(typeof(BuildingAttrib).Name)
{ }
}
//=============================================================================================
// PK(Partition Key) : "building#building_meta_id"
// SK(Sort Key) : ""
// DocType : BuildingDoc
// BuildingAttrib : {}
// ...
//=============================================================================================
public class BuildingDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "building#"; }
private static string getPrefixOfSK() { return ""; }
public BuildingDoc()
: base(typeof(BuildingDoc).Name)
{
appendAttribWrapperAll();
}
public BuildingDoc(META_ID buildingMetaId)
: base(typeof(BuildingDoc).Name)
{
setCombinationKeyForPK(buildingMetaId.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<BuildingAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
}

View File

@@ -0,0 +1,120 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class BuildingFloorAttrib : AttribBase
{
[JsonProperty("land_meta_id")]
public int LandMetaId { get; set; }
[JsonProperty("building_meta_id")]
public int BuildingMetaId { get; set; }
[JsonProperty("floor")]
public int Floor { get; set; }
[JsonProperty("owner_guid")]
public string OwnerGuid { get; set; } = string.Empty;
[JsonProperty("myhome_guid")]
public string MyhomeGuid { get; set; } = string.Empty;
[JsonProperty("instance_name")]
public string InstanceName { get; set; } = string.Empty;
[JsonProperty("thumbnail_image_id")]
public int ThumbnailImageId { get; set; }
[JsonProperty("list_image_id")]
public int ListImageId { get; set; }
[JsonProperty("enter_player_count")]
public int EnterPlayerCount { get; set; }
[JsonProperty("rental_period")]
public TimeSpan RentalPeriod { get; set; } = new();
[JsonProperty("rental_start_time")]
public DateTime RentalStartTime { get; set; } = new();
[JsonProperty("rental_finish_time")]
public DateTime RentalFinishTime { get; set; } = new();
public BuildingFloorAttrib()
: base(typeof(BuildingFloorAttrib).Name, false)
{ }
}
//=============================================================================================
// PK(Partition Key) : "building#building_meta_id"
// SK(Sort Key) : "floor#층넘버"
// DocType : BuildingFloorDoc
// MyHomeAttrib : {}
// ...
//=============================================================================================
public class BuildingFloorDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "building#"; }
public static string getPrefixOfSK() { return "floor#"; }
public BuildingFloorDoc()
: base(typeof(BuildingFloorDoc).Name)
{
appendAttribWrapperAll();
}
public BuildingFloorDoc(int buildingMetaId, int floor)
: base(typeof(BuildingFloorDoc).Name)
{
setCombinationKeyForPK(buildingMetaId.ToString());
setCombinationKeyForSK(floor.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
public BuildingFloorDoc(int buildingMetaId, int floor, long ttlSeconds)
: base(typeof(BuildingFloorDoc).Name, ttlSeconds)
{
setCombinationKeyForPK(buildingMetaId.ToString());
setCombinationKeyForSK(floor.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<BuildingFloorAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class BuildingProfitAttrib : AttribBase
{
[JsonProperty("building_meta_id")]
public int BuildingMetaId { get; set; }
[JsonProperty("floor")]
public int Floor { get; set; }
[JsonProperty("profit")]
public Dictionary<CurrencyType, double> Profits { get; set; } = new();
public BuildingProfitAttrib()
: base(typeof(BuildingProfitAttrib).Name, false)
{ }
}
//=============================================================================================
// PK(Partition Key) : "building#building_meta_id"
// SK(Sort Key) : "profit#floor"
// DocType : BuildingProfitDoc
// BuildingAttrib : {}
// ...
//=============================================================================================
public class BuildingProfitDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "building#"; }
public static string getPrefixOfSK() { return "profit#"; }
public BuildingProfitDoc()
: base(typeof(BuildingProfitAttrib).Name)
{
appendAttribWrapperAll();
}
public BuildingProfitDoc(int buildingMetaId, int floor)
: base(typeof(BuildingProfitAttrib).Name)
{
setCombinationKeyForPK(buildingMetaId.ToString());
setCombinationKeyForSK(floor.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<BuildingProfitAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class BuildingProfitHistoryAttrib : AttribBase
{
[JsonProperty("building_meta_id")]
public int BuildingMetaId { get; set; }
[JsonProperty("floor")]
public int Floor { get; set; } = 0;
[JsonProperty("profit_time")]
public DateTime ProfitTime { get; set; } = new();
[JsonProperty("profit_history_type")]
public ProfitHistoryType ProfitHistoryType { get; set; } = ProfitHistoryType.None;
[JsonProperty("profit")]
public Dictionary<CurrencyType, double> Profits { get; set; } = new();
public BuildingProfitHistoryAttrib()
: base(typeof(BuildingProfitHistoryAttrib).Name, false)
{ }
}
//=============================================================================================
// PK(Partition Key) : "building#building_meta_id"
// SK(Sort Key) : "profit_history#timestamp"
// DocType : BuildingProfitHistoryDoc
// BuildingAttrib : {}
// ...
//=============================================================================================
public class BuildingProfitHistoryDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "building#"; }
public static string getPrefixOfSK() { return "profit_history#"; }
public BuildingProfitHistoryDoc()
: base(typeof(BuildingProfitHistoryAttrib).Name)
{
appendAttribWrapperAll();
}
public BuildingProfitHistoryDoc(int buildingMetaId, Timestamp timestamp)
: base(typeof(BuildingProfitHistoryAttrib).Name)
{
setCombinationKeyForPK(buildingMetaId.ToString());
setCombinationKeyForSK(timestamp.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<BuildingProfitHistoryAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class BuildingRentalHistoryAttrib : AttribBase
{
[JsonProperty]
public int BuildingMetaId { get; set; }
[JsonProperty("floor")]
public int Floor { get; set; } = 0;
[JsonProperty("rentee_user_guid")]
public string RenteeUserGuid { get; set; } = string.Empty;
[JsonProperty("rental_time")]
public DateTime RentalTime { get; set; } = new();
[JsonProperty("rental_period")]
public int RentalPeriod { get; set; } = 0;
public BuildingRentalHistoryAttrib()
: base(typeof(BuildingRentalHistoryAttrib).Name, false)
{ }
}
//=============================================================================================
// PK(Partition Key) : "building#building_meta_id"
// SK(Sort Key) : "rental_history#timestamp"
// DocType : BuildingRentalHistoryDoc
// BuildingAttrib : {}
// ...
//=============================================================================================
public class BuildingRentalHistoryDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "building#"; }
public static string getPrefixOfSK() { return "rental_history#"; }
public BuildingRentalHistoryDoc()
: base(typeof(BuildingRentalHistoryAttrib).Name)
{
appendAttribWrapperAll();
}
public BuildingRentalHistoryDoc(int buildingMetaId, Timestamp timestamp)
: base(typeof(BuildingRentalHistoryAttrib).Name)
{
setCombinationKeyForPK(buildingMetaId.ToString());
setCombinationKeyForSK(timestamp.ToString());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<BuildingRentalHistoryAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
return ServerErrorCode.Success;
}
}