add shorturl example code

This commit is contained in:
kevin
2020-09-01 16:04:39 +08:00
parent ea1c9aa250
commit b7a018b33a
28 changed files with 1336 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
type (
expandReq struct {
shorten string `form:"shorten"`
}
expandResp struct {
url string `json:"url"`
}
)
type (
shortenReq struct {
url string `form:"url"`
}
shortenResp struct {
shorten string `json:"shorten"`
}
)
service shorturl-api {
@server(
handler: ShortenHandler
)
get /shorten(shortenReq) returns(shortenResp)
@server(
handler: ExpandHandler
)
get /expand(expandReq) returns(expandResp)
}