find
This commit is contained in:
parent
5cd2a56c8c
commit
6c2ea87030
@ -53,12 +53,29 @@ var dellist = async (ctx,next)=>{
|
||||
ctx.body = JSON.stringify(res)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
var findlist = async (ctx,next)=>{
|
||||
// console.log(ctx.query.id)
|
||||
if(ctx.query.name == undefined){
|
||||
ctx.body = JSON.stringify({
|
||||
code : 1,
|
||||
msg:"id不能为空"
|
||||
})
|
||||
}else{
|
||||
await dbs.find('list',{
|
||||
"name":ctx.query.name
|
||||
}).then((res)=>{
|
||||
ctx.body = JSON.stringify(res)
|
||||
}).catch((err)=>{
|
||||
ctx.body = JSON.stringify(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
'GET /getlist':getlist,
|
||||
'POST /addlist':addlist,
|
||||
'GET /getaddlist':getaddlist,
|
||||
'GET /dellist' : dellist
|
||||
'GET /dellist' : dellist,
|
||||
'GET /findlsit':findlist
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user