using System;

namespace JiaZhiQuan.Common
{
    public static partial class CacheKeys
    {
        /// <summary>
        /// 商品推荐列表
        /// </summary>
        /// <returns></returns>
        public static string GoodsRecommendList(DateTime dateTime)
        {
            return GenerateKey($"mall:goods_recommend:{dateTime.ToString("yyyy-MM-dd")}");
        }

        /// <summary>
        /// 用户推荐下标
        /// </summary>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        public static string GoodsRecommendCacheCursor(string clientKey)
        {
            return GenerateKey($"mall:goods_rcml_cursor:{clientKey}");
        }

        /// <summary>
        /// 缓存24小时
        /// </summary>
        public const int OrderMindSellerDeliveryCacheSecs = 60 * 60 * 24;
        
        /// <summary>
        /// 提醒卖家发货行为记录
        /// </summary>
        /// <param name="orderId">买家的订单</param>
        /// <param name="date">当前日期</param>
        public static string OrderMindSellerDelivery(long orderId, DateTime date)
        {
            return GenerateKey($"mall:order_delivery_remind:{date:MMdd}:{orderId}");
        }

        /// <summary>
        /// 缓存24小时
        /// </summary>
        public const int OrderMindBuyerReceiptCacheSecs = 60 * 60 * 24;

        /// <summary>
        /// 提醒买家收货行为记录
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="date">当前日期</param>
        public static string OrderMindBuyerReceipt(long orderId, DateTime date)
        {
            return GenerateKey($"mall:order_receipt_remind:{date:MMdd}:{orderId}");
        }

        /// <summary>
        /// 货号自增序号缓存
        /// </summary>
        /// <param name="date">当前日期</param>
        public static string GoodsNoSequence(DateTime date) {
            return GenerateKey($"ue:goods_no_sequence:{date:yyyyMMdd}");
        }
    }
}
