Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e5889123
authored
Mar 05, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配最新utilcode
parent
655e9bb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
app/build.gradle
+6
-2
app/src/main/java/com/bgycc/smartcanteen/action/LogAction.kt
+3
-3
No files found.
app/build.gradle
View file @
e5889123
...
...
@@ -58,6 +58,10 @@ android {
}
}
}
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
}
dependencies
{
...
...
@@ -69,8 +73,8 @@ dependencies {
implementation
'org.greenrobot:eventbus:3.1.1'
implementation
'com.github.salomonbrys.kotson:kotson:2.5.0'
implementation
'com.blankj:utilcode:1.26.0'
implementation
'com.squareup.okhttp3:okhttp:3.12.
5
'
implementation
'com.squareup.okhttp3:logging-interceptor:3.12.
5
'
implementation
'com.squareup.okhttp3:okhttp:3.12.
10
'
implementation
'com.squareup.okhttp3:logging-interceptor:3.12.
10
'
implementation
'com.squareup.retrofit2:retrofit:2.7.1'
implementation
'com.squareup.retrofit2:converter-gson:2.7.1'
implementation
'com.squareup.retrofit2:converter-scalars:2.7.1'
...
...
app/src/main/java/com/bgycc/smartcanteen/action/LogAction.kt
View file @
e5889123
...
...
@@ -46,7 +46,7 @@ object LogAction : Action(ActionEnum.LOG_PULL.name) {
val
logZipFile
=
File
(
PathUtils
.
getExternalAppCachePath
(),
"upload/log.zip"
)
val
logUploadDir
=
File
(
PathUtils
.
getExternalAppCachePath
(),
"upload/log"
)
FileUtils
.
delete
(
logZipFile
)
FileUtils
.
delete
Dir
(
logUploadDir
)
FileUtils
.
delete
(
logUploadDir
)
logUploadDir
.
mkdirs
()
val
logDir
=
when
(
type
)
{
...
...
@@ -56,11 +56,11 @@ object LogAction : Action(ActionEnum.LOG_PULL.name) {
FileUtils
.
listFilesInDir
(
logDir
)
?.
forEach
{
val
date
=
Date
(
it
.
lastModified
())
if
(
date
>=
startTime
&&
date
<=
endTime
)
{
FileUtils
.
copy
File
(
it
,
File
(
logUploadDir
,
it
.
name
))
FileUtils
.
copy
(
it
,
File
(
logUploadDir
,
it
.
name
))
}
}
ZipUtils
.
zipFile
(
logUploadDir
,
logZipFile
)
FileUtils
.
delete
Dir
(
logUploadDir
)
FileUtils
.
delete
(
logUploadDir
)
MainHttpClient
.
uploadLog
(
logZipFile
,
"$type${formatSrc.format(startTime)}${formatSrc.format(endTime)}${App.getDeviceSN()}.zip"
)
}
catch
(
e
:
Exception
)
{}
state
=
State
.
INITED
...
...
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