Then all interfaces will return with a uniform response, like this
1 2 3 4 5 6 7 8 9
{ "data": {} // can be any object,such as String、List、Number... "errorCode": "success", "errorMessage": "success", "host": "127.0.0.1", "showType": 4, "success": true, "traceId": "04f3a87c-0d15-4832-8573-6676ea96546e" }
You can use @UseRestResult on type or method
If you use @UseRestResult on type, that means that all methods in the class use a uniform response
If you use **@UseRestResul****t** on method, that means just this method use a uniform response
If you use @UseRestResult on type, but you want one of these methods not to use a uniform response, you can use @IgnoreRestResult on this method to ignore the uniform response
2、Built in global exception handling
All exceptions will be caught and returned using a unified response