using Senparc.Weixin.Open.ComponentAPIs;
using YBDevice.Entity;

namespace YBDevice.WXApplication.WXInfo
{
    /// <summary>
    /// 微信相关管理
    /// </summary>
    public interface IWXService
    {
        /// <summary>
        ///  更新或者插入授权token
        /// </summary>
        /// <param name="result"></param>
        /// <param name="authorizerId">公众号appid</param>
        /// <param name="componentAppId">开放平台id</param>
        Task InsertOrUpdateAuthorizerTokenAsync(RefreshAuthorizerTokenResult result, string authorizerId, string componentAppId);

        /// <summary>
        /// 获取公众号的刷新token
        /// </summary>
        /// <param name="authorizerId">公众号appid</param>
        /// <param name="componentAppId">开放平台appid</param>
        /// <returns></returns>
        Task<string> GetRefreshToken(string authorizerId, string componentAppId);

        /// <summary>
        /// 插入或者更新公众号信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="bid"></param>
        /// <returns></returns>
        Task InsertOrUpdateAsync(YB_OfficlaAccount model, string bid);

        /// <summary>
        /// 更新公众号授权信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
       Task NoticeUpdateAsync(YB_OfficlaAccount model);
        /// <summary>
        /// 更新提交的审核状态
        /// </summary>
        /// <param name="appid">微信原始id</param>
        /// <param name="status">审核状态,-1-代码已上传,0-审核成功,1-审核被拒绝,2-审核中,3-已撤回,4-审核延后</param>
        /// <param name="remark">状态备注</param>
        /// <param name="screenshot">不通过时的截图,mediaid形式</param>
        /// <param name="time">时间戳</param>
        /// <returns></returns>
        Task UpdateMiniInfoAsync(string appid, int status, string remark, string screenshot, string time);
        /// <summary>
        /// 检查是否为认证的服务号
        /// </summary>
        /// <param name="appid"></param>
        /// <returns></returns>
        Task<bool> CheckIsRZFAsync(string appid);

        /// <summary>
        /// 增加或者更新openticket
        /// </summary>
        /// <param name="model"></param>
        Task InsertOrUpdateAsync(YB_OpenWXConfig model);
        /// <summary>
        /// 获取openticket
        /// </summary>
        /// <param name="componentAppId"></param>
        /// <returns></returns>
        Task<string> GetOpenTicketAsync(string componentAppId);
    }
}
