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

Method getAllAdmin

controller/admin/admin.js:178–194  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

176 }
177 }
178 async getAllAdmin(req, res, next){
179 const {limit = 20, offset = 0} = req.query;
180 try{
181 const allAdmin = await AdminModel.find({}, '-_id -password').sort({id: -1}).skip(Number(offset)).limit(Number(limit))
182 res.send({
183 status: 1,
184 data: allAdmin,
185 })
186 }catch(err){
187 console.log('获取超级管理列表失败', err);
188 res.send({
189 status: 0,
190 type: 'ERROR_GET_ADMIN_LIST',
191 message: '获取超级管理列表失败'
192 })
193 }
194 }
195 async getAdminCount(req, res, next){
196 try{
197 const count = await AdminModel.count()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected