rewrite litlyx

This commit is contained in:
Emily
2024-10-08 15:12:04 +02:00
parent b27cacf4e6
commit 79e956e930
33 changed files with 231 additions and 214 deletions

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `browsers:${pid}:${from}:${to}`;
const cacheKey = `browsers:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -5,7 +5,7 @@ import { getRequestData } from "~/server/utils/getRequestData";
export default defineEventHandler(async event => {
const data = await getRequestData(event);
const data = await getRequestData(event, { requireSchema: true });
if (!data) return;
const { schemaName, pid, from, to, model, project_id } = data;

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `countries:${pid}:${from}:${to}`;
const cacheKey = `countries:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `devices:${pid}:${from}:${to}`;
const cacheKey = `devices:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `events:${pid}:${from}:${to}`;
const cacheKey = `events:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `oss:${pid}:${from}:${to}`;
const cacheKey = `oss:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `referrers:${pid}:${from}:${to}`;
const cacheKey = `referrers:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
const cacheKey = `websites:${pid}:${from}:${to}`;
const cacheKey = `websites:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {

View File

@@ -12,7 +12,7 @@ export default defineEventHandler(async event => {
const websiteName = getHeader(event, 'x-website-name');
const cacheKey = `websites_pages:${websiteName}:${pid}:${from}:${to}`;
const cacheKey = `websites_pages:${websiteName}:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {