feat(api): 暴露电池 ORPC 契约

This commit is contained in:
2026-05-11 20:51:24 +08:00
parent ebe0970df1
commit 657c7317f7
2 changed files with 15 additions and 2 deletions
@@ -0,0 +1,13 @@
import { oc } from '@orpc/contract'
import { z } from 'zod'
import { batteriesResponseSchema, dashboardSnapshotSchema } from '@/domain/battery'
export const dashboard = oc.input(z.void()).output(dashboardSnapshotSchema)
export const batteries = oc
.input(
z.object({
mac: z.string().min(1).optional(),
}),
)
.output(batteriesResponseSchema)
+2 -2
View File
@@ -1,7 +1,7 @@
import * as todo from './todo.contract' import * as battery from './battery.contract'
export const contract = { export const contract = {
todo, battery,
} }
export type Contract = typeof contract export type Contract = typeof contract