mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
fix(goctl): multi imports the api cause redeclared error in types.go (#3988)
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
17
tools/goctl/api/gogen/testdata/another_import_api.api
vendored
Normal file
17
tools/goctl/api/gogen/testdata/another_import_api.api
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import "importApi.api"
|
||||
|
||||
type AnotherRequest {
|
||||
Name string `path:"name,options=you|me"`
|
||||
}
|
||||
|
||||
type AnotherResponse {
|
||||
Message string `json:"message"` // message
|
||||
}
|
||||
|
||||
@server(
|
||||
group: greet
|
||||
)
|
||||
service A-api {
|
||||
@handler AnotherImportHandler
|
||||
get /greet/from/another/:name(AnotherRequest) returns (AnotherResponse)
|
||||
}
|
||||
@@ -1,16 +1,17 @@
|
||||
import "importApi.api"
|
||||
|
||||
type Request struct {
|
||||
type Request {
|
||||
Name string `path:"name,options=you|me"`
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
type Response {
|
||||
Message string `json:"message"` // message
|
||||
}
|
||||
|
||||
@server(
|
||||
group: greet
|
||||
)
|
||||
service A-api {
|
||||
@server(
|
||||
handler: GreetHandler
|
||||
)
|
||||
@handler GreetHandler
|
||||
get /greet/from/:name(Request) returns (Response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
type ImportData struct {
|
||||
type ImportData {
|
||||
Name string `path:"name,options=you|me"`
|
||||
}
|
||||
}
|
||||
|
||||
2
tools/goctl/api/gogen/testdata/import_twice.api
vendored
Normal file
2
tools/goctl/api/gogen/testdata/import_twice.api
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import "hasImportApi.api"
|
||||
import "anotherImportApi.api"
|
||||
Reference in New Issue
Block a user