(req, res, next)
| 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() |
nothing calls this directly
no outgoing calls
no test coverage detected