import { OpenAPIHono } from '@hono/zod-openapi';
import { AuthContext } from '@d8d/shared-types';
import loginRoute from './login.route';
import registerRoute from './register.route';
import miniLoginRoute from './mini-login.route';
import meRoute from './me.route';
import updateMeRoute from './update-me.route';
import logoutRoute from './logout.route';
import ssoVerifyRoute from './sso-verify.route';
import phoneDecryptRoute from './phone-decrypt.route';
import enterpriseLoginRoute from './enterprise-login.route';
import enterpriseLogoutRoute from './enterprise-logout.route';
import enterpriseMeRoute from './enterprise-me.route';

// 创建统一的路由应用
const authRoutes = new OpenAPIHono<AuthContext>()
  .route('/', loginRoute)
  .route('/', registerRoute)
  .route('/', miniLoginRoute)
  .route('/', meRoute)
  .route('/', updateMeRoute)
  .route('/', logoutRoute)
  .route('/', ssoVerifyRoute)
  .route('/', phoneDecryptRoute)
  .route('/', enterpriseLoginRoute)
  .route('/', enterpriseLogoutRoute)
  .route('/', enterpriseMeRoute);

// 单独的企业用户认证路由
const enterpriseAuthRoutes = new OpenAPIHono<AuthContext>()
  .route('/', enterpriseLoginRoute)
  .route('/', enterpriseLogoutRoute)
  .route('/', enterpriseMeRoute);

export { authRoutes, enterpriseAuthRoutes };
export default authRoutes;