示例#1
0
        public IActionResult GetRootNotebooks(string token, string repositoryId)
        {
            var apiRe = new ApiRe();

            var user = tokenSerivce.GetUserByToken(token);

            if (user != null)
            {
                //var repository = noteRepositoryService.GetNotesRepository(repositoryId.ToLongByHex());

                //var memerRole = noteRepositoryService.GetRepositoryMemberRole(repositoryId.ToLongByHex());

                //检查用户是否对仓库具有读权限
                if (noteRepositoryService.Verify(repositoryId.ToLongByHex(), user.UserId, RepositoryAuthorityEnum.Read))
                {
                    var books = notebookService.GetRootNotebooks(repositoryId.ToLongByHex());
                    apiRe.Ok   = true;
                    apiRe.Data = books;
                }
            }
            return(LeanoteJson(apiRe));
        }