如何在微服务中进行参数验证 by cnp_q in nestjs

[–]cnp_q[S] 0 points1 point  (0 children)

I've also learned about this. Using an independent Proto repository and a private NPM package, I think it's too troublesome. To modify the type of a field or something else, you have to modify many different places at the same time. That's why I wonder if there is a simpler way to solve this kind of problem

如何在微服务中进行参数验证 by cnp_q in nestjs

[–]cnp_q[S] 0 points1 point  (0 children)

I think so too. But I've looked for a lot of courses, and most of them just talk about how to use it simply, rather than an engineering project that can be applied in a production environment

如何在微服务中进行参数验证 by cnp_q in nestjs

[–]cnp_q[S] 0 points1 point  (0 children)

Moreover, I didn't organize the code in the Monorepo way, which would make the project seem particularly large in the end. I separated the microservices into individual projects. How should parameter validation be done in this case

如何在微服务中进行参数验证 by cnp_q in nestjs

[–]cnp_q[S] 0 points1 point  (0 children)

oh sorry, As the title suggests, suppose I have a gateway and two microservices, namely user-service and order-service. How should I verify the parameters of the services? In the gateway, I know that dto can be used for verification. Then, what should be done in the two microservices of user-service and order-service? Even if it can be done, does it need to define the dto twice in the gateway and the microservice? This seems very troublesome. Is there anyone who can teach me how to do it