feat(lyra): 搭建基础骨架与配置响应组件
- 使用 Viper 加载 TOML 配置 - 定义统一响应、业务错误码及响应辅助函数 - 添加分层职责约束并同步架构文档
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package api
|
||||
|
||||
type Response struct {
|
||||
Success bool `json:"success"`
|
||||
Data any `json:"data,omitempty"`
|
||||
Error *ErrorInfo `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type ErrorInfo struct {
|
||||
Code ErrorCode `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Debug string `json:"debug,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user