thewar_server/Server/SQL/ResetShopItem.cs

40 lines
1.2 KiB
C#

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 && data.end_date > DateTime.UtcNow).ToList();
}
}
}