sjtug/bkr — pull request #19 by Nihiue (2014-07-04 10:12:43+00:00)
Title: add bookmanage.js

bookmanage.js Doc
----------------
bookObj
每本书是一个bookObj
newbook.set("detail",infodata);//infodata是从豆瓣API抓取的JSON Object
newbook.set("title",infodata.title);//原书基本信息 便于查询
newbook.set("author",infodata.author);
newbook.set("isbn",isbn);
newbook.set("owner",User); //owner指向当前用户
newbook.set("location",new AV.GeoPoint(...));//当前地理位置
-----------------
addBook = function(isbn,success_callback,error_callback)
获取一本书的信息并将其保存到云端
success_callback 的参数是一个bookObj
error_callback 的参数是一个字串,说明错误类型,取值为"BOOK_ALREADY_EXISTS","BOOK_INFO_NOT_FOUND",或者向云端写入

时发生的错误描述.可省略

----------------
queryUserBook = function(isbn,callback)
查询当前用户是否拥有某本书
callback 的参数是一个bookObj或者是false
---------------
removeBook = function(bookobj,success_callback,error_callback)
删除当前用户的一本书
---------------
var listUserBook = function(callback)
列出当前登录用户的所有书籍
callback的参数一个bookObj的array
--------------
var var listNearByBook = function(callback)
同上..