import { Injectable } from '@nestjs/common'; import { TrpcService } from '@server/trpc/trpc.service'; import { GoodsService } from './goods.service'; import { Prisma } from '@nice/common'; import { z, ZodType } from 'zod'; const GoodsUncheckedCreateInputSchema: ZodType = z.any(); const GoodsWhereInputSchema: ZodType = z.any(); const GoodsSelectSchema: ZodType = z.any(); @Injectable() export class GoodsRouter { constructor( private readonly trpc: TrpcService, private readonly goodsService: GoodsService, ) {} // trpc路由 router = this.trpc.router({ // 希望前端传什么参数 //最简单的trpc写法 hello: this.trpc.procedure .input( z.object({ name: z.string(), }), ) .query(({ input }) => { return input.name; }), }); }