template-monorepo/generate/api/normal.api

40 lines
854 B
Plaintext
Raw Permalink Normal View History

2026-05-19 11:00:28 +00:00
syntax = "v1"
// 業務 dataLogic returns 型別HTTP 外層 envelope 見 @respdoc
type PingData {
Pong string `json:"pong"`
}
// 文件用:成功回應 envelopeHTTP 200, code=102000, message=SUCCESS
2026-05-19 11:00:28 +00:00
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"
2026-05-19 11:00:28 +00:00
)
service gateway {
@doc(
summary: "Ping"
description: "確認伺服器狀態"
)
/*
@respdoc-200 (PingOKStatus) // 成功code=102000
@respdoc-400 (
10101000: (APIErrorStatus) 參數格式錯誤
) // 參數錯誤
@respdoc-500 (
10601000: (APIErrorStatus) 系統內部錯誤
) // 內部錯誤
2026-05-19 11:00:28 +00:00
*/
@handler ping
get /health () returns (PingData)
}