- 将客户端导出改为私有常量,避免外部直接访问。 - 添加待办事项的完整 CRUD 操作,包括列表查询、创建、更新和删除功能,并使用 Zod 进行输入输出验证和 Drizzle ORM 操作数据库。 - 导出客户端和路由器模块的公共接口 - 添加路由配置,将 todo 处理程序注册到路由系统中。 - 删除已废弃的路由定义文件 - 删除待办事项相关路由和接口定义 - 删除未使用的 TodoSchema 模式定义以清理代码库。 - 将 Todo 路由重命名为复数形式并迁移数据获取与操作逻辑至 Orpc 客户端调用 - 将路由名称和路径从 `/todo` 更新为 `/todos`,并同步更新相关类型定义和引用。
105 lines
2.9 KiB
TypeScript
105 lines
2.9 KiB
TypeScript
/* eslint-disable */
|
|
|
|
// @ts-nocheck
|
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
// This file was automatically generated by TanStack Router.
|
|
// You should NOT make any changes in this file as it will be overwritten.
|
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
|
|
import { Route as rootRouteImport } from './routes/__root'
|
|
import { Route as TodosRouteImport } from './routes/todos'
|
|
import { Route as IndexRouteImport } from './routes/index'
|
|
import { Route as ApiRpcSplatRouteImport } from './routes/api/rpc.$'
|
|
|
|
const TodosRoute = TodosRouteImport.update({
|
|
id: '/todos',
|
|
path: '/todos',
|
|
getParentRoute: () => rootRouteImport,
|
|
} as any)
|
|
const IndexRoute = IndexRouteImport.update({
|
|
id: '/',
|
|
path: '/',
|
|
getParentRoute: () => rootRouteImport,
|
|
} as any)
|
|
const ApiRpcSplatRoute = ApiRpcSplatRouteImport.update({
|
|
id: '/api/rpc/$',
|
|
path: '/api/rpc/$',
|
|
getParentRoute: () => rootRouteImport,
|
|
} as any)
|
|
|
|
export interface FileRoutesByFullPath {
|
|
'/': typeof IndexRoute
|
|
'/todos': typeof TodosRoute
|
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
}
|
|
export interface FileRoutesByTo {
|
|
'/': typeof IndexRoute
|
|
'/todos': typeof TodosRoute
|
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
}
|
|
export interface FileRoutesById {
|
|
__root__: typeof rootRouteImport
|
|
'/': typeof IndexRoute
|
|
'/todos': typeof TodosRoute
|
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
}
|
|
export interface FileRouteTypes {
|
|
fileRoutesByFullPath: FileRoutesByFullPath
|
|
fullPaths: '/' | '/todos' | '/api/rpc/$'
|
|
fileRoutesByTo: FileRoutesByTo
|
|
to: '/' | '/todos' | '/api/rpc/$'
|
|
id: '__root__' | '/' | '/todos' | '/api/rpc/$'
|
|
fileRoutesById: FileRoutesById
|
|
}
|
|
export interface RootRouteChildren {
|
|
IndexRoute: typeof IndexRoute
|
|
TodosRoute: typeof TodosRoute
|
|
ApiRpcSplatRoute: typeof ApiRpcSplatRoute
|
|
}
|
|
|
|
declare module '@tanstack/react-router' {
|
|
interface FileRoutesByPath {
|
|
'/todos': {
|
|
id: '/todos'
|
|
path: '/todos'
|
|
fullPath: '/todos'
|
|
preLoaderRoute: typeof TodosRouteImport
|
|
parentRoute: typeof rootRouteImport
|
|
}
|
|
'/': {
|
|
id: '/'
|
|
path: '/'
|
|
fullPath: '/'
|
|
preLoaderRoute: typeof IndexRouteImport
|
|
parentRoute: typeof rootRouteImport
|
|
}
|
|
'/api/rpc/$': {
|
|
id: '/api/rpc/$'
|
|
path: '/api/rpc/$'
|
|
fullPath: '/api/rpc/$'
|
|
preLoaderRoute: typeof ApiRpcSplatRouteImport
|
|
parentRoute: typeof rootRouteImport
|
|
}
|
|
}
|
|
}
|
|
|
|
const rootRouteChildren: RootRouteChildren = {
|
|
IndexRoute: IndexRoute,
|
|
TodosRoute: TodosRoute,
|
|
ApiRpcSplatRoute: ApiRpcSplatRoute,
|
|
}
|
|
export const routeTree = rootRouteImport
|
|
._addFileChildren(rootRouteChildren)
|
|
._addFileTypes<FileRouteTypes>()
|
|
|
|
import type { getRouter } from './router.tsx'
|
|
import type { createStart } from '@tanstack/react-start'
|
|
declare module '@tanstack/react-start' {
|
|
interface Register {
|
|
ssr: true
|
|
router: Awaited<ReturnType<typeof getRouter>>
|
|
}
|
|
}
|