Skip to content

Commit

Permalink
add schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ltebean committed Feb 17, 2013
1 parent f140015 commit f293385
Show file tree
Hide file tree
Showing 27 changed files with 1,299 additions and 13 deletions.
28 changes: 15 additions & 13 deletions invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ exports.welcome=function(req, res){
user:{
weiboId:'3118093851',
weiboName:"Let's Party",
weiboIcon: 'http://tp4.sinaimg.cn/3118093851/180/40015293290/1',
weiboIconSmall: 'http://tp4.sinaimg.cn/3118093851/180/40015293290/1'
weiboIcon: 'http://tp4.sinaimg.cn/3118093851/180/40015481944/1',
weiboIconSmall: 'http://tp4.sinaimg.cn/3118093851/180/40015481944/1'
}
},
shopList:[{
shopId:'0',
shopName:"欢迎加入Let's Party~",
address:"Let's Party官方微博",
latitude:"31.23136",
longtitude:"121.47004",
picUrlList:['http://www.brightschool.com/images/photos/Wagner/stock-illustration-11386084-children-birthday-party-cartoon.jpg']
}],
startDate:new Date(),
Expand All @@ -39,15 +41,15 @@ exports.welcome=function(req, res){
status:'accept'
}],
replyList: [{
content: "欢迎加入Let's Party~",
user: {
weiboId: '3118093851',
weiboName: "Let's Party",
weiboIcon: 'http://tp4.sinaimg.cn/3118093851/180/40015293290/1',
weiboIconSmall: 'http://tp4.sinaimg.cn/3118093851/180/40015293290/1'
},
date: new Date()
}],
content: "欢迎加入Let's Party~",
user: {
weiboId: '3118093851',
weiboName: "Let's Party",
weiboIcon: 'http://tp4.sinaimg.cn/3118093851/180/40015481944/1',
weiboIconSmall: 'http://tp4.sinaimg.cn/3118093851/180/40015481944/1'
},
date: new Date()
}],
};
collection.insert(invitation, {safe:true}, this)
},
Expand Down Expand Up @@ -130,7 +132,7 @@ exports.findOpen=function(req, res){
collection.find({
'startDate':{$gte: date},
$or :[{'inviter.user.weiboId':req.params.weiboId},{'invitees':{$elemMatch:{"user.weiboId":req.params.weiboId}}}]
}).sort({_id:-1}).skip(req.params.page*8).limit(8).toArray(this);
}).sort({startDate:-1}).skip(req.params.page*8).limit(8).toArray(this);
},
function generateResponse(err, item){
if (err) throw err;
Expand All @@ -150,7 +152,7 @@ exports.findClosed=function(req, res){
collection.find({
'startDate':{$lt: date},
$or :[{'inviter.user.weiboId':req.params.weiboId},{'invitees':{$elemMatch:{"user.weiboId":req.params.weiboId}}}]
}).sort({_id:-1}).skip(req.params.page*8).limit(8).toArray(this);
}).sort({startDate:1}).skip(req.params.page*8).limit(8).toArray(this);
},
function generateResponse(err, item){
if (err) throw err;
Expand Down
39 changes: 39 additions & 0 deletions node_modules/js-schema/HISTORY.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions node_modules/js-schema/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

263 changes: 263 additions & 0 deletions node_modules/js-schema/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions node_modules/js-schema/build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f293385

Please sign in to comment.