Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用validator #4

Open
lc-1010 opened this issue Jun 21, 2023 · 0 comments
Open

使用validator #4

lc-1010 opened this issue Jun 21, 2023 · 0 comments

Comments

@lc-1010
Copy link
Owner

lc-1010 commented Jun 21, 2023

  • 接口校验
  • 国际化处理,增加router中间件
lc-1010 added a commit that referenced this issue Jun 26, 2023
- Use validator to validate request data in request handling functions to ensue data  correctness
- Add translator to translate error message into user-friendly language to improve the user experience.
- To implement this feature, we store `uni,v` in the Gin's context at the `router.go` init
The implementation was inspired by `https://github.com/go-playground/validator/issues/286#issuecomment-308617838.`
`https://github.com/eddycjy/go-programming-tour-book-comments/issues/5#issuecomment-1106424554`

Refs #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant