Commit ab43b7e8 by pye52

修改上传日志的文件命名规范(与后台协商所得文件名)

parent ca3d9e01
...@@ -41,7 +41,7 @@ public class LogCommandHandler extends CommandHandler { ...@@ -41,7 +41,7 @@ public class LogCommandHandler extends CommandHandler {
private static final long DEFAULT_DELAY = 1000; private static final long DEFAULT_DELAY = 1000;
private volatile boolean start = false; 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 String deviceSN;
private CommandLog commandLog; private CommandLog commandLog;
...@@ -182,10 +182,10 @@ public class LogCommandHandler extends CommandHandler { ...@@ -182,10 +182,10 @@ public class LogCommandHandler extends CommandHandler {
OkHttpClient client = SCRetrofit.createOkHttpClient().build(); OkHttpClient client = SCRetrofit.createOkHttpClient().build();
SCApi api = SCRetrofit.createApi(client); SCApi api = SCRetrofit.createApi(client);
CommandLog.CommandLogData data = commandLog.getData(); CommandLog.CommandLogData data = commandLog.getData();
String fileNameForServer = data.getLogType() + String fileNameForServer = data.getLogType()
"_" + format.format(startTime) + + format.format(startTime)
"_" + format.format(endTime) + + format.format(endTime)
"_" + deviceSN + ".zip"; + deviceSN + ".zip";
fileNameForServer = fileNameForServer.replace(" ", "_"); fileNameForServer = fileNameForServer.replace(" ", "_");
LogUtils.d(TAG, "开始上传日志: " + fileNameForServer); LogUtils.d(TAG, "开始上传日志: " + fileNameForServer);
RequestBody requestBody = RequestBody.create(zip, MediaType.parse("application/x-zip-compressed")); RequestBody requestBody = RequestBody.create(zip, MediaType.parse("application/x-zip-compressed"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment