import { OpenAPIHono } from '@hono/zod-openapi';
import listRoute from './get';
import createRoute from './post';
import getByIdRoute from './[id]/get';
import updateRoute from './[id]/put';
import deleteRoute from './[id]/delete';
import generateRoute from './[id]/generate/post';
import chaptersRoute from './[id]/chapters/index';
import { AuthContext } from '@/server/types/context';

// 创建路由实例并聚合所有子路由
const app = new OpenAPIHono<AuthContext>()
  .route('/', listRoute)
  .route('/', createRoute)
  .route('/', getByIdRoute)
  .route('/', updateRoute)
  .route('/', deleteRoute)
  .route('/', generateRoute)
  .route('/', chaptersRoute);

export default app;