Improve chart engine (#8253)
* wip * wip * wip * wip * wip * wip * wip * Update core.ts * wip * wip * #7361 * delete network chart * federationChart強化 apRequestChart追加 * tweak
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
import $ from 'cafy';
|
||||
import define from '../../define';
|
||||
import { convertLog } from '@/services/chart/core';
|
||||
import { apRequestChart } from '@/services/chart/index';
|
||||
|
||||
export const meta = {
|
||||
tags: ['charts'],
|
||||
|
||||
params: {
|
||||
span: {
|
||||
validator: $.str.or(['day', 'hour']),
|
||||
},
|
||||
|
||||
limit: {
|
||||
validator: $.optional.num.range(1, 500),
|
||||
default: 30,
|
||||
},
|
||||
|
||||
offset: {
|
||||
validator: $.optional.nullable.num,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
// TODO: response definition
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps) => {
|
||||
return await apRequestChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null);
|
||||
});
|
Reference in New Issue
Block a user