220
                 path = photoBean.photoPath;
212 221
             }
213
-            LogHelper.d(TAG,"保存照片到本地,图片链接地址为"+path);
222
+            LogHelper.d(TAG,"SavePhotoTask save photo to phone , photo remote url = "+path);
214 223
             FileOutputStream fOut = null;
215 224
             HttpURLConnection conn = null;
216 225
             InputStream inStream = null;
@@ -233,11 +242,11 @@ public class SessionInteractor {
233 242
                         fOut.flush();
234 243
                     }
235 244
                     fOut.flush();
236
-                    LogHelper.d(TAG,"保存照片到本地,图片保存至"+file.getAbsolutePath()+"图片大小为"+file.length()+"字节\n\n");
245
+                    LogHelper.d(TAG,"SavePhotoTask save photo to local path = "+file.getAbsolutePath()+" photo bytes = "+file.length()+"\n");
237 246
                 }
238 247
                 return true;
239 248
             } catch (Exception e) {
240
-                e.printStackTrace();
249
+                LogHelper.e(TAG,"SavePhotoTask exception occurs "+e);
241 250
             } finally {
242 251
                 try{
243 252
                     inStream.close();
@@ -247,6 +256,11 @@ public class SessionInteractor {
247 256
                     e.printStackTrace();
248 257
                 }
249 258
             }
259
+            try{
260
+                Thread.sleep(2000);
261
+            }catch (Exception e){
262
+                e.printStackTrace();
263
+            }
250 264
             return false;
251 265
         }
252 266
 
@@ -254,8 +268,10 @@ public class SessionInteractor {
254 268
         protected void onPostExecute(Boolean result) {
255 269
             super.onPostExecute(result);
256 270
             if (result) {
271
+                LogHelper.d(TAG,"SavePhotoTask onPostExecute success " + photoBean);
257 272
                 listener.onSessionPhotoCaptured(photoBean);
258 273
             }else{
274
+                LogHelper.d(TAG,"SavePhotoTask onPostExecute fail and retry "+photoBean);
259 275
                 new SavePhotoTask(photoBean).executeOnExecutor(ThreadExecutor.getInstance().getExecutor(),photoBean);
260 276
             }
261 277
         }
@@ -275,7 +291,7 @@ public class SessionInteractor {
275 291
         params.put("session",randomSessionId);
276 292
         sessionEndTask = new HttpPostTask(params);
277 293
         sessionEndTask.executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), BoxUrlContainer.SESSION_END_URL);
278
-
294
+        LogHelper.d(TAG,"sessionEndTask execute ");
279 295
         listener.onSessionEnd(sessionBean.sessionId);
280 296
     }
281 297
 
@@ -288,6 +304,7 @@ public class SessionInteractor {
288 304
         params.put("path",photoBean.photoPath);
289 305
         HttpPostTask deleteTask = new HttpPostTask(params);
290 306
         deleteTask.executeOnExecutor(ThreadExecutor.getInstance().getExecutor(), BoxUrlContainer.DELETE_PHOTO_URL);
307
+        LogHelper.d(TAG,"deletePhoto execute "+photoBean);
291 308
     }
292 309
 
293 310
     private void cancelTask(HttpPostTask task){

+ 10 - 3
app/src/main/java/ai/pai/lensman/session/SessionPresenter.java

@@ -23,7 +23,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
23 23
     private SessionBean sessionBean;
24 24
     private boolean isWorking;
25 25
 
26
-
26
+    private static final String TAG = "SessionPresenter";
27 27
 
28 28
     public SessionPresenter(SessionBean sessionBean, SessionContract.View view) {
29 29
         this.sessionView = view;
@@ -32,11 +32,14 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
32 32
 
33 33
     @Override
34 34
     public void start() {
35
+        LogHelper.d(TAG,"SessionPresenter start "+sessionBean);
35 36
         interactor = new SessionInteractor(sessionBean, this);
36 37
         photoList = DBService.getInstance().getPhotoListBySessionId(sessionBean.sessionId);
37 38
         if (photoList.size() == 0) {
39
+            LogHelper.d(TAG,"SessionPresenter start and found no old photos");
38 40
             sessionView.showEmptyView();
39 41
         } else {
42
+            LogHelper.d(TAG,"SessionPresenter start and found  old photos, size = "+photoList.size());
40 43
             sessionView.showPhotoRecyclerView();
41 44
             for (PhotoBean photoBean : photoList) {
42 45
                 sessionView.addNewPhoto(photoBean);
@@ -51,12 +54,14 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
51 54
         interactor.endSession();
52 55
         Preferences.getInstance().setCurrentSession("");
53 56
         isWorking = false;
57
+        LogHelper.d(TAG,"stop");
54 58
     }
55 59
 
56 60
     @Override
57 61
     public void onSessionStartSuccess(String session) {
58 62
         isWorking = true;
59 63
         sessionView.showToast("session启动成功");
64
+        LogHelper.d(TAG,"onSessionStartSuccess session启动成功"+session);
60 65
     }
61 66
 
62 67
     @Override
@@ -66,6 +71,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
66 71
         }
67 72
         sessionView.showToast("session启动失败,自动重试中");
68 73
         interactor.startSession();
74
+        LogHelper.d(TAG,"onSessionStartError session启动失败,自动重试中");
69 75
     }
70 76
 
71 77
     @Override
@@ -78,6 +84,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
78 84
                 return;
79 85
             }
80 86
         }
