using System.Text.Json.Serialization;
using HoneyBox.Model.Models;
namespace HoneyBox.Model.Models.Goods;
#region Request Models
///
/// 商品列表请求
///
public class GoodsListRequest : PageRequest
{
///
/// 分类ID
///
public int? CategoryId { get; set; }
///
/// 商品类型 (-1表示全部)
///
[JsonPropertyName("type")]
public int Type { get; set; } = -1;
}
///
/// 商品详情请求
///
public class GoodsDetailRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 箱号 (0表示自动选择)
///
[JsonPropertyName("goods_num")]
public int GoodsNum { get; set; } = 0;
}
///
/// 商品子奖品请求
///
public class GoodsChildrenRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 箱号
///
[JsonPropertyName("goods_num")]
public int GoodsNum { get; set; }
///
/// 奖品列表ID
///
[JsonPropertyName("goods_list_id")]
public int GoodsListId { get; set; }
}
///
/// 商品扩展配置请求
///
public class GoodsExtendRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 商品类型
///
[JsonPropertyName("goods_type")]
public int GoodsType { get; set; }
}
///
/// 箱号列表请求
///
public class BoxListRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
}
///
/// 箱号详情请求
///
public class BoxDetailRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 页码 (每页10个箱号)
///
[JsonPropertyName("page_no")]
public int PageNo { get; set; } = 0;
///
/// 排序方式: 0=箱号升序, 1=箱号降序, 2=余量降序
///
[JsonPropertyName("sort")]
public int Sort { get; set; } = 0;
}
///
/// 奖品数量统计请求
///
public class PrizeCountRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
}
///
/// 奖品内容请求
///
public class PrizeContentRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 箱号
///
[JsonPropertyName("num")]
public int Num { get; set; }
}
///
/// 中奖记录请求
///
public class PrizeLogsRequest : PageRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 箱号
///
[JsonPropertyName("goods_num")]
public int GoodsNum { get; set; }
///
/// 赏品分类ID (0表示全部)
///
[JsonPropertyName("shang_id")]
public int ShangId { get; set; } = 0;
}
#endregion
#region Response/DTO Models
///
/// 商品列表项DTO (兼容PHP API snake_case格式)
///
public class GoodsListDto
{
///
/// 商品ID
///
[JsonPropertyName("id")]
public int Id { get; set; }
///
/// 商品标题
///
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
///
/// 商品图片URL
///
[JsonPropertyName("img_url")]
public string ImgUrl { get; set; } = string.Empty;
///
/// 商品价格
///
[JsonPropertyName("price")]
public string Price { get; set; } = "0";
///
/// 商品类型
///
[JsonPropertyName("type")]
public int Type { get; set; }
///
/// 类型文字
///
[JsonPropertyName("type_text")]
public string TypeText { get; set; } = string.Empty;
///
/// 总库存
///
[JsonPropertyName("stock")]
public int Stock { get; set; }
///
/// 已售库存
///
[JsonPropertyName("sale_stock")]
public int SaleStock { get; set; }
///
/// 状态
///
[JsonPropertyName("status")]
public int Status { get; set; }
///
/// 是否锁定
///
[JsonPropertyName("lock_is")]
public int LockIs { get; set; }
///
/// 是否首折
///
[JsonPropertyName("is_shou_zhe")]
public int IsShouZhe { get; set; }
///
/// 是否新品
///
[JsonPropertyName("new_is")]
public int NewIs { get; set; }
///
/// 参与次数
///
[JsonPropertyName("join_count")]
public int JoinCount { get; set; }
///
/// 需要抽奖次数
///
[JsonPropertyName("need_draw_num")]
public int NeedDrawNum { get; set; }
///
/// 显示价格
///
[JsonPropertyName("show_price")]
public string? ShowPrice { get; set; }
///
/// 角标文字
///
[JsonPropertyName("corner_text")]
public string? CornerText { get; set; }
}
///
/// 商品信息DTO
///
public class GoodsInfoDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
[JsonPropertyName("imgurl_detail")]
public string ImgUrlDetail { get; set; } = string.Empty;
[JsonPropertyName("price")]
public string Price { get; set; } = "0";
[JsonPropertyName("stock")]
public int Stock { get; set; }
[JsonPropertyName("sale_stock")]
public int SaleStock { get; set; }
[JsonPropertyName("surplus_stock")]
public int SurplusStock { get; set; }
[JsonPropertyName("goodslist_stock")]
public int GoodslistStock { get; set; }
[JsonPropertyName("goodslist_surplus_stock")]
public int GoodslistSurplusStock { get; set; }
[JsonPropertyName("type")]
public int Type { get; set; }
[JsonPropertyName("type_text")]
public string? TypeText { get; set; }
[JsonPropertyName("status")]
public int Status { get; set; }
[JsonPropertyName("lock_is")]
public int LockIs { get; set; }
[JsonPropertyName("num")]
public int Num { get; set; }
[JsonPropertyName("addtime")]
public string? Addtime { get; set; }
[JsonPropertyName("goods_describe")]
public string? GoodsDescribe { get; set; }
[JsonPropertyName("coupon_is")]
public int CouponIs { get; set; }
[JsonPropertyName("coupon_pro")]
public int CouponPro { get; set; }
[JsonPropertyName("integral_is")]
public int IntegralIs { get; set; }
[JsonPropertyName("rage_is")]
public int RageIs { get; set; }
[JsonPropertyName("rage")]
public int Rage { get; set; }
[JsonPropertyName("lingzhu_is")]
public int LingzhuIs { get; set; }
[JsonPropertyName("lingzhu_fan")]
public int LingzhuFan { get; set; }
[JsonPropertyName("card_num")]
public int CardNum { get; set; }
[JsonPropertyName("is_shou_zhe")]
public int IsShouZhe { get; set; }
[JsonPropertyName("new_is")]
public int NewIs { get; set; }
[JsonPropertyName("collection_is")]
public int CollectionIs { get; set; }
[JsonPropertyName("three_time")]
public int ThreeTime { get; set; }
[JsonPropertyName("five_time")]
public int FiveTime { get; set; }
[JsonPropertyName("quanju_xiangou")]
public int QuanjuXiangou { get; set; }
[JsonPropertyName("daily_xiangou")]
public int DailyXiangou { get; set; }
[JsonPropertyName("prize_num")]
public int PrizeNum { get; set; }
}
///
/// 商品详情响应
///
public class GoodsDetailResponseDto
{
///
/// 商品信息
///
[JsonPropertyName("goods")]
public GoodsInfoDto Goods { get; set; } = new();
///
/// 锁箱信息
///
[JsonPropertyName("lock_info")]
public LockInfoDto LockInfo { get; set; } = new();
///
/// 参与用户头像列表
///
[JsonPropertyName("join_user")]
public List JoinUser { get; set; } = new();
///
/// 参与次数
///
[JsonPropertyName("join_count")]
public int JoinCount { get; set; }
///
/// 奖品列表
///
[JsonPropertyName("goodslist")]
public List GoodsList { get; set; } = new();
///
/// 限购信息
///
[JsonPropertyName("limit_info")]
public LimitInfoDto LimitInfo { get; set; } = new();
}
///
/// 锁箱信息DTO
///
public class LockInfoDto
{
///
/// 是否锁定
///
[JsonPropertyName("lock_is")]
public int LockIs { get; set; }
///
/// 锁定用户昵称
///
[JsonPropertyName("goods_lock_user_nickname")]
public string? GoodsLockUserNickname { get; set; }
///
/// 锁定用户头像
///
[JsonPropertyName("goods_lock_user_headimg")]
public string? GoodsLockUserHeadimg { get; set; }
///
/// 锁箱剩余时间 (Unix时间戳)
///
[JsonPropertyName("goods_lock_surplus_time")]
public long GoodsLockSurplusTime { get; set; }
}
///
/// 限购信息DTO
///
public class LimitInfoDto
{
///
/// 每日限购数量
///
[JsonPropertyName("daily_xiangou")]
public int DailyXiangou { get; set; }
///
/// 今日已购数量
///
[JsonPropertyName("daily_bought")]
public int DailyBought { get; set; }
///
/// 今日剩余可购数量
///
[JsonPropertyName("daily_remaining")]
public int DailyRemaining { get; set; }
///
/// 全局限购数量
///
[JsonPropertyName("quanju_xiangou")]
public int QuanjuXiangou { get; set; }
///
/// 全局已购数量
///
[JsonPropertyName("global_bought")]
public int GlobalBought { get; set; }
///
/// 全局剩余可购数量
///
[JsonPropertyName("global_remaining")]
public int GlobalRemaining { get; set; }
}
///
/// 奖品列表项DTO
///
public class GoodsListItemDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("shang_info")]
public ShangInfoDto? ShangInfo { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
[JsonPropertyName("stock")]
public int Stock { get; set; }
[JsonPropertyName("surplus_stock")]
public int SurplusStock { get; set; }
[JsonPropertyName("img_url")]
public string ImgUrl { get; set; } = string.Empty;
[JsonPropertyName("goods_type")]
public int GoodsType { get; set; }
[JsonPropertyName("price")]
public string Price { get; set; } = "0";
[JsonPropertyName("sc_money")]
public string ScMoney { get; set; } = "0";
[JsonPropertyName("sale_time")]
public string? SaleTime { get; set; }
[JsonPropertyName("pro")]
public string Pro { get; set; } = "0";
[JsonPropertyName("children")]
public bool Children { get; set; }
[JsonPropertyName("real_pro")]
public string RealPro { get; set; } = "0";
}
///
/// 赏品等级信息DTO
///
public class ShangInfoDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
[JsonPropertyName("img_url")]
public string? ImgUrl { get; set; }
[JsonPropertyName("color")]
public string? Color { get; set; }
[JsonPropertyName("special_img_url")]
public string? SpecialImgUrl { get; set; }
}
///
/// 子奖品DTO
///
public class GoodsChildrenDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
[JsonPropertyName("imgurl")]
public string ImgUrl { get; set; } = string.Empty;
[JsonPropertyName("stock")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int Stock { get; set; }
[JsonPropertyName("surplus_stock")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int SurplusStock { get; set; }
[JsonPropertyName("goods_type")]
public int GoodsType { get; set; }
[JsonPropertyName("sale_time")]
public string? SaleTime { get; set; }
[JsonPropertyName("price")]
public string Price { get; set; } = "0";
[JsonPropertyName("sc_money")]
public string ScMoney { get; set; } = "0";
[JsonPropertyName("real_pro")]
public string RealPro { get; set; } = "0";
[JsonPropertyName("pro")]
public string Pro { get; set; } = "0";
[JsonPropertyName("pro_num")]
public string ProNum { get; set; } = "0";
[JsonPropertyName("shang_info")]
public ShangInfoDto? ShangInfo { get; set; }
}
///
/// 商品扩展配置DTO
///
public class GoodsExtendDto
{
[JsonPropertyName("pay_wechat")]
public int PayWechat { get; set; }
[JsonPropertyName("pay_balance")]
public int PayBalance { get; set; }
[JsonPropertyName("pay_currency")]
public int PayCurrency { get; set; }
[JsonPropertyName("pay_currency2")]
public int PayCurrency2 { get; set; }
[JsonPropertyName("pay_coupon")]
public int PayCoupon { get; set; }
[JsonPropertyName("is_deduction")]
public int IsDeduction { get; set; }
}
///
/// 箱号分组DTO
///
public class BoxGroupDto
{
///
/// 显示标题,如 "1-10"
///
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
///
/// 页码(从0开始)
///
[JsonPropertyName("page_no")]
public int PageNo { get; set; }
}
///
/// 箱号详情DTO
///
public class BoxDetailDto
{
[JsonPropertyName("num")]
public int Num { get; set; }
[JsonPropertyName("surplus_all_stock")]
public int SurplusAllStock { get; set; }
[JsonPropertyName("goodslist")]
public List GoodsList { get; set; } = new();
}
///
/// 箱号商品列表DTO
///
public class BoxGoodsListDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("shang_info")]
public ShangInfoDto? ShangInfo { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
[JsonPropertyName("surplus_stock")]
public int SurplusStock { get; set; }
[JsonPropertyName("stock")]
public int Stock { get; set; }
}
#endregion
#region Collection Models
///
/// 收藏请求
///
public class CollectionRequest
{
///
/// 商品ID
///
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
///
/// 箱号
///
[JsonPropertyName("goods_num")]
public int GoodsNum { get; set; }
///
/// 操作类型: add=收藏, remove=取消收藏
///
[JsonPropertyName("action")]
public string Action { get; set; } = "add";
}
///
/// 收藏列表请求
///
public class CollectionListRequest : PageRequest
{
///
/// 商品类型 (0=全部)
///
[JsonPropertyName("type")]
public int Type { get; set; } = 0;
}
///
/// 收藏列表响应 (兼容PHP API格式)
///
public class CollectionListResponse
{
[JsonPropertyName("data")]
public List Data { get; set; } = new();
[JsonPropertyName("last_page")]
public int LastPage { get; set; }
}
///
/// 收藏DTO (兼容PHP API格式)
///
public class CollectionDto
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("goods_id")]
public int GoodsId { get; set; }
[JsonPropertyName("type")]
public int Type { get; set; }
[JsonPropertyName("num")]
public int Num { get; set; }
[JsonPropertyName("goods_title")]
public string GoodsTitle { get; set; } = string.Empty;
[JsonPropertyName("goods_price")]
public string GoodsPrice { get; set; } = "0";
[JsonPropertyName("imgurl")]
public string ImgUrl { get; set; } = string.Empty;
[JsonPropertyName("stock")]
public int Stock { get; set; }
[JsonPropertyName("surplus_stock")]
public int SurplusStock { get; set; }
}
///
/// 删除收藏请求
///
public class DeleteCollectionRequest
{
///
/// 收藏记录ID
///
[JsonPropertyName("id")]
public int Id { get; set; }
}
#endregion
#region Prize Statistics Models
///
/// 奖品数量统计响应
///
public class PrizeCountResponseDto
{
[JsonPropertyName("list")]
public List List { get; set; } = new();
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("surplus")]
public int Surplus { get; set; }
}
///
/// 奖品数量统计项DTO
///
public class PrizeCountItemDto
{
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("shang_info")]
public ShangInfoDto? ShangInfo { get; set; }
[JsonPropertyName("total")]
public int Total { get; set; }
[JsonPropertyName("surplus")]
public int Surplus { get; set; }
}
///
/// 奖品内容响应
///
public class PrizeContentResponseDto
{
[JsonPropertyName("list")]
public List List { get; set; } = new();
}
#endregion
#region Prize Logs Models
///
/// 中奖记录响应
///
public class PrizeLogsResponseDto
{
[JsonPropertyName("category")]
public List Category { get; set; } = new();
[JsonPropertyName("data")]
public List Data { get; set; } = new();
[JsonPropertyName("last_page")]
public int LastPage { get; set; }
[JsonPropertyName("total")]
public int Total { get; set; }
}
///
/// 分类DTO - 用于中奖记录筛选
///
public class CategoryDto
{
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("shang_title")]
public string ShangTitle { get; set; } = string.Empty;
}
///
/// 中奖记录DTO - 匹配PHP API响应格式
///
public class PrizeLogDto
{
[JsonPropertyName("user_id")]
public int UserId { get; set; }
[JsonPropertyName("goodslist_title")]
public string GoodslistTitle { get; set; } = string.Empty;
[JsonPropertyName("goodslist_imgurl")]
public string GoodslistImgurl { get; set; } = string.Empty;
[JsonPropertyName("shang_id")]
public int ShangId { get; set; }
[JsonPropertyName("addtime")]
public string Addtime { get; set; } = string.Empty;
[JsonPropertyName("prize_num")]
public int PrizeNum { get; set; }
[JsonPropertyName("shang_title")]
public string ShangTitle { get; set; } = string.Empty;
[JsonPropertyName("user_info")]
public PrizeLogUserDto? UserInfo { get; set; }
[JsonPropertyName("shang_color")]
public string ShangColor { get; set; } = string.Empty;
}
///
/// 中奖记录用户信息DTO
///
public class PrizeLogUserDto
{
[JsonPropertyName("nickname")]
public string Nickname { get; set; } = string.Empty;
[JsonPropertyName("headimg")]
public string HeadImg { get; set; } = string.Empty;
}
#endregion