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 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 { convertLog } from '../../../../../services/chart';
export const meta = {
stability: 'stable',
@ -38,12 +39,7 @@ export const meta = {
}
},
res: {
type: 'array',
items: {
type: 'object',
},
},
res: convertLog(perUserDriveLogSchema),
};
export default define(meta, async (ps) => {

View file

@ -1,42 +1,63 @@
import autobind from 'autobind-decorator';
import Chart, { Obj } from './';
import DriveFile, { IDriveFile } from '../../models/drive-file';
import { SchemaType } from '../../prelude/schema';
/**
*
*/
type PerUserDriveLog = {
export const perUserDriveLogSchema = {
type: 'object' as 'object',
properties: {
/**
*
*/
totalCount: number;
totalCount: {
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> {
constructor() {
super('perUserDrive', true);