87
+        LogHelper.d(TAG,"onSessionPhotoCaptured "+bean);
81 88
         DBService.getInstance().addPhotoBean(bean);
82 89
         sessionView.showPhotoRecyclerView();
83 90
         sessionView.addNewPhoto(bean);
@@ -87,7 +94,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
87 94
 
88 95
     @Override
89 96
     public void onSessionEnd(String session) {
90
-
97
+        LogHelper.d(TAG,"onSessionEnd "+session);
91 98
     }
92 99
 
93 100
     @Override
@@ -103,7 +110,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
103 110
 
104 111
     @Override
105 112
     public void change2QRCodeSessionId(String sessionId) {
106
-        LogHelper.d("czy","change2QRCodeSessionId ="+sessionId);
113
+        LogHelper.d(TAG,"change2QRCodeSessionId 使用新sessionId = "+sessionId);
107 114
         this.sessionBean.sessionId = sessionId;
108 115
         stop();
109 116
         start();

kodo - Gogs: Go Git Service

No Description

huangqimin: 211ab99a32 :art: member/user/coupon/detail & member/user/coupon/use 6 years ago
..
algorithm f38d3bf980 Caesar Alg 8 years ago
error 211ab99a32 :art: member/user/coupon/detail & member/user/coupon/use 6 years ago
redis 211ab99a32 :art: member/user/coupon/detail & member/user/coupon/use 6 years ago
sql f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 8 years ago
zbar 3d0d214667 :sparkles: Member Infos 6 years ago
__init__.py 52ce35cbfc add api uuid_init/uuid 10 years ago
admin_utils.py 9e4ac4fd3b Add admin_status for GroupUserInfo 9 years ago
disk_utils.py af2b3f483f change download.html to be generated from download.tmpl.html 10 years ago
group_photo_utils.py 0e7b5eb1af Update order_by of group session photos 9 years ago
message_utils.py 21b4a5403a add api lensman_brief_api 10 years ago
original_CGzC_10a50000c8811190.bak.jpg 290ff6960f pyzbar 6 years ago
original_CGzC_10a50000c8811190.jpg 680f424408 Update water mark 9 years ago
paiai_96_96.png 4a8b4f8819 add watermark 10 years ago
paiai_water_mark.png 680f424408 Update water mark 9 years ago
price_utils.py 24e345a32f Add price func get_group_photo_price 9 years ago
qiniucdn.py 4ce7f5c87b :art: Member Relative APIs 6 years ago
rdm_utils.py 4efb7f6f87 Statistic 8 years ago
storage_qiniu_utils.py f2fc73685d Update package django_xxx 8 years ago
storage_utils.py f2fc73685d Update package django_xxx 8 years ago
thumbnail_utils.py 5c9e21b29b add Only Once Function statistic_thumbnail_size to statistic thumbnail size 10 years ago
time_utils.py 511533855d Change oauth to use http 8 years ago
url_utils.py 135c21b40c from models_ext import BaseModelMixin, upload_file_url, upload_path 8 years ago
version_utils.py 13816e8774 Fix Bug: REQUEST 8 years ago
watermark_utils.py 5411626ebe Change watermark position 9 years ago
wx_utils.py 32a7d9ffa0 Update wx relative 9 years ago