초기커밋

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,39 @@

using ServerBase;
using MetaAssets;
namespace ServerCommon;
public static class ShopValidator
{
[MetaValidator]
public static void Validate(ShopMetaData shop, ValidatorErrorCollection errors)
{
// 1. resetTime
if(shop.ResetTime <= 0)
errors.add($"Invalid shop : reset time is invalid [{shop.ResetTime}]");
// 2. product group
if(false == CommonValidator.isExistProductGroupId(shop.ShopProduct_Group_Id))
errors.add($"Invalid shop : product group id is invalid [{shop.ShopProduct_Group_Id}]");
}
[MetaValidator]
public static void Validate(ShopProductMetaData shopProduct, ValidatorErrorCollection errors)
{
// 1. Buy 정보 체크
if(shopProduct.Buy_Price_Type == ShopBuyType.Currency && false == CommonValidator.isExistCurrencyId(shopProduct.Buy_Id))
errors.add($"Invalid shop product : buy currency type is invalid - [{shopProduct.Buy_Id}]");
if(shopProduct.Buy_Price_Type == ShopBuyType.Item && false == CommonValidator.isExistItemId(shopProduct.Buy_Id))
errors.add($"Invalid shop product : buy item id is not exist - [{shopProduct.Buy_Id}]");
// 2. Product 정보 체크
if(shopProduct.ProductData.Currency != null && false == CommonValidator.isExistCurrencyId(shopProduct.ProductData.Currency.Id))
errors.add($"Invalid shop product : product currency type is invalid - [{shopProduct.ProductData.Currency.Id}]");
if(shopProduct.ProductData.Item != null && false == CommonValidator.isExistItemId(shopProduct.ProductData.Item.Id))
errors.add($"Invalid shop product : product item id is not exist - [{shopProduct.ProductData.Item.Id}]");
}
}