using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Request.Role;
using GxPress.Result.Role;
using Datory;

namespace GxPress.Repository.Interface
{
    public interface IRoleRepository : IRepository
    {
        Task<int> InsertAsync(Role role);

        Task<bool> IsNameExistsAsync(string name);

        Task<Role> GetAsync(int id);

        Task<string> GetNameAsync(int id);

        Task<IEnumerable<Role>> GetListAsync(int groupId);

        /// <summary>
        /// ����
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<RoleDetailResult> AddAsync(RoleAddRequest request);

        /// <summary>
        /// �޸�
        /// </summary>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(int id, RoleAddRequest request);

        /// <summary>
        /// ɾ��
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);

        /// <summary>
        /// ����
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<RoleDetailResult> GetDetailAsync(int id);

        /// <summary>
        /// ��ȡ��ɫ�б�
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        Task<List<RoleDetailResult>> GetDetailListAsync(int groupId);
    }
}