상점 목록 작업

This commit is contained in:
김판돌 2024-03-18 21:06:04 +09:00
parent 1247c76f66
commit 9efddf4600
3 changed files with 39 additions and 3 deletions

32
Server/SQL/ShopItem.cs Normal file
View File

@ -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<ShopItem>
{
public override DbSet<ShopItem> table { get; set; }
public void Update(ShopItem ShopItem)
{
table.Update(ShopItem);
}
public override List<ShopItem> SelectUid(long user_id)
{
//현재 시간도 비교해서 이전날자가 들어가지 않게 하기
return table.Where(data => data.user_id == user_id).ToList();
}
}
}

View File

@ -92,7 +92,8 @@ namespace Server.Service
#endregion #endregion
} }
#endregion #endregion
#region #region
//리셋 상점
List<ResetShopItem> resetShopItem = Statics.resetShopItemSQL.SelectUid(user.id); List<ResetShopItem> resetShopItem = Statics.resetShopItemSQL.SelectUid(user.id);
List<ResetShopItem> addItem = new List<ResetShopItem>(); List<ResetShopItem> addItem = new List<ResetShopItem>();
List<ResetShopItemData> shopItemData = null; List<ResetShopItemData> shopItemData = null;
@ -243,9 +244,11 @@ namespace Server.Service
Statics.resetShopItemSQL.SaveChanges(); Statics.resetShopItemSQL.SaveChanges();
resetShopItem.AddRange(addItem); resetShopItem.AddRange(addItem);
} }
//상점 구매 목록
List<ShopItem> shopItem = Statics.shopItemSQL.SelectUid(user.id);
#endregion #endregion
return makeResp(user, dynamicDataList, deckInfoList, itemManager, newUser, resetShopItem); return makeResp(user, dynamicDataList, deckInfoList, itemManager, newUser, resetShopItem, shopItem);
} }
public override Protocol ProtocolValue() => Protocol.Login; public override Protocol ProtocolValue() => Protocol.Login;
@ -256,7 +259,7 @@ namespace Server.Service
return req; return req;
} }
private string makeResp(User user, List<DynamicData> dynamicData, List<DeckInfo> deckInfo, ItemManager itemManager, bool newUser, List<ResetShopItem> resetShopItem) private string makeResp(User user, List<DynamicData> dynamicData, List<DeckInfo> deckInfo, ItemManager itemManager, bool newUser, List<ResetShopItem> resetShopItem, List<ShopItem> shopItem)
{ {
LoginResp resp = new LoginResp(); LoginResp resp = new LoginResp();
resp.nickname = user.nickname; resp.nickname = user.nickname;

View File

@ -30,6 +30,7 @@ namespace Server.System
public static ConsumableItemSQL consumableItemSQL = new ConsumableItemSQL(); public static ConsumableItemSQL consumableItemSQL = new ConsumableItemSQL();
public static EtcItemSQL etcItemSQL = new EtcItemSQL(); public static EtcItemSQL etcItemSQL = new EtcItemSQL();
public static ResetShopItemSQL resetShopItemSQL = new ResetShopItemSQL(); public static ResetShopItemSQL resetShopItemSQL = new ResetShopItemSQL();
public static ShopItemSQL shopItemSQL = new ShopItemSQL();
//DATA //DATA
public static EquipmentDataExcel equipmentExcel = new EquipmentDataExcel(); public static EquipmentDataExcel equipmentExcel = new EquipmentDataExcel();