インタフェースの例

1196 ワード

// - 

helloAction:function*(self){ var time = getNowFullDate(); var list =self.http._post.list; var body =self.http._post.body;
   var insertId = yield P('test').add({list:list, body: body,time:time});
   if(!insertId){
       return  this.fail(' ');
   }else {
       return  this.fail(' ');
   }

},//テストインタフェース-deleteAction:function(){var time=getNowFullDate();var affectedRows=yield P('test').where({body:[-],5]}).delete(); if(!affectedRows){return this.fail('成功');}else{return this.fail('失敗');},//テストインタフェース-testmodifyAction:function(){var time=getNowFullDate();yield P('test').where({body:id}).decrement("coins", 10); if(!insertId){return this.fail('成功');}else{return this.fail('失敗');},
// -   // 
queryAction:function*(){
    var time = getNowFullDate();
    var data = yield P('test').select();

        return  this.fail(data);
},

 // -   // 
queryAction:function*(){
    var time = getNowFullDate();
    var data = yield P('test').where({body: "4546"}).find();

        return  this.fail(data);
},