我想同时在Corda

时间:2019-06-12 12:02:21

标签: corda

我想按用户权限搜索用户,

权限是“一般”“管理员”,

α,此代码为搜索代码

val states = proxy.vaultQueryBy<UserState>().states
val results = states.filter { it.state.data.authority.toString() == "general" }

β,此代码为分页代码

val paging = PageSpecification(1, 10)
val states = proxy.vaultQueryBy<UserState>(paging=paging).states

我想同时使用α和β (我想获得前10名普通用户)

这可能吗?谢谢,

1 个答案:

答案 0 :(得分:1)

它真的应该像这样简单:

val paging = PageSpecification(1, 10)
val states = proxy.vaultQueryBy<UserState>(paging=paging).states
val results = states.filter { it.state.data.authority.toString() == "general" }

这对您不起作用吗?如果是这样,您看到什么错误?