Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需要解决的问题 #1

Open
lealife opened this issue May 25, 2015 · 0 comments
Open

需要解决的问题 #1

lealife opened this issue May 25, 2015 · 0 comments

Comments

@lealife
Copy link
Collaborator

lealife commented May 25, 2015

数据相关

  1. 现在用的是自带的Storage存储, 比较简单, 不支持搜索. 是否可以采用sqlite类似的数据进行存储? 以后需要支持笔记本, 笔记, 标签搜索
  2. 数据库的设计应该支持多用户, 可以添加多个用户.
  3. 笔记内容每次都需要从远程获取, 需要离线存储, 先查本地是否有, 如果没有, 则远程获取, 且存储到本地. 当下次增量同步时, 若该笔记远程已修改, 则重新获取内容.

笔记本, 笔记

添加搜索功能

笔记图片, 附件问题 [参照API]

因历史原因笔记内容中的图片的链接有两种: http://leanote.com/api/file/getImage?fileId=xxhttp://leanote.com/file/outputImage?fileId=xx, 当你获取内容后, 需要用正则将图片fileId获取, 然后调用Api获取图片, 之后修改图片链接为本地图片链接, 然后展示出.

关于笔记中的图片/附件

客户端应该添加一个"图片/附件表"来存元数据, 图片应该要缓存到本地, 附件可在需要的时候再调用相应api获取.

当 addNote和updateNote时务必将本地图片,附件链接修改成leanote服务器上的链接. 如

注意: addNote时必须要把Files, 和相关的图片/附件一起传到服务器中 其中Files(文件的元数据)和其它字段以POST方式传出, 而真正数据则以http的multipart传入, 每个文件的name为"FileDatas[LocalFileId]"

图片在笔记内的链接必须为: http://leanote.com/api/file/getImage?fileId=LocalFileId或FileId 附件如果插入到了笔记内容内, 其链接必须为: http://leanote.com/api/file/getAttach?fileId=LocalFileId或FileId 其中, fileId为文件在本地的LocalFileId或服务器上的FileId

服务器端会生成FileId传给Client. Client在本地必须要建立LocalFileId与FileId的关联.

如果笔记内容传了, 且笔记内有图片, 则必须要传Files 文件元数据, 因为Server端还要对内容内的图片, 附件链接进行修改, 可能你传过去的是LocalFileId, 服务器端会将LocalFileId替换成FileId存到数据库中.

同样适用于 updateNote

http://leanote.com 不绝对, 因为用户可以自建服务, 所以在开发时需要可配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant