import { cache } from 'react';
import { serverRequest } from '@/lib/server/request';

export const fetchCharacterDetail = cache(async (id: string) => {
  const res = await serverRequest(`/character/detail`, {
    method: 'POST',
    data: { id },
    // Next.js 缓存：每小时重新验证一次
    revalidate: 3600,
  });
  return res.data ?? {};
});
