Improve doc

This commit is contained in:
syuilo 2019-02-24 10:08:09 +09:00
parent 799adcae99
commit d28f9152d9
2 changed files with 52 additions and 35 deletions

View file

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

View file

@ -1,42 +1,63 @@
import autobind from 'autobind-decorator'; import autobind from 'autobind-decorator';
import Chart, { Obj } from './'; import Chart, { Obj } from './';
import DriveFile, { IDriveFile } from '../../models/drive-file'; import DriveFile, { IDriveFile } from '../../models/drive-file';
import { SchemaType } from '../../prelude/schema';
/** export const perUserDriveLogSchema = {
* type: 'object' as 'object',
*/ properties: {
type PerUserDriveLog = { /**
/** *
* */
*/ totalCount: {
totalCount: number; type: 'number' as 'number',
description: '集計期間時点での、全ドライブファイル数'
},
/** /**
* *
*/ */
totalSize: number; totalSize: {
type: 'number' as 'number',
description: '集計期間時点での、全ドライブファイルの合計サイズ'
},
/** /**
* *
*/ */
incCount: number; incCount: {
type: 'number' as 'number',
description: '増加したドライブファイル数'
},
/** /**
* 使 * 使
*/ */
incSize: number; incSize: {
type: 'number' as 'number',
description: '増加したドライブ使用量'
},
/** /**
* *
*/ */
decCount: number; decCount: {
type: 'number' as 'number',
description: '減少したドライブファイル数'
},
/** /**
* 使 * 使
*/ */
decSize: number; decSize: {
type: 'number' as 'number',
description: '減少したドライブ使用量'
},
}
}; };
type PerUserDriveLog = SchemaType<typeof perUserDriveLogSchema>;
class PerUserDriveChart extends Chart<PerUserDriveLog> { class PerUserDriveChart extends Chart<PerUserDriveLog> {
constructor() { constructor() {
super('perUserDrive', true); super('perUserDrive', true);