Skip to content
Snippets Groups Projects
Unverified Commit a55d5516 authored by syuilo's avatar syuilo
Browse files

Improve doc

parent b679163d
No related branches found
No related tags found
No related merge requests found
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) => {
......
......@@ -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;
/**
* 集計期間時点での、全ドライブファイルの合計サイズ
*/
totalSize: number;
/**
* 増加したドライブファイル数
*/
incCount: number;
/**
* 増加したドライブ使用量
*/
incSize: number;
/**
* 減少したドライブファイル数
*/
decCount: number;
/**
* 減少したドライブ使用量
*/
decSize: number;
};
remote: DriveLog['local'];
const logSchema = {
/**
* 集計期間時点での、全ドライブファイル数
*/
totalCount: {
type: 'number' as 'number',
description: '集計期間時点での、全ドライブファイル数'
},
/**
* 集計期間時点での、全ドライブファイルの合計サイズ
*/
totalSize: {
type: 'number' as 'number',
description: '集計期間時点での、全ドライブファイルの合計サイズ'
},
/**
* 増加したドライブファイル数
*/
incCount: {
type: 'number' as 'number',
description: '増加したドライブファイル数'
},
/**
* 増加したドライブ使用量
*/
incSize: {
type: 'number' as 'number',
description: '増加したドライブ使用量'
},
/**
* 減少したドライブファイル数
*/
decCount: {
type: 'number' as 'number',
description: '減少したドライブファイル数'
},
/**
* 減少したドライブ使用量
*/
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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment