refactor: 重构目录结构,后端代码统一到 backend/ 目录
All checks were successful
GoLoom CI / Lint (push) Successful in 3m7s
GoLoom CI / Test (push) Successful in 5s
GoLoom CI / Build (push) Successful in 24s

This commit is contained in:
hhs
2026-06-10 15:35:32 +08:00
parent caada15831
commit 8c515a8b3e
23 changed files with 13 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
package types
const (
CodeSuccess = "0000"
InfoSuccess = "success"
CodeUnknownError = "0001"
InfoUnknownError = "unknown error"
CodeIllegalParameter = "0002"
InfoIllegalParameter = "illegal parameter"
CodeAgentNotFound = "0003"
InfoAgentNotFound = "agent not found"
)

View File

@@ -0,0 +1,17 @@
package types
type AppError struct {
Code string
Info string
}
func NewAppError(code, info string) *AppError {
return &AppError{Code: code, Info: info}
}
func (e *AppError) Error() string {
if e == nil {
return ""
}
return e.Code + ": " + e.Info
}