Improve doc

This commit is contained in:
syuilo 2019-02-24 10:04:27 +09:00
parent a55d5516a6
commit 97b99867f2
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
2 changed files with 39 additions and 37 deletions

View File

@ -1,7 +1,8 @@
import $ from 'cafy';
import define from '../../../define';
import perUserNotesChart from '../../../../../services/chart/per-user-notes';
import perUserNotesChart, { perUserNotesLogSchema } from '../../../../../services/chart/per-user-notes';
import ID, { transform } from '../../../../../misc/cafy-id';
import { convertLog } from '../../../../../services/chart';
export const meta = {
stability: 'stable',
@ -38,12 +39,7 @@ export const meta = {
}
},
res: {
type: 'array',
items: {
type: 'object',
},
},
res: convertLog(perUserNotesLogSchema),
};
export default define(meta, async (ps) => {

View File

@ -2,44 +2,50 @@ import autobind from 'autobind-decorator';
import Chart, { Obj } from './';
import Note, { INote } from '../../models/note';
import { IUser } from '../../models/user';
import { SchemaType } from '../../prelude/schema';
/**
* 稿
*/
type PerUserNotesLog = {
/**
* 稿
*/
total: number;
export const perUserNotesLogSchema = {
type: 'object' as 'object',
properties: {
total: {
type: 'number' as 'number',
description: '集計期間時点での、全投稿数'
},
/**
* 稿
*/
inc: number;
inc: {
type: 'number' as 'number',
description: '増加した投稿数'
},
/**
* 稿
*/
dec: number;
dec: {
type: 'number' as 'number',
description: '減少した投稿数'
},
diffs: {
/**
* 稿
*/
normal: number;
type: 'object' as 'object',
properties: {
normal: {
type: 'number' as 'number',
description: '通常の投稿数の差分'
},
/**
* 稿
*/
reply: number;
reply: {
type: 'number' as 'number',
description: 'リプライの投稿数の差分'
},
/**
* Renoteの投稿数の差分
*/
renote: number;
};
renote: {
type: 'number' as 'number',
description: 'Renoteの投稿数の差分'
},
}
},
}
};
type PerUserNotesLog = SchemaType<typeof perUserNotesLogSchema>;
class PerUserNotesChart extends Chart<PerUserNotesLog> {
constructor() {
super('perUserNotes', true);