修复:转发规则自定义发送通道顺序失效(将List<T>按照instr的顺序排序) #422

This commit is contained in:
pppscn 2024-03-06 16:06:25 +08:00
parent da30f0dda2
commit 09d3e3f785
2 changed files with 2 additions and 4 deletions

View File

@ -34,8 +34,7 @@ class FrpcRepository(private val frpcDao: FrpcDao) {
fun getByUids(uids: List<String>, instr: String): List<Frpc> {
val frpcs = frpcDao.getByUids(uids)
// 将结果按照 instr() 的顺序进行排序
frpcs.sortedBy { instr.indexOf(it.uid) }
return frpcs
return frpcs.sortedBy { instr.indexOf(it.uid) }
}
}

View File

@ -33,8 +33,7 @@ class SenderRepository(private val senderDao: SenderDao) {
fun getByIds(ids: List<Long>, instr: String): List<Sender> {
val senders = senderDao.getByIds(ids)
// 将结果按照 instr() 的顺序进行排序
senders.sortedBy { instr.indexOf(it.id.toString()) }
return senders
return senders.sortedBy { instr.indexOf(it.id.toString()) }
}
fun getAllNonCache(): List<Sender> {