增加根据用户id批量查询接口
This commit is contained in:
@@ -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>
|
||||
}
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user