2
我有一個用戶模型和跟隨者模型,它與跟隨者和followee有用戶的HasManyThrough關係。 如何更改默認的__get__followers方法參數?重寫關係遠端方法在Strongloop Loopback中
我有一個用戶模型和跟隨者模型,它與跟隨者和followee有用戶的HasManyThrough關係。 如何更改默認的__get__followers方法參數?重寫關係遠端方法在Strongloop Loopback中
我想通了,我可以用普通的方式添加一個新的遠程方法。
loopback.remoteMethod(
UserModel.prototype.getFollows,
{
description: 'Get the users who are followed by the user',
accepts: [
{arg: 'page', type: 'Number', http: {source: 'query'}, required: true}
],
returns: {arg: 'data', type: 'object'},
http: {verb: 'get', path: '/follows'},
isStatic: false,
}
);
回答http://stackoverflow.com/a/37698420/928763 – Firdous 2016-06-08 09:27:45