Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.5 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.5 KB

smart-result

Code description

  • Java generic implementation version of Golang with multiple return values (including error and data)
  • Result entity wrapper class, including return value status, object, error information, etc

maven dependency

        <dependency>
            <groupId>io.wangxin</groupId>
            <artifactId>smart-result</artifactId>
            <version>1.0.0</version>
        </dependency>

Introduction to some classes

Unified api return result entity object
Unified error code abstract interface, each project uses its own implementation enumeration class to put error code.
The result encapsulation util tool is a rich method. Support error code enumeration class, error code plus exception information, exception and other error result encapsulation.
SmartException: Common Exception with  @see IFailCode

Some conventions

  • Use result and resultutils to encapsulate the API return value. It can return status value and corresponding result at the same time.