simplify type definition in readme (#896)
* better text rendering * simplify type definition in readme
This commit is contained in:
16
readme.md
16
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.
|
2. create the API file, like greet.api, you can install the plugin of goctl in vs code, api syntax is supported.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type Request struct {
|
type (
|
||||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
Request {
|
||||||
}
|
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||||
|
}
|
||||||
|
|
||||||
type Response struct {
|
Response {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
service greet-api {
|
service greet-api {
|
||||||
@handler GreetHandler
|
@handler GreetHandler
|
||||||
@@ -217,4 +219,4 @@ Join the chat via https://join.slack.com/t/go-zero/shared_invite/zt-thyennhc-_fN
|
|||||||
|
|
||||||
## Give a Star! ⭐
|
## Give a Star! ⭐
|
||||||
|
|
||||||
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
|
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
|
||||||
|
|||||||
Reference in New Issue
Block a user