mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 21:19:07 +01:00
2ebbb70356
Closes #1411
49 lines
992 B
TypeScript
49 lines
992 B
TypeScript
/**
|
|
* Module dependencies
|
|
*/
|
|
import Note from '../../../models/note';
|
|
import User from '../../../models/user';
|
|
|
|
/**
|
|
* @swagger
|
|
* /stats:
|
|
* note:
|
|
* summary: Show the misskey's statistics
|
|
* responses:
|
|
* 200:
|
|
* description: Success
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* notesCount:
|
|
* description: count of all notes of misskey
|
|
* type: number
|
|
* usersCount:
|
|
* description: count of all users of misskey
|
|
* type: number
|
|
*
|
|
* default:
|
|
* description: Failed
|
|
* schema:
|
|
* $ref: "#/definitions/Error"
|
|
*/
|
|
|
|
/**
|
|
* Show the misskey's statistics
|
|
*
|
|
* @param {any} params
|
|
* @return {Promise<any>}
|
|
*/
|
|
module.exports = params => new Promise(async (res, rej) => {
|
|
const notesCount = await Note
|
|
.count();
|
|
|
|
const usersCount = await User
|
|
.count();
|
|
|
|
res({
|
|
notesCount: notesCount,
|
|
usersCount: usersCount
|
|
});
|
|
});
|