This invention provides a method, apparatus, and device for automatic conversion of API result codes. The method includes: implementing the CommandLineRunner interface to perform a data refresh upon project startup, converting the result codes into data stored in memory; defining static variables to store the API return result description key value and the API return result encoding key value in memory; periodically reading or manually refreshing the memory data to update the pre-stored result code data in memory; and before controlling the API to finally return the result, determining whether error
code conversion is enabled. If not enabled,
no conversion is performed; if enabled,
regular expression matching is performed on the result codes to convert them into
standard result codes and result descriptions for return. In this way, automatic conversion of error codes and descriptions is achieved by customizing whether error
code conversion is enabled, configuring dictionary table data, and enabling external error
code conversion.