From 42a85f7b80c36b05738aab1a2c5e44974de52f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 25 Jun 2022 22:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E4=BB=A3?= =?UTF-8?q?=E8=A1=A8=E6=88=90=E5=8A=9F=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exception.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/exception.go b/exception.go index 4afc495..52bb4c9 100644 --- a/exception.go +++ b/exception.go @@ -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) +}