using Edu.Common.Enum.System;
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace Edu.Common.Plugin
{
    /// <summary>
    /// 企业微信推送
    /// </summary>
    public class PushWorkChatHelper
    {

        /// <summary>
        /// 推送企业消息
        /// </summary>
        /// <param name="content">内容</param>
        /// <param name="receiveid">接收人（全部：@all,多个：“LuoChao|HuangDaSha”，单个：“LuoChao”）</param>
        /// <param name="title">标题</param>
        /// <param name="workmsgType">类型，默认为markdown,还支持news,如果要拓展其他类型，需要到System里面拓展</param>
        /// <param name="JumpUrl">跳转地址</param>
        public static void PushToWorkChat(string content,string receiveid,string title,string workmsgType= "markdown",string JumpUrl="")
        {
            Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
            {
                CategoryId = PushMessageCategoryEnum.SalePeople,
                Content = content,
                CoverImg = "",
                CreateByName = "系统",
                JumpUrl = "",
                WorkMsgType = workmsgType,
                SendTime = DateTime.Now,
                SendType = 0,
                Title = title,
                Platform = 5,
                ReceiveId = receiveid
            };
            Common.Message.MessageHelper.SendMessage(modelWork);
        }
    }
}
