增加获取代表成功的异常
This commit is contained in:
parent
03c01d829d
commit
42a85f7b80
@ -120,3 +120,12 @@ func ToError(e *Exception) error {
|
||||
func IsSuccess(e *Exception) bool {
|
||||
return nil == e || e.GetCode() == defaultSuccessCode
|
||||
}
|
||||
|
||||
// NewSuccess 代表Success的异常
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 22:35 2022/6/25
|
||||
func NewSuccess(data map[string]interface{}) *Exception {
|
||||
return New(defaultSuccessCode, defaultHttpCode, data)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user