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
744 B
31 lines
744 B
syntax = "v1"
|
|
|
|
type request {
|
|
Id int `json:"id,default=0"`
|
|
Who string `json:"Who,optional,options=you|me,default=you"` // 示例,可选值,you|me,默认you
|
|
}
|
|
|
|
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 {{.name}}-api {
|
|
@doc(
|
|
summary: "ping"
|
|
description: "返回 pong"
|
|
)
|
|
@handler Ping
|
|
get /ping returns(response)
|
|
|
|
}
|
|
|