using Nirvana.Common.ApiBase;
using Senparc.NeuChar.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YBDevice.WXApplication.DeviceInfo
{
    /// <summary>
    /// 设备管理
    /// </summary>
    public interface IDeviceService
    {
        /// <summary>
        /// 插入或者更新八电极绑定信息
        /// </summary>
        /// <param name="fansid"></param>
        /// <param name="equid"></param>
        /// <param name="appid"></param>
        /// <param name="openid"></param>
        Task<ResultInfo> InsertOrUpdateBodyBindInfoAsync(string fansid, string equid, string appid, string openid);

        /// <summary>
        /// 更新/增加粉丝关注记录
        /// </summary>
        /// <param name="appid">公众号原始id</param>
        /// <param name="openid">用户openid</param>
        /// <param name="wxfansid">用户ID</param>
        /// <param name="subscribe">关注状态,0-取关,1-关注,2-重复关注</param>
        /// <param name="type">类型,1-固定贴纸二维码,2-带参数二维码,3-其他</param>
        Task<string> InsertOrUpdateSubscribeAsync(string appid, string openid, Guid? wxfansid, int subscribe, int type = 3);

        /// <summary>
        /// 处理关键字回复事件
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="openid"></param>
        /// <param name="encode">关键字</param>
        Task<WXTextResponseData> HandlerTextAsync(string appid, string openid, string encode);
        /// <summary>
        /// 获取微信图文
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="openid"></param>
        /// <param name="fansid"></param>
        /// <param name="type">1-认证的服务号关注事件,2-认证的服务号扫码事件,3-非认证关注事件,4-回复关键字,5-第一次打开落地页,6-非认证扫码事件</param>
        /// <param name="resultid">记录ID</param>
        /// <returns></returns>
        List<Article> GetWXMessageNews(string appid, string openid, string fansid, int type, string resultid = "");
        /// <summary>
        /// 获取固定贴纸图文信息
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="openid"></param>
        /// <param name="fansid"></param>
        /// <param name="type">1-认证的服务号关注事件,2-认证的服务号扫码事件,3-非认证关注事件,4-回复关键字,5-第一次打开落地页,6-非认证扫码事件</param>
        /// <param name="resultid">记录ID</param>
        /// <returns></returns>
        List<Article> GetStickyWXMessageNews(string appid, string openid, string fansid, int type, Guid? resultid = null);
    }
}
