Improve doc

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

View file

@ -1,6 +1,7 @@
import $ from 'cafy';
import define from '../../define';
import driveChart from '../../../../services/chart/drive';
import driveChart, { driveLogSchema } from '../../../../services/chart/drive';
import { convertLog } from '../../../../services/chart';
export const meta = {
stability: 'stable',
@ -28,12 +29,7 @@ export const meta = {
},
},
res: {
type: 'array',
items: {
type: 'object',
},
},
res: convertLog(driveLogSchema),
};
export default define(meta, async (ps) => {

View file

@ -2,46 +2,74 @@ import autobind from 'autobind-decorator';
import Chart, { Obj } from './';
import DriveFile, { IDriveFile } from '../../models/drive-file';
import { isLocalUser } from '../../models/user';
import { SchemaType } from '../../prelude/schema';
/**
*
*/
type DriveLog = {
local: {
/**
*
*/
totalCount: number;
const logSchema = {
/**
*
*/
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;
};
remote: DriveLog['local'];
/**
* 使
*/
decSize: {
type: 'number' as 'number',
description: '減少したドライブ使用量'
},
};
export const driveLogSchema = {
type: 'object' as 'object',
properties: {
local: {
type: 'object' as 'object',
properties: logSchema
},
remote: {
type: 'object' as 'object',
properties: logSchema
},
}
};
type DriveLog = SchemaType<typeof driveLogSchema>;
class DriveChart extends Chart<DriveLog> {
constructor() {
super('drive');