summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/charts/user
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-11-12 02:02:25 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-11-12 02:02:25 +0900
commit0e4a111f81cceed275d9bec2695f6e401fb654d8 (patch)
tree40874799472fa07416f17b50a398ac33b7771905 /src/server/api/endpoints/charts/user
parentupdate deps (diff)
downloadsharkey-0e4a111f81cceed275d9bec2695f6e401fb654d8.tar.gz
sharkey-0e4a111f81cceed275d9bec2695f6e401fb654d8.tar.bz2
sharkey-0e4a111f81cceed275d9bec2695f6e401fb654d8.zip
refactoring
Resolve #7779
Diffstat (limited to 'src/server/api/endpoints/charts/user')
-rw-r--r--src/server/api/endpoints/charts/user/drive.ts35
-rw-r--r--src/server/api/endpoints/charts/user/following.ts35
-rw-r--r--src/server/api/endpoints/charts/user/notes.ts35
-rw-r--r--src/server/api/endpoints/charts/user/reactions.ts35
4 files changed, 0 insertions, 140 deletions
diff --git a/src/server/api/endpoints/charts/user/drive.ts b/src/server/api/endpoints/charts/user/drive.ts
deleted file mode 100644
index f2770e2df8..0000000000
--- a/src/server/api/endpoints/charts/user/drive.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import $ from 'cafy';
-import define from '../../../define';
-import { ID } from '@/misc/cafy-id';
-import { convertLog } from '@/services/chart/core';
-import { perUserDriveChart } from '@/services/chart/index';
-
-export const meta = {
- tags: ['charts', 'drive', 'users'],
-
- params: {
- span: {
- validator: $.str.or(['day', 'hour']),
- },
-
- limit: {
- validator: $.optional.num.range(1, 500),
- default: 30,
- },
-
- offset: {
- validator: $.optional.nullable.num,
- default: null,
- },
-
- userId: {
- validator: $.type(ID),
- }
- },
-
- res: convertLog(perUserDriveChart.schema),
-};
-
-export default define(meta, async (ps) => {
- return await perUserDriveChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
-});
diff --git a/src/server/api/endpoints/charts/user/following.ts b/src/server/api/endpoints/charts/user/following.ts
deleted file mode 100644
index 8c97b63e89..0000000000
--- a/src/server/api/endpoints/charts/user/following.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import $ from 'cafy';
-import define from '../../../define';
-import { ID } from '@/misc/cafy-id';
-import { convertLog } from '@/services/chart/core';
-import { perUserFollowingChart } from '@/services/chart/index';
-
-export const meta = {
- tags: ['charts', 'users', 'following'],
-
- params: {
- span: {
- validator: $.str.or(['day', 'hour']),
- },
-
- limit: {
- validator: $.optional.num.range(1, 500),
- default: 30,
- },
-
- offset: {
- validator: $.optional.nullable.num,
- default: null,
- },
-
- userId: {
- validator: $.type(ID),
- }
- },
-
- res: convertLog(perUserFollowingChart.schema),
-};
-
-export default define(meta, async (ps) => {
- return await perUserFollowingChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
-});
diff --git a/src/server/api/endpoints/charts/user/notes.ts b/src/server/api/endpoints/charts/user/notes.ts
deleted file mode 100644
index 0d5f5a8b6a..0000000000
--- a/src/server/api/endpoints/charts/user/notes.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import $ from 'cafy';
-import define from '../../../define';
-import { ID } from '@/misc/cafy-id';
-import { convertLog } from '@/services/chart/core';
-import { perUserNotesChart } from '@/services/chart/index';
-
-export const meta = {
- tags: ['charts', 'users', 'notes'],
-
- params: {
- span: {
- validator: $.str.or(['day', 'hour']),
- },
-
- limit: {
- validator: $.optional.num.range(1, 500),
- default: 30,
- },
-
- offset: {
- validator: $.optional.nullable.num,
- default: null,
- },
-
- userId: {
- validator: $.type(ID),
- }
- },
-
- res: convertLog(perUserNotesChart.schema),
-};
-
-export default define(meta, async (ps) => {
- return await perUserNotesChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
-});
diff --git a/src/server/api/endpoints/charts/user/reactions.ts b/src/server/api/endpoints/charts/user/reactions.ts
deleted file mode 100644
index 3cabe40d56..0000000000
--- a/src/server/api/endpoints/charts/user/reactions.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import $ from 'cafy';
-import define from '../../../define';
-import { ID } from '@/misc/cafy-id';
-import { convertLog } from '@/services/chart/core';
-import { perUserReactionsChart } from '@/services/chart/index';
-
-export const meta = {
- tags: ['charts', 'users', 'reactions'],
-
- params: {
- span: {
- validator: $.str.or(['day', 'hour']),
- },
-
- limit: {
- validator: $.optional.num.range(1, 500),
- default: 30,
- },
-
- offset: {
- validator: $.optional.nullable.num,
- default: null,
- },
-
- userId: {
- validator: $.type(ID),
- }
- },
-
- res: convertLog(perUserReactionsChart.schema),
-};
-
-export default define(meta, async (ps) => {
- return await perUserReactionsChart.getChart(ps.span as any, ps.limit!, ps.offset ? new Date(ps.offset) : null, ps.userId);
-});