Beispiel #1
0
        //获取同步的笔记本
        //[HttpPost]
        public JsonResult GetSyncNotebooks(string token, int afterUsn, int maxEntry)
        {
            User user = TokenSerivce.GetUserByToken(token);

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

                return(Json(apiRe, MyJsonConvert.GetOptions()));
            }
            Notebook[] notebook = NotebookService.GeSyncNotebooks(user.UserId, afterUsn, maxEntry);
            return(Json(notebook, MyJsonConvert.GetOptions()));
        }
Beispiel #2
0
        public JsonResult GetSyncNotebooks(string token, int afterUsn, int maxEntry)
        {
            User user = tokenSerivce.GetUserByToken(token);

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

                return(Json(apiRe, MyJsonConvert.GetLeanoteOptions()));
            }
            if (maxEntry == 0)
            {
                maxEntry = 100;
            }
            Notebook[] notebook = notebookService.GeSyncNotebooks(user.UserId, afterUsn, maxEntry);
            return(Json(notebook, MyJsonConvert.GetLeanoteOptions()));
        }