From 9efddf46005b136308d70eae3211df9c23e800a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=8C=90=EB=8F=8C?= Date: Mon, 18 Mar 2024 21:06:04 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=EC=A0=90=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/SQL/ShopItem.cs | 32 ++++++++++++++++++++++++++++++++ Server/Service/Login.cs | 9 ++++++--- Server/System/Statics.cs | 1 + 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 Server/SQL/ShopItem.cs diff --git a/Server/SQL/ShopItem.cs b/Server/SQL/ShopItem.cs new file mode 100644 index 0000000..9617bb8 --- /dev/null +++ b/Server/SQL/ShopItem.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Server.SQL +{ + [Table("shop_item", Schema = "gamedb")] + public class ShopItem + { + [JsonIgnore] + public long user_id { get; set; } + public long id { get; set; } + public long shop_item_data_id { get; set; } + public DateTime end_date { get; set; } + } + + public class ShopItemSQL : SQL + { + public override DbSet table { get; set; } + + public void Update(ShopItem ShopItem) + { + table.Update(ShopItem); + } + + public override List SelectUid(long user_id) + { + //현재 시간도 비교해서 이전날자가 들어가지 않게 하기 + return table.Where(data => data.user_id == user_id).ToList(); + } + } +} diff --git a/Server/Service/Login.cs b/Server/Service/Login.cs index 1787102..a6eb7ae 100644 --- a/Server/Service/Login.cs +++ b/Server/Service/Login.cs @@ -92,7 +92,8 @@ namespace Server.Service #endregion } #endregion - #region 리셋 상점 세팅 + #region 상점 세팅 + //리셋 상점 List resetShopItem = Statics.resetShopItemSQL.SelectUid(user.id); List addItem = new List(); List shopItemData = null; @@ -243,9 +244,11 @@ namespace Server.Service Statics.resetShopItemSQL.SaveChanges(); resetShopItem.AddRange(addItem); } + //상점 구매 목록 + List shopItem = Statics.shopItemSQL.SelectUid(user.id); #endregion - return makeResp(user, dynamicDataList, deckInfoList, itemManager, newUser, resetShopItem); + return makeResp(user, dynamicDataList, deckInfoList, itemManager, newUser, resetShopItem, shopItem); } public override Protocol ProtocolValue() => Protocol.Login; @@ -256,7 +259,7 @@ namespace Server.Service return req; } - private string makeResp(User user, List dynamicData, List deckInfo, ItemManager itemManager, bool newUser, List resetShopItem) + private string makeResp(User user, List dynamicData, List deckInfo, ItemManager itemManager, bool newUser, List resetShopItem, List shopItem) { LoginResp resp = new LoginResp(); resp.nickname = user.nickname; diff --git a/Server/System/Statics.cs b/Server/System/Statics.cs index 6f9c128..1a3919e 100644 --- a/Server/System/Statics.cs +++ b/Server/System/Statics.cs @@ -30,6 +30,7 @@ namespace Server.System public static ConsumableItemSQL consumableItemSQL = new ConsumableItemSQL(); public static EtcItemSQL etcItemSQL = new EtcItemSQL(); public static ResetShopItemSQL resetShopItemSQL = new ResetShopItemSQL(); + public static ShopItemSQL shopItemSQL = new ShopItemSQL(); //DATA public static EquipmentDataExcel equipmentExcel = new EquipmentDataExcel();