feat(project): 项目完结

This commit is contained in:
peakxy
2026-05-30 23:16:49 +08:00
commit 60e7777cbd
97 changed files with 15027 additions and 0 deletions

12
pkg/types/codes.go Normal file
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"
)

2
pkg/types/doc.go Normal file
View File

@@ -0,0 +1,2 @@
// Package types contains shared public support types for the scaffold.
package types

17
pkg/types/errors.go Normal file
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
}