feat: add medias
This commit is contained in:
19
backend/common/errorx/error.go
Normal file
19
backend/common/errorx/error.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package errorx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func (r Response) Error() string {
|
||||
return fmt.Sprintf("%d: %s", r.Code, r.Message)
|
||||
}
|
||||
|
||||
var (
|
||||
RequestParseError = Response{400, "请求解析错误"}
|
||||
InternalError = Response{500, "内部错误"}
|
||||
)
|
||||
Reference in New Issue
Block a user