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
08f83b07
authored
Mar 16, 2020
by
pye52
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new_master' into new_for_phone
parents
66642bb8
ab43b7e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
app/src/main/java/com/bgycc/smartcanteen/command/LogCommandHandler.java
+5
-5
app/src/main/java/com/bgycc/smartcanteen/socket/SCWebSocketClient.java
+1
-0
No files found.
app/src/main/java/com/bgycc/smartcanteen/command/LogCommandHandler.java
View file @
08f83b07
...
...
@@ -41,7 +41,7 @@ public class LogCommandHandler extends CommandHandler {
private
static
final
long
DEFAULT_DELAY
=
1000
;
private
volatile
boolean
start
=
false
;
private
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd
HH:mm:ss
"
,
Locale
.
getDefault
());
private
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
,
Locale
.
getDefault
());
private
String
deviceSN
;
private
CommandLog
commandLog
;
...
...
@@ -182,10 +182,10 @@ public class LogCommandHandler extends CommandHandler {
OkHttpClient
client
=
SCRetrofit
.
createOkHttpClient
().
build
();
SCApi
api
=
SCRetrofit
.
createApi
(
client
);
CommandLog
.
CommandLogData
data
=
commandLog
.
getData
();
String
fileNameForServer
=
data
.
getLogType
()
+
"_"
+
format
.
format
(
startTime
)
+
"_"
+
format
.
format
(
endTime
)
+
"_"
+
deviceSN
+
".zip"
;
String
fileNameForServer
=
data
.
getLogType
()
+
format
.
format
(
startTime
)
+
format
.
format
(
endTime
)
+
deviceSN
+
".zip"
;
fileNameForServer
=
fileNameForServer
.
replace
(
" "
,
"_"
);
LogUtils
.
d
(
TAG
,
"开始上传日志: "
+
fileNameForServer
);
RequestBody
requestBody
=
RequestBody
.
create
(
zip
,
MediaType
.
parse
(
"application/x-zip-compressed"
));
...
...
app/src/main/java/com/bgycc/smartcanteen/socket/SCWebSocketClient.java
View file @
08f83b07
...
...
@@ -76,6 +76,7 @@ public class SCWebSocketClient extends WebSocketClient {
forceStop
=
false
;
SCTaskExecutor
.
getInstance
().
executeOnDiskIO
(()
->
{
try
{
connectState
.
postValue
(
new
ConnectState
(
ConnectState
.
CONNECTING
));
boolean
connectResult
=
connectBlocking
(
10
,
TimeUnit
.
SECONDS
);
if
(
connectResult
)
{
connectState
.
postValue
(
new
ConnectState
(
ConnectState
.
CONNECTED
,
host
.
toString
()));
...
...
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