예제 #1
0
        public IActionResult GetNotebooks(string token)
        {
            User user = tokenSerivce.GetUserByToken(token);

            if (user == null)
            {
                ApiRe apiRe = new ApiRe()
                {
                    Ok  = false,
                    Msg = "NOTLOGIN",
                };

                return(Json(apiRe, MyJsonConvert.GetLeanoteOptions()));
            }
            else
            {
                Notebook[]    notebooks    = notebookService.GetAll(user.UserId);
                ApiNotebook[] apiNotebooks = fixNotebooks(notebooks);
                return(Json(apiNotebooks, MyJsonConvert.GetLeanoteOptions()));
            }

            return(null);
        }