feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain

This commit is contained in:
2025-09-19 22:22:05 -05:00
parent caf2315191
commit e4477402ad
847 changed files with 165801 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import { z, createRoute, OpenAPIHono } from "@hono/zod-openapi";
import { addReader } from "../controller/addReader.js";
import { authMiddleware } from "../../auth/middleware/authMiddleware.js";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import type { User } from "../../../types/users.js";
import { apiHit } from "../../../globalUtils/apiHits.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getReaders } from "../controller/getReaders.js";
const app = new OpenAPIHono();
export const ReaderBody = z.object({
reader: z.string().openapi({ example: "wrapper1" }),
readerIP: z.string().openapi({ example: "192.168.1.52" }),
});
app.openapi(
createRoute({
tags: ["rfid"],
summary: "Get readers",
method: "get",
path: "/getreaders",
responses: responses(),
}),
async (c: any) => {
apiHit(c, { endpoint: "/getreaders" });
const { data, error } = await tryCatch(getReaders());
if (error) {
return c.json({
error,
});
}
return c.json({
data,
});
}
);
export default app;