using Nirvana.Common;
using Nirvana.Common.ApiBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YBDevice.Application.OfficeialInfo;
using YBDevice.Entity;

namespace YBDevice.Application
{
    /// <summary>
    /// 公众号管理
    /// </summary>
    public interface IOfficialService
    {
        /// <summary>
        /// 公众号列表
        /// </summary>
        /// <param name="param"></param>
        /// <param name="type">0-全部,1-公众号,2-小程序</param>
        /// <returns></returns>
        Task<PageParms<OfficialListModel>> GetListAsync(QueryParams param, int type = 1);
        /// <summary>
        /// 获取所有公众号列表
        /// </summary>
        /// <param name="type">0-全部,1-公众号,2-小程序</param>
        /// <returns></returns>
        Task<List<YB_OfficlaAccount>> GetAllListAsync(int type = 1);

        /// <summary>
        /// 小程序模版列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        Task<PageParms<YB_MiniProgramsTpl>> GetTplListAsync(QueryParams param);

        /// <summary>
        /// 小程序草稿列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        Task<PageParms<YB_MiniProgramsDraft>> GetDraftListAsync(QueryParams param);

        /// <summary>
        /// 获取提交历史
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        Task<PageParms<YB_MiniProgramHistory>> GetHistoryListAsync(QueryParams param);

        /// <summary>
        /// 详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<YB_OfficlaAccount> DetailAsync(int id);

        /// <summary>
        /// 同步代码模版列表
        /// </summary>
        /// <returns></returns>
        Task<ResultInfo> SyncTplAsync();

        /// <summary>
        /// 同步代码草稿列表
        /// </summary>
        /// <returns></returns>
        Task<ResultInfo> SyncDraftAsync();

        /// <summary>
        /// 将草稿箱的草稿选为小程序代码模版
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> AddToTEmplateAsync(int id);

        /// <summary>
        /// 删除模版
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> DeleteTemplateAsync(int id);
        /// <summary>
        /// 为授权的小程序帐号上传小程序代码
        /// </summary>
        /// <param name="templateid">模版ID</param>
        /// <param name="id">小程序id</param>
        /// <returns></returns>
        Task<ResultInfo> CommitAsync(int templateid, int id);
        /// <summary>
        /// 获取最新的提交历史状态
        /// </summary>
        /// <param name="id">小程序id</param>
        /// <returns></returns>
        Task<YB_MiniProgramHistory> GetLastCommitStatusAsync(int id);
        /// <summary>
        /// 查询提交状态
        /// </summary>
        /// <param name="id">提交的状态记录id</param>
        /// <returns></returns>
        Task<ResultInfo> GetCommitStatusAsync(int id);
        /// <summary>
        /// 获取小程序的体验二维码
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> GetQRCodeAsync(int id);
        /// <summary>
        /// 获取小程序的第三方提交代码的页面配置
        /// </summary>
        /// <param name="appid"></param>
        /// <returns></returns>
        Task<ResultInfo> GetPageAsync(string appid);
        /// <summary>
        /// 查询最新一次提交的审核状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> GetLatestAuditStatusAsync(int id);
        /// <summary>
        /// 将第三方提交的代码包提交审核,注意：只有上个版本被驳回，才能使用 feedback_info、feedback_stuff 这两个字段，否则忽略处理。
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> SubmitAuditAsync(int id);
        /// <summary>
        /// 修改域名
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> ModifyDomainAsync(int id);
        /// <summary>
        /// 获取域名列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> GetDomainAsync(int id);
        /// <summary>
        /// 小程序审核撤回，注意：单个帐号每天审核撤回次数最多不超过 1 次，一个月不超过 10 次
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> UndoCodeAuditAsync(int id);
        /// <summary>
        /// 发布已通过审核的小程序
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> ReleaseAsync(int id);
        /// <summary>
        /// 修改小程序线上代码的可见状态
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        Task<ResultInfo> ChangeVisitStatusAsync(string appid, int status = 1);
        /// <summary>
        /// 手动增加公众号/小程序
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<ResultInfo> SubmitFormAsync(YB_OfficlaAccount data);
        /// <summary>
        /// 更新公众号/小程序资料
        /// </summary>
        /// <param name="id">公众号ID</param>
        /// <returns></returns>
        Task<ResultInfo> GetInfo(int id);
        /// <summary>
        /// 获取当前账号下的个人模板列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultInfo> GetTemplateListAsync(int id);
        /// <summary>
        /// 选中模板
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<ResultInfo> SetTplAsMessageAsync(SubscribeTplStatusC2SDto data);
        /// <summary>
        /// 获取小程序订阅模板
        /// </summary>
        /// <param name="id">小程序id</param>
        /// <param name="param"></param>
        /// <returns></returns>
        Task<ResultInfo> GetSubscribeTplListAsync(int id, QueryParams param);
        /// <summary>
        /// 获取小程序订阅模板详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<YB_MiniProgramSubscribeMessageTpl> GetSubscribeTplDetailAsync(Guid id);
        /// <summary>
        /// 设置订阅消息模板内容
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<ResultInfo> SetSubscribeTplContentAsync(SubscribeTplContentC2SDto data);
        /// <summary>
        /// 微信客服设置
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<ResultInfo> SetCustomServiceAsync(CustomServiceC2SDto data);
        /// <summary>
        /// 获取微信客服详情
        /// </summary>
        /// <param name="id">小程序id主键</param>
        /// <returns></returns>
        Task<CustomServiceC2SDto> GetCustomServiceAsync(int id);

    }
}
