-
Notifications
You must be signed in to change notification settings - Fork 237
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
hz 使用 (protobuf) #631
Comments
这样子写吗? |
https://www.cloudwego.io/docs/hertz/tutorials/toolkit/usage/command/ 如果所有字段都是required的话 |
你好 自己要怎么判断呢?是自己在业务层里自己判断吗? 比如说 if name==""{return err} |
嗯好的谢谢 |
你好 我试了,这样子写就可以 |
请问如何生成必须传输的请求字段呢?我看通过protobuf 生成的 字段都是 omitempty,有必传的字段要怎么写 呢?
比如 我下面的 id 和 name 字段要求必传,要怎么写 UpdateRepositoryReq 呢?
message UpdateRepositoryReq {
int64 Id = 1[(api.path) = "id"];
string Name = 2[(api.body) = "name"];
}
type UpdateRepositoryReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
The text was updated successfully, but these errors were encountered: