40 lines
854 B
Plaintext
40 lines
854 B
Plaintext
syntax = "v1"
|
||
|
||
// 業務 data(Logic returns 型別;HTTP 外層 envelope 見 @respdoc)
|
||
type PingData {
|
||
Pong string `json:"pong"`
|
||
}
|
||
|
||
// 文件用:成功回應 envelope(HTTP 200, code=102000, message=SUCCESS)
|
||
type PingOKStatus {
|
||
Code int64 `json:"code"`
|
||
Message string `json:"message"`
|
||
Data PingData `json:"data"`
|
||
}
|
||
|
||
@server(
|
||
group: normal
|
||
prefix: /api/v1
|
||
schemes: https
|
||
timeout: 3s
|
||
tags: "Normal - 公開"
|
||
summary: "健康檢查 / Ping"
|
||
)
|
||
service gateway {
|
||
@doc(
|
||
summary: "Ping"
|
||
description: "確認伺服器狀態"
|
||
)
|
||
/*
|
||
@respdoc-200 (PingOKStatus) // 成功(code=102000)
|
||
@respdoc-400 (
|
||
10101000: (APIErrorStatus) 參數格式錯誤
|
||
) // 參數錯誤
|
||
@respdoc-500 (
|
||
10601000: (APIErrorStatus) 系統內部錯誤
|
||
) // 內部錯誤
|
||
*/
|
||
@handler ping
|
||
get /health () returns (PingData)
|
||
}
|