using System;
using System.Collections.Generic;
using System.Text;

namespace JiaZhiQuan.Common.Messaging.Models
{
    public enum NotificationType
    {
        /// <summary>
        /// 通用系统通知
        /// </summary>
        Common = 0,

        /// <summary>
        /// 某人发送新动态时，需要通知关注他的用户
        /// </summary>
        NewPost = 1,

        Comment = 2,

        Thumbsup = 3,
        
        Focus = 4,
        
        CommonWithPost = 5,
        
        CommonWithAfterSale = 6,
        
        NewGoods = 7,
        
        CommonWithOrder = 8,
        
        /// <summary>
        /// 商城流水
        /// </summary>
        CommonWithMallBill = 9,
        
        /// <summary>
        /// 寄售单通知
        /// </summary>
        UEPostOrder = 11,
        
        /// <summary>
        /// 寄售销售单通知
        /// </summary>
        UEPostSaleOrder = 12,
        
        /// <summary>
        /// 挂售销售单通知
        /// </summary>
        UEHangSaleOrder = 13,
        
    }

    public class NotificationModel
    {
        public NotificationType Type { get; set; }

        public string Content { get; set; }

        public static string GetMsgKey()
        {
            return "JZQ_Notification_Msg";
        }
    }

    public class CommonSubModel
    {
        public long UserId { get; set; }
        /// <summary>
        /// 系统消息中，展示的标题。如果标题为空，则表示只发推送信息
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 消息内容
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 推送标题，如果不设置默认为“价值圈”
        /// </summary>
        public string PushTitle { get; set; }
        /// <summary>
        /// 推送标题，如果不设置，则取Message
        /// </summary>
        public string PushContent { get; set; }

        /// <summary>
        /// 系统消息中，显示的图片
        /// </summary>
        public string Image { get; set; }

        /// <summary>
        /// 消息点击行为链接
        /// </summary>
        public string ActionLink { get; set; }
    }

    public class CommonWithPostSubModel : CommonSubModel
    {
        public long PostId { get; set; }
    }

    public class AfterSaleSubModel : CommonSubModel
    {
        public long AfterSaleId { get; set; }
    }

    public class ThumbsupSubModel
    {
        public ThumbsupTargetType Type { get; set; }
        public long TargetId { get; set; }

        public long UserId { get; set; }

        public DateTime CreateAt { get; set; }

    }

    public class CommentSubModel
    {
        /// <summary>
        /// 评论Id、评论回复Id
        /// </summary>
        public int CommentId { get; set; }

        /// <summary>
        /// 0 动态评论
        /// 1 动态评论回复
        /// </summary>
        public int Type { get; set; } = 0;

    }

    public class FocusSubModel
    {
        /// <summary>
        /// 关注的用户Id
        /// </summary>
        public long FromUserId { get; set; }

        /// <summary>
        /// 被关注的用户Id
        /// </summary>
        public long ToUserId { get; set; }

        public DateTime CreateAt { get; set; }
    }

    public class NewPostSubModel
    {
        public long Id { get; set; }
    }

    public class NewGoodsSubModel
    {
        public long Id { get; set; }
    }

    /// <summary>
    /// 商品禁用通知
    /// </summary>
    public class GoodsDisabledModel : CommonSubModel
    {
        /// <summary>
        /// 商品id
        /// </summary>
        public long GoodsId { get; set; }
        /// <summary>
        /// 商品描述
        /// </summary>
        public string GoodsDesc { get; set; }
        /// <summary>
        /// 商品主图
        /// </summary>
        public string CoverImg { get; set; }
    }

    public class CommonWithOrderSubModel : CommonSubModel
    {
        public long OrderId { get; set; }
    }
    
    public class CommonWithMallBillSubModel : CommonSubModel
    {
        public long BillId { get; set; }
    }

    public class UECommonPubAccountModel : CommonSubModel
    {
        /// <summary>
        /// 公众推送指定系统用户id
        /// </summary>
        public List<int> SysUserIds { get; set; } = new List<int>();

        /// <summary>
        /// 公众号消息内容
        /// </summary>
        public string PubAccountMessage { get; set; }

        /// <summary>
        /// 消息点击跳转链接
        /// </summary>
        public string PubAccountPath { get; set; }
    }
    
    public class UEPostOrderModel : UECommonPubAccountModel
    {
        public long OrderId { get; set; }
    }

    public class UEPostSaleOrderModel : UECommonPubAccountModel
    {
        public long OrderId { get; set; }
        public long SaleOrderId { get; set; }
    }
    
    public class UEHangSaleOrderModel : UECommonPubAccountModel
    {
        public long OrderId { get; set; }
    }
    
}
