Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
59ea0474
Commit
59ea0474
authored
Mar 07, 2023
by
赵鹏翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网络层修改,基于kotlin版本的okhttp3进行优化
parent
2328fa41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
305 additions
and
4 deletions
+305
-4
ApiClient.kt
...src/main/java/com/fastcashier/lib_common/net/ApiClient.kt
+17
-4
MiyaHttpLoggingInterceptor.kt
.../fastcashier/lib_common/net/MiyaHttpLoggingInterceptor.kt
+288
-0
No files found.
lib_common/src/main/java/com/fastcashier/lib_common/net/ApiClient.kt
View file @
59ea0474
...
...
@@ -27,13 +27,26 @@ class ApiClient private constructor() {
}
private
fun
generateClient
():
Retrofit
{
val
httpLoggingInterceptor
=
MiyaHttpLoggingInterceptor
{
Log
.
e
(
"####"
,
it
)
val
httpLoggingInterceptor
=
MiyaHttpLoggingInterceptor
(
logger
=
object
:
MiyaHttpLoggingInterceptor
.
Logger
{
override
fun
log
(
it
:
String
?)
{
Log
.
e
(
"####"
,
it
!!
)
if
(!
LogFileUtils
.
isProhibitWrite
)
{
LogFileUtils
.
writeLog
(
BaseApplication
.
getApplication
(),
it
)
}
}.
apply
{
level
=
MiyaHttpLoggingInterceptor
.
Level
.
BODY
}
}
}).
apply
{
level
=
MiyaHttpLoggingInterceptor
.
Level
.
BODY
}
// val httpLoggingInterceptor =
// MiyaHttpLoggingInterceptor {
// Log.e("####", it)
// if (!LogFileUtils.isProhibitWrite) {
// LogFileUtils.writeLog(BaseApplication.getApplication(), it)
// }
// }
// .apply { level = MiyaHttpLoggingInterceptor.Level.BODY }
val
socketFactory
=
arrayOfNulls
<
SSLSocketFactory
>(
1
)
...
...
lib_common/src/main/java/com/fastcashier/lib_common/net/MiyaHttpLoggingInterceptor.
java
→
lib_common/src/main/java/com/fastcashier/lib_common/net/MiyaHttpLoggingInterceptor.
kt
View file @
59ea0474
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