|
|
@ -2,6 +2,7 @@ package response |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
|
|
|
|
"git.diulo.com/mogfee/kit/errors" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
"github.com/go-playground/form" |
|
|
|
"github.com/go-playground/form" |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
@ -52,7 +53,7 @@ func (s *result) Error(err error) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
gs := errorx.FromError(err) |
|
|
|
gs := errors.FromError(err) |
|
|
|
|
|
|
|
|
|
|
|
s.Result(int(gs.Code), gs.Reason, gs.Message, gs.Metadata) |
|
|
|
s.Result(int(gs.Code), gs.Reason, gs.Message, gs.Metadata) |
|
|
|
} |
|
|
|
} |
|
|
|