Improve doc

This commit is contained in:
syuilo 2019-02-24 10:08:09 +09:00
parent 97b99867f2
commit ac0390fec3
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
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);