MCPcopy Create free account
hub / github.com/bailicangdu/node-elm / getUserList

Method getUserList

controller/v2/user.js:236–249  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

234 return md5.update(password).digest('base64');
235 }
236 async getUserList(req, res, next){
237 const {limit = 20, offset = 0} = req.query;
238 try{
239 const users = await UserInfoModel.find({}, '-_id').sort({user_id: -1}).limit(Number(limit)).skip(Number(offset));
240 res.send(users);
241 }catch(err){
242 console.log('获取用户列表数据失败', err);
243 res.send({
244 status: 0,
245 type: 'GET_DATA_ERROR',
246 message: '获取用户列表数据失败'
247 })
248 }
249 }
250 async getUserCount(req, res, next){
251 try{
252 const count = await UserInfoModel.count();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected