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

namespace YBDevice.Application
{
    public interface ICommonService
    {
        /// <summary>
        /// 插入或者更新汇总表
        /// </summary>
        /// <returns></returns>
        Task InsertOrUpdateCombinedAsync();
        /// <summary>
        /// 更新或者插入指定商户实时数据
        /// </summary>
        /// <param name="BusinessId"></param>
        /// <returns></returns>
        Task InsertOrUpdateRealDataAsync(int BusinessId);
        /// <summary>
        /// 更新或者插入指定商户实时数据
        /// </summary>
        /// <param name="BusinessId"></param>
        /// <returns></returns>
        Task InsertOrUpdateRealDataAsync(List<int> BusinessId);

        /// <summary>
        /// 添加分配记录
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task InsertAllocAsync(YB_DeviceAlloc data);
        /// <summary>
        /// 添加分配记录
        /// </summary>
        /// <param name="equids">设备列表</param>
        /// <param name="frombusinessid">分配人</param>
        /// <param name="tobusinessid">接收人</param>
        /// <param name="type">类型,1-出货,2-分配,3-回收,4-激活</param>
        /// <returns></returns>
        Task InsertAllocAsync(List<int> equids, int frombusinessid, int tobusinessid, DeviceAllocType type);
        /// <summary>
        /// 生成登录token
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        LoginInfoDto AccessToken(OperatorModel account);
    }
}
