Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart_hotel_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
smart_hotel_app
Commits
c7d9fb26
Commit
c7d9fb26
authored
Jun 08, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http移动
parent
76a57f12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27 additions
and
17 deletions
+27
-17
main.dart
lib/main.dart
+1
-1
auth_repository.dart
lib/repositories/auth_repository.dart
+2
-2
dio_request.dart
lib/utils/http/dio_request.dart
+4
-3
app_exception.dart
lib/utils/http/exceptions/app_exception.dart
+2
-1
business_exception.dart
lib/utils/http/exceptions/business_exception.dart
+2
-1
cancel_exception.dart
lib/utils/http/exceptions/cancel_exception.dart
+2
-1
network_exception.dart
lib/utils/http/exceptions/network_exception.dart
+2
-1
server_exception.dart
lib/utils/http/exceptions/server_exception.dart
+2
-1
error_interceptor.dart
lib/utils/http/interceptors/error_interceptor.dart
+3
-2
request_interceptor.dart
lib/utils/http/interceptors/request_interceptor.dart
+3
-2
response_interceptor.dart
lib/utils/http/interceptors/response_interceptor.dart
+2
-1
response_model.dart
lib/utils/http/response_model.dart
+2
-1
对接方案.md
对接方案.md
+0
-0
No files found.
lib/main.dart
View file @
c7d9fb26
...
...
@@ -7,7 +7,7 @@ import 'package:smart_hotel_app/blocs/auth/auth_state.dart';
import
'package:smart_hotel_app/routes/app_router.dart'
;
import
'package:smart_hotel_app/repositories/auth_repository.dart'
;
import
'package:smart_hotel_app/services/auth_service.dart'
;
import
'package:smart_hotel_app/http/dio_request.dart'
;
import
'package:smart_hotel_app/
utils/
http/dio_request.dart'
;
import
'package:smart_hotel_app/utils/event_bus.dart'
;
import
'package:smart_hotel_app/utils/storage/storage_service.dart'
;
import
'package:smart_hotel_app/routes/app_router.gr.dart'
;
...
...
lib/repositories/auth_repository.dart
View file @
c7d9fb26
import
'../http/response_model.dart'
;
import
'../http/dio_request.dart'
;
import
'../
utils/
http/response_model.dart'
;
import
'../
utils/
http/dio_request.dart'
;
class
AuthRepository
{
Future
<
ResponseModel
>
login
(
Map
<
String
,
dynamic
>
params
)
{
...
...
lib/http/dio_request.dart
→
lib/
utils/
http/dio_request.dart
View file @
c7d9fb26
import
'package:dio/dio.dart'
;
import
'../
utils/
constants.dart'
;
import
'../constants.dart'
;
import
'exceptions/app_exception.dart'
;
import
'interceptors/error_interceptor.dart'
;
import
'interceptors/request_interceptor.dart'
;
import
'interceptors/response_interceptor.dart'
;
import
'../
utils/
storage/storage_service.dart'
;
import
'../storage/storage_service.dart'
;
import
'response_model.dart'
;
class
DioRequest
{
...
...
@@ -374,4 +374,4 @@ class DioRequest {
const
chars
=
'abcdefghijklmnopqrstuvwxyz0123456789'
;
return
List
.
generate
(
length
,
(
index
)
=>
chars
[
index
%
chars
.
length
]).
join
();
}
}
}
\ No newline at end of file
lib/http/exceptions/app_exception.dart
→
lib/
utils/
http/exceptions/app_exception.dart
View file @
c7d9fb26
...
...
@@ -13,4 +13,4 @@ class AppException implements Exception {
String
toString
()
{
return
'AppException:
$message
(code:
$code
, uuid:
$uuid
)'
;
}
}
}
\ No newline at end of file
lib/http/exceptions/business_exception.dart
→
lib/
utils/
http/exceptions/business_exception.dart
View file @
c7d9fb26
...
...
@@ -6,4 +6,4 @@ class BusinessException extends AppException {
int
?
code
,
String
?
uuid
,
})
:
super
(
message:
message
,
code:
code
,
uuid:
uuid
);
}
}
\ No newline at end of file
lib/http/exceptions/cancel_exception.dart
→
lib/
utils/
http/exceptions/cancel_exception.dart
View file @
c7d9fb26
...
...
@@ -5,4 +5,4 @@ class CancelException extends AppException {
String
message
=
'请求已取消'
,
String
?
uuid
,
})
:
super
(
message:
message
,
code:
-
1
,
uuid:
uuid
);
}
}
\ No newline at end of file
lib/http/exceptions/network_exception.dart
→
lib/
utils/
http/exceptions/network_exception.dart
View file @
c7d9fb26
...
...
@@ -6,4 +6,4 @@ class NetworkException extends AppException {
int
?
code
,
String
?
uuid
,
})
:
super
(
message:
message
,
code:
code
,
uuid:
uuid
);
}
}
\ No newline at end of file
lib/http/exceptions/server_exception.dart
→
lib/
utils/
http/exceptions/server_exception.dart
View file @
c7d9fb26
...
...
@@ -6,4 +6,4 @@ class ServerException extends AppException {
int
?
code
,
String
?
uuid
,
})
:
super
(
message:
message
,
code:
code
,
uuid:
uuid
);
}
}
\ No newline at end of file
lib/http/interceptors/error_interceptor.dart
→
lib/
utils/
http/interceptors/error_interceptor.dart
View file @
c7d9fb26
import
'dart:io'
;
import
'package:dio/dio.dart'
;
import
'../../
utils/
event_bus.dart'
;
import
'../../event_bus.dart'
;
import
'../exceptions/app_exception.dart'
;
import
'../exceptions/business_exception.dart'
;
import
'../exceptions/cancel_exception.dart'
;
...
...
@@ -137,4 +137,4 @@ class ErrorInterceptor extends Interceptor {
}
print
(
'========== Error END =========='
);
}
}
}
\ No newline at end of file
lib/http/interceptors/request_interceptor.dart
→
lib/
utils/
http/interceptors/request_interceptor.dart
View file @
c7d9fb26
import
'package:dio/dio.dart'
;
import
'../../
utils/
storage/storage_service.dart'
;
import
'../../storage/storage_service.dart'
;
class
RequestInterceptor
extends
Interceptor
{
final
StorageService
_storageService
;
...
...
@@ -54,4 +54,4 @@ class RequestInterceptor extends Interceptor {
}
print
(
'========== Request END =========='
);
}
}
}
\ No newline at end of file
lib/http/interceptors/response_interceptor.dart
→
lib/
utils/
http/interceptors/response_interceptor.dart
View file @
c7d9fb26
...
...
@@ -17,4 +17,4 @@ class ResponseInterceptor extends Interceptor {
print
(
'Data:
${response.data}
'
);
print
(
'========== Response END =========='
);
}
}
}
\ No newline at end of file
lib/http/response_model.dart
→
lib/
utils/
http/response_model.dart
View file @
c7d9fb26
...
...
@@ -81,4 +81,4 @@ class ResponseModel<T> {
String
toString
()
{
return
'ResponseModel(code:
$code
, msg:
$msg
, uuid:
$uuid
, success:
$success
)'
;
}
}
}
\ No newline at end of file
对接方案.md
View file @
c7d9fb26
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment