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

google.protobuf.Empty 生成异常问题。 #1009

Open
xiaohunsdt opened this issue Nov 28, 2023 · 7 comments
Open

google.protobuf.Empty 生成异常问题。 #1009

xiaohunsdt opened this issue Nov 28, 2023 · 7 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@xiaohunsdt
Copy link

xiaohunsdt commented Nov 28, 2023

Describe the bug

import "google/protobuf/empty.proto";
service ClientService {
rpc Stat(google.protobuf.Empty) returns(common.BaseRespBody) {
option (api.get) = "/client/stat";
}
}

服务里面使用了google.protobuf.Empty,然后通过hz工具生成go文件,handler文件里面生成了诡异的
emptypb "turing/biz/model/google.golang.org/protobuf/types/known/emptypb"

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

google.protobuf.Empty应该被生成为emptypb "google.golang.org/protobuf/types/known/emptypb"

Screenshots

If applicable, add screenshots to help explain your problem.

Hertz version:

v0.7.1

Environment:

require (
github.com/cloudwego/hertz v0.7.2
github.com/go-redis/redis/v7 v7.4.1
github.com/hertz-contrib/jwt v1.0.2
github.com/hertz-contrib/logger/logrus v1.0.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.17.0
google.golang.org/protobuf v1.31.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gorm.io/driver/mysql v1.5.2
gorm.io/gorm v1.25.5
gorm.io/plugin/dbresolver v1.5.0
)

Additional context

平台:win11

@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Nov 28, 2023
Copy link

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.

@github-actions github-actions bot added the stale label Nov 28, 2023
@li-jin-gou li-jin-gou added question Further information is requested and removed invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale labels Nov 28, 2023
@xiaohunsdt
Copy link
Author

proto位置:./idl/pc/pc_service.proto

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Nov 29, 2023

目前工具没有对 protobuf 的 WKT 类型做特殊的适配处理,这块你先手动修改下 import 吧。之后有时间我给这块的处理统一加上

@xiaohunsdt
Copy link
Author

每次update都会重新出现

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Nov 30, 2023

每次update都会重新出现

或者目前可以先将 empty 等 wkt 类型封装到一个 message 里

@xiaohunsdt
Copy link
Author

明白了,这个什么时候更新呢?

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Dec 1, 2023

明白了,这个什么时候更新呢?

我先排一个任务,需要梳理下支持 wkt 类型需不需要其他的一些操作

@li-jin-gou li-jin-gou added the bug Something isn't working label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Development

No branches or pull requests

3 participants