refactor: clean code

This commit is contained in:
Fu Diwei
2025-03-23 10:19:24 +08:00
parent 445541c38f
commit 12102ef641
28 changed files with 166 additions and 245 deletions

View File

@@ -6,16 +6,22 @@ type BaseResponse interface {
}
type baseResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Code *int `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
func (r *baseResponse) GetCode() int {
return r.Code
if r.Code != nil {
return *r.Code
}
return 0
}
func (r *baseResponse) GetMessage() string {
return r.Message
if r.Message != nil {
return *r.Message
}
return ""
}
type DomainInfo struct {