init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package stderr
import "fmt"
// CustomErr 代替/common/error中的定义,逐渐在代码中弃掉(common/error模块)
type CustomErr struct {
Code Code `json:"code"`
Msg string `json:"msg"`
Tips string `json:"tips"`
}
// NewCustomErr an error
func NewCustomErr(code Code, Msg string, tips ...string) *CustomErr {
res := &CustomErr{
Code: code,
Msg: Msg,
Tips: Msg,
}
if len(tips) > 0 {
res.Tips = tips[0]
}
return res
}
// Error 返回字符串
func (s *CustomErr) Error() string {
if s == nil {
return ""
}
return fmt.Sprintf("code = %d, msg = %s ,tips = %v", s.Code, s.Msg, s.Tips)
}