mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
simplify type definition in readme (#896)
* better text rendering * simplify type definition in readme
This commit is contained in:
14
readme.md
14
readme.md
@@ -112,13 +112,15 @@ go get -u github.com/tal-tech/go-zero
|
||||
2. create the API file, like greet.api, you can install the plugin of goctl in vs code, api syntax is supported.
|
||||
|
||||
```go
|
||||
type Request struct {
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
type (
|
||||
Request {
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
Response {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
)
|
||||
|
||||
service greet-api {
|
||||
@handler GreetHandler
|
||||
|
||||
Reference in New Issue
Block a user