/// <summary>
        /// 保存角色资源授权
        /// </summary>
        /// <param name="roleId">角色Id</param>
        /// <param name="resourceIds">资源Ids</param>
        public async Task <int> Save(string roleId, List <string> resourceIds)
        {
            await service.DeleteAsync(t => t.ObjectId == roleId && t.ObjectType == 1 && t.ItemType == 4);

            foreach (string resourceId in resourceIds)
            {
                RoleAuthorizeEntity entity = new RoleAuthorizeEntity();
                entity.AttachCreateInfo(context);
                entity.ItemId     = resourceId;
                entity.ItemType   = 4;
                entity.ObjectId   = roleId;
                entity.ObjectType = 1;
                await service.InsertAsync(entity);
            }
            return(await Task.FromResult(0));
        }