서버 코드를 Router, Service, Repository 계층으로 분리하고 오류 처리 및 파일 삭제 로직 개선

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-12 00:00:21 +09:00
1 parent ed732be999
commit 6a6aa1765b
72 files changed
+1928 -1509

No files matched your search

+4 -9
View File
@@ -1,15 +1,10 @@
import { TRPCError } from "@trpc/server";
import { UserRepo } from "#lib/server/db/index.js";
import { router, roleProcedure } from "../init.server";
import { UserService } from "#lib/server/services/index.js";
import { router, roleProcedure } from "#trpc/init.server.js";
const userRouter = router({
get: roleProcedure["any"].query(async ({ ctx }) => {
const user = await UserRepo.getUser(ctx.session.userId);
if (!user) {
throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", message: "Invalid session id" });
}
return { email: user.email, nickname: user.nickname };
const { email, nickname } = await UserService.getUser(ctx.session.userId);
return { email, nickname };
}),
});