namespace HoneyBox.Core.Constants;

/// <summary>
/// 应用程序常量定义
/// </summary>
public static class AppConstants
{
    /// <summary>
    /// API 响应状态码
    /// </summary>
    public static class ResponseCodes
    {
        /// <summary>成功</summary>
        public const int Success = 0;
        
        /// <summary>通用失败</summary>
        public const int Fail = -1;
        
        /// <summary>未授权</summary>
        public const int Unauthorized = 401;
        
        /// <summary>禁止访问</summary>
        public const int Forbidden = 403;
        
        /// <summary>未找到</summary>
        public const int NotFound = 404;
        
        /// <summary>服务器错误</summary>
        public const int ServerError = 500;
    }

    /// <summary>
    /// 缓存键前缀
    /// </summary>
    public static class CacheKeys
    {
        /// <summary>用户信息缓存前缀</summary>
        public const string UserPrefix = "user:";
        
        /// <summary>商品信息缓存前缀</summary>
        public const string GoodsPrefix = "goods:";
        
        /// <summary>订单信息缓存前缀</summary>
        public const string OrderPrefix = "order:";
        
        /// <summary>配置信息缓存前缀</summary>
        public const string ConfigPrefix = "config:";
        
        /// <summary>Token 缓存前缀</summary>
        public const string TokenPrefix = "token:";
    }

    /// <summary>
    /// 缓存过期时间（秒）
    /// </summary>
    public static class CacheExpiry
    {
        /// <summary>短期缓存：5分钟</summary>
        public const int Short = 300;
        
        /// <summary>中期缓存：30分钟</summary>
        public const int Medium = 1800;
        
        /// <summary>长期缓存：1小时</summary>
        public const int Long = 3600;
        
        /// <summary>一天</summary>
        public const int OneDay = 86400;
    }

    /// <summary>
    /// 分页默认值
    /// </summary>
    public static class Pagination
    {
        /// <summary>默认页码</summary>
        public const int DefaultPage = 1;
        
        /// <summary>默认每页数量</summary>
        public const int DefaultPageSize = 10;
        
        /// <summary>最大每页数量</summary>
        public const int MaxPageSize = 100;
    }

    /// <summary>
    /// 余额变动类型 (profit_money.type)
    /// </summary>
    public static class MoneyChangeType
    {
        /// <summary>后台充值</summary>
        public const byte AdminRecharge = 1;
        
        /// <summary>在线充值</summary>
        public const byte OnlineRecharge = 2;
        
        /// <summary>抽赏消费</summary>
        public const byte LotteryConsume = 3;
        
        /// <summary>背包兑换</summary>
        public const byte BackpackExchange = 4;
        
        /// <summary>推荐奖励</summary>
        public const byte ReferralReward = 5;
        
        /// <summary>签到赠送</summary>
        public const byte SignInReward = 6;
    }

    /// <summary>
    /// 积分变动类型 (profit_integral.type)
    /// </summary>
    public static class IntegralChangeType
    {
        /// <summary>后台充值</summary>
        public const byte AdminRecharge = 1;
        
        /// <summary>抽赏消费</summary>
        public const byte LotteryConsume = 2;
        
        /// <summary>开券获得</summary>
        public const byte CouponReward = 3;
        
        /// <summary>抽赏奖励</summary>
        public const byte LotteryReward = 4;
        
        /// <summary>推荐奖励</summary>
        public const byte ReferralReward = 5;
    }

    /// <summary>
    /// 哈尼券变动类型 (profit_money2.type)
    /// </summary>
    public static class Money2ChangeType
    {
        /// <summary>后台充值</summary>
        public const byte AdminRecharge = 1;
        
        /// <summary>在线充值</summary>
        public const byte OnlineRecharge = 2;
        
        /// <summary>抽赏消费</summary>
        public const byte LotteryConsume = 3;
        
        /// <summary>背包兑换</summary>
        public const byte BackpackExchange = 4;
        
        /// <summary>推荐奖励</summary>
        public const byte ReferralReward = 5;
    }
}
