You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
710 B

syntax = "v1"
type request {
Id int `json:"id,default=0"`
Other string `json:"other,optional,default=xxx"` //
}
type response {
Success bool `json:"success"` //
Code int `json:"code"` //
Msg string `json:"msg"` //
Data interface{} `json:"data"` //
}
@server(
// group: xxx //代码分组
prefix: / // 路由前缀
timeout: 3s // 超时时间
// middlewares: [ // TODO: add middlewares ] // 中间件
// jwt: Auth // jwt 验证
// signature: true // 通过 signature 关键字开启签名功能
)
service {{.serviceName}} {
@doc(
summary: "ping"
description: "返回 pong"
)
@handler PingHander
get /ping returns(response)
}