l-3"> 13 16
 
14
-    private static final String TAG = "czy";
17
+    private static final String TAG = "DBService";
15 18
 
16 19
     private DBService(Context context) {
17 20
         dbHelper = DBHelper.getInstance(context);
@@ -39,4 +42,43 @@ public class DBService {
39 42
         }
40 43
     }
41 44
 
45
+
46
+    private PhotoBean cursor2PhotoBean(Cursor c) {
47
+        PhotoBean item = new PhotoBean();
48
+        item.lensmanId = c.getString(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.LENSMAN_ID));
49
+        item.sessionId = c.getString(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.SESSION_ID));
50
+        item.isRawPhoto =(c.getInt(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.IS_RAW_PHOTO))>0);
51
+        item.isUploaded = (c.getInt(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.IS_UPLOADED))>0);
52
+        item.captureTime = c.getLong(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.CAPTURE_TIME));
53
+        item.photoId = c.getLong(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_ID));
54
+        item.photoName = c.getString(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_NAME));
55
+        item.photoPath = c.getString(c.getColumnIndex(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_PATH));
56
+        return item;
57
+    }
58
+
59
+    private ContentValues photoBean2ContentValues(PhotoBean item) {
60
+        ContentValues cv = new ContentValues();
61
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.CAPTURE_TIME, item.captureTime);
62
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.IS_RAW_PHOTO, item.isRawPhoto ? 1: 0);
63
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_ID, item.photoId);
64
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_NAME, item.photoName);
65
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.PHOTO_PATH, item.photoPath);
66
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.SESSION_ID, item.sessionId);
67
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.LENSMAN_ID,item.lensmanId);
68
+        cv.put(DBHelper.PHOTO_INFO_COLUMNS.IS_UPLOADED,item.isUploaded);
69
+        return cv;
70
+    }
71
+
72
+    public void addPhotoBean(PhotoBean bean){
73
+
74
+    }
75
+
76
+    public void updatePhotoBean(PhotoBean bean){
77
+
78
+    }
79
+
80
+    public void deletePhotoBean(PhotoBean bean){
81
+
82
+    }
83
+
42 84
 }

+ 19 - 0
app/src/main/java/ai/pai/lensman/service/UploadService.java

@@ -0,0 +1,19 @@
1
+package ai.pai.lensman.service;
2
+
3
+import android.app.IntentService;
4
+import android.content.Intent;
5
+
6
+public class UploadService extends IntentService {
7
+
8
+    private static final String TAG = "UploadService";
9
+
10
+    public UploadService(){
11
+        super(TAG);
12
+    }
13
+
14
+    @Override
15
+    protected void onHandleIntent(Intent intent) {
16
+
17
+    }
18
+
19
+}

+ 0 - 10
app/src/main/java/ai/pai/lensman/session/PhotoBean.java

@@ -1,10 +0,0 @@
1
-package ai.pai.lensman.session;
2
-
3
-
4
-import java.io.Serializable;
5
-
6
-public class PhotoBean implements Serializable{
7
-
8
-    public String photoPath;
9
-
10
-}

+ 1 - 0
app/src/main/java/ai/pai/lensman/session/PhotoRecyclerAdapter.java

@@ -12,6 +12,7 @@ import com.android.common.utils.DeviceUtils;
12 12
 import java.util.ArrayList;
13 13
 
14 14
 import ai.pai.lensman.R;
15
+import ai.pai.lensman.bean.PhotoBean;
15 16
 import butterknife.BindView;
16 17
 import butterknife.ButterKnife;
17 18
 

+ 2 - 1
app/src/main/java/ai/pai/lensman/session/SessionActivity.java

@@ -10,8 +10,9 @@ import android.widget.TextView;
10 10
 
11 11
 import ai.pai.lensman.R;
12 12
 import ai.pai.lensman.base.BaseActivity;
13
+import ai.pai.lensman.bean.PhotoBean;
13 14
 import ai.pai.lensman.qrcode.QRCaptureActivity;
14
-import ai.pai.lensman.upload.SessionBean;
15
+import ai.pai.lensman.bean.SessionBean;
15 16
 import butterknife.BindView;
16 17
 import butterknife.ButterKnife;
17 18
 import butterknife.OnClick;

+ 2 - 0
app/src/main/java/ai/pai/lensman/session/SessionContract.java

@@ -1,5 +1,7 @@
1 1
 package ai.pai.lensman.session;
2 2
 
3
+import ai.pai.lensman.bean.PhotoBean;
4
+
3 5
 /**
4 6
  * Created by chengzhenyu on 2016/7/7.
5 7
  */

+ 1 - 0
app/src/main/java/ai/pai/lensman/session/SessionInteractor.java

@@ -6,6 +6,7 @@ import java.util.List;
6 6
 import java.util.Timer;
7 7
 import java.util.TimerTask;
8 8
 
9
+import ai.pai.lensman.bean.PhotoBean;
9 10
 import ai.pai.lensman.box.ApiClient;
10 11
 import ai.pai.lensman.db.Preferences;
11 12
 import retrofit2.Call;

+ 2 - 0
app/src/main/java/ai/pai/lensman/session/SessionPresenterImpl.java

@@ -4,6 +4,8 @@ import android.content.Context;
4 4
 
5 5
 import java.util.ArrayList;
6 6
 
7
+import ai.pai.lensman.bean.PhotoBean;
8
+
7 9
 public class SessionPresenterImpl implements SessionContract.SessionPresenter ,SessionInteractor.SessionListener{
8 10
 
9 11
     private Context context;

+ 1 - 0
app/src/main/java/ai/pai/lensman/upload/SessionRecyclerAdapter.java

@@ -13,6 +13,7 @@ import com.android.common.utils.DeviceUtils;
13 13
 import java.util.ArrayList;
14 14
 
15 15
 import ai.pai.lensman.R;
16
+import ai.pai.lensman.bean.SessionBean;
16 17
 import butterknife.BindView;
17 18
 import butterknife.ButterKnife;
18 19
 

+ 1 - 0
app/src/main/java/ai/pai/lensman/upload/UploadActivity.java

@@ -13,6 +13,7 @@ import java.util.ArrayList;
13 13
 
14 14
 import ai.pai.lensman.R;
15 15
 import ai.pai.lensman.base.BaseActivity;
16
+import ai.pai.lensman.bean.SessionBean;
16 17
 import ai.pai.lensman.briefs.BriefsActivity;
17 18
 import butterknife.BindView;
18 19
 import butterknife.ButterKnife;

+ 2 - 0
app/src/main/java/ai/pai/lensman/upload/UploadContract.java

@@ -2,6 +2,8 @@ package ai.pai.lensman.upload;
2 2
 
3 3
 import java.util.ArrayList;
4 4
 
5
+import ai.pai.lensman.bean.SessionBean;
6
+
5 7
 /**
6 8
  * Created by chengzhenyu on 2016/7/7.
7 9
  */

+ 1 - 0
app/src/main/java/ai/pai/lensman/upload/UploadPresenterImpl.java

@@ -5,6 +5,7 @@ import android.content.Intent;
5 5
 
6 6
 import java.util.ArrayList;
7 7
 
8
+import ai.pai.lensman.bean.SessionBean;
8 9
 import ai.pai.lensman.session.SessionActivity;
9 10
 
10 11
 public class UploadPresenterImpl implements UploadContract.UploadPresenter {

サインイン - Gogs: Go Git Service

サインイン