신규 아이탬 상점 정보 업데이트 쿼리 생성

This commit is contained in:
김판돌 2024-03-13 21:54:27 +09:00
parent e524aa6419
commit 844cf559aa
5 changed files with 97 additions and 0 deletions

View File

@ -194,6 +194,12 @@ namespace Server.Git
Statics.consumableItemExcel.init(sheets[index]);
}
index = sheets.FindIndex(n => n.name == Statics.resetShopItemExcel.sheetName);
if (index != 0)
{
Statics.resetShopItemExcel.init(sheets[index]);
}
}
}
}

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations.Schema;
namespace Server.SQL
{
[Table("reset_shop_item", Schema = "gamedb")]
public class ResetShopItem
{
[JsonIgnore]
public long user_id { get; set; }
public long id { get; set; }
public long reset_shop_item_data_id { get; set; }
public string name { get; set; }
public long shop_index { get; set; }
public eBuyType buy_type { get; set; }
public int buy { get; set; }
public long reward { get; set; }
public int buy_count { get; set; }
public int count { get; set; }
public DateTime end_date { get; set; }
}
public class ResetShopItemSQL : SQL<ResetShopItem>
{
public override DbSet<ResetShopItem> table { get; set; }
public void Update(ResetShopItem ResetShopItem)
{
table.Update(ResetShopItem);
}
public override List<ResetShopItem> SelectUid(long user_id)
{
//현재 시간도 비교해서 이전날자가 들어가지 않게 하기
return table.Where(data => data.user_id == user_id).ToList();
}
}
}

View File

@ -0,0 +1,50 @@
using Server.Git;
using System.ComponentModel.DataAnnotations;
namespace Server.SQL
{
public class ResetShopItemData
{
[Key]
public long index { get; set; }
public string name { get; set; }
public long shop_index { get; set; }
public eBuyType buy_type { get; set; }
public int buy { get; set; }
public long reward { get; set; }
public int buy_count { get; set; }
}
public class ResetShopItemDataExcel
{
private Dictionary<long, ResetShopItemData> resetShopItemData;
public string sheetName = "ResetShopItemData";
public ResetShopItemData getResetShopItemData(long key)
{
return resetShopItemData[key];
}
public List<ResetShopItemData> getResetShopItemData()
{
return resetShopItemData.Values.ToList();
}
public void init(Sheet data)
{
this.resetShopItemData = new Dictionary<long, ResetShopItemData>();
foreach (var item in data.dicViewer)
{
ResetShopItemData resetShopItemData = new ResetShopItemData();
resetShopItemData.index = item.Key;
resetShopItemData.name = (string)item.Value["name"];
resetShopItemData.shop_index = (int)item.Value["shop_index"];
resetShopItemData.buy_type = (eBuyType)item.Value["buy_type"];
resetShopItemData.buy = (int)item.Value["buy"];
resetShopItemData.reward = (int)item.Value["reward"];
resetShopItemData.buy_count = (int)item.Value["buy_count"];
this.resetShopItemData.Add(item.Key, resetShopItemData);
}
}
}
}

View File

@ -57,6 +57,7 @@ namespace Server.Service
user.uuid = Guid.NewGuid().ToString();
user.nickname = Statics.dynamicDataSQL.SelectName("defaultNick").value;
Statics.userSQL.Insert(user); //저장하고 유닛의 id를 얻어오기 위함.
Statics.userSQL.SaveChanges();
itemManager = new ItemManager(user);
#endregion
#region

View File

@ -34,5 +34,6 @@ namespace Server.System
public static RewardDataExcel rewardExcel = new RewardDataExcel();
public static ShopItemDataExcel shopItemExcel = new ShopItemDataExcel();
public static ConsumableItemDataExcel consumableItemExcel = new ConsumableItemDataExcel();
public static ResetShopItemDataExcel resetShopItemExcel = new ResetShopItemDataExcel();
}
}