增加根据用户id批量查询接口

This commit is contained in:
2020-07-03 14:58:24 +08:00
parent 65180cb36b
commit a1d72c685e
2 changed files with 13 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package com.synebula.zeus.query.contr
import com.synebula.gaea.data.message.Message
import com.synebula.zeus.query.view.SignUserView
import com.synebula.zeus.query.view.UserView
interface IUserQuery {
/**
@@ -13,4 +14,11 @@ interface IUserQuery {
* @return 返回消息体, 200为登录成功, data为用户ID
*/
fun signIn(name: String, password: String): Message<SignUserView>
/**
* 列出用户列表
*
* @param idList 用户ID列表
*/
fun listUsers(idList: List<String>): List<UserView>
}

View File

@@ -35,4 +35,9 @@ class UserQuery(template: MongoTemplate) :
} else
Message(Status.Failure, "用户名或密码错误")
}
override fun listUsers(idList: List<String>): List<UserView> {
return this.template.find(Query.query(Criteria.where("_id").`in`(idList)), this.clazz!!, "user")
}
}