-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(biyi_api_client): Support pro engines
- Loading branch information
Showing
8 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import 'package:biyi_api_client/biyi_api_client.dart'; | ||
export 'package:biyi_api_client/biyi_api_client.dart' hide ApiClient; | ||
|
||
ApiClient apiClient = ApiClient(); | ||
ApiClient apiClient = ApiClient( | ||
// baseUrl: 'http://localhost:3000', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/biyi_api_client/lib/src/utils/to_uni_ocr_client_error.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:uni_ocr_client/uni_ocr_client.dart'; | ||
|
||
UniOcrClientError toUniOcrClientError(DioException error) { | ||
Response? response = error.response; | ||
if (response?.data == null && response?.data is! Map) { | ||
return UniOcrClientError( | ||
code: 'unknown', | ||
message: response?.data ?? error.message, | ||
); | ||
} | ||
return UniOcrClientError( | ||
code: '${response?.data['code']}', | ||
message: response?.data['message'], | ||
); | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/biyi_api_client/lib/src/utils/to_uni_translate_client_error.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:uni_translate_client/uni_translate_client.dart'; | ||
|
||
UniTranslateClientError toUniTranslateClientError(DioException error) { | ||
Response? response = error.response; | ||
if (response?.data == null || response?.data is! Map) { | ||
return UniTranslateClientError( | ||
code: 'unknown', | ||
message: response?.data ?? error.message, | ||
); | ||
} | ||
return UniTranslateClientError( | ||
code: '${response?.data['code']}', | ||
message: response?.data['message'], | ||
); | ||
} |