Commit 5e2ed2b4fafa7ee72d1ae834b33a8fd4ea190071

Authored by YangShuai
2 parents ad6015ce eca4a56e

Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/newModuleStrike

Showing 106 changed files with 11235 additions and 259 deletions
cloud/third_tool/build.gradle
... ... @@ -68,5 +68,5 @@ dependencies {
68 68  
69 69 implementation project(':core:network')
70 70 implementation project(':core:base')
71   - implementation project (':cloud:user')
  71 +// implementation project (':cloud:user')
72 72 }
... ...
cloud/third_tool/src/debug/java/com/cnlive/strike/debug/wxapi/WXEntryActivity.java
... ... @@ -7,8 +7,9 @@ import android.os.Bundle;
7 7 import android.text.TextUtils;
8 8 import android.widget.Toast;
9 9  
10   -import com.cnlive.cloud.user.auth.UserService;
  10 +import com.alibaba.android.arouter.launcher.ARouter;
11 11 import com.cnlive.core.libs.base.application.AppConfig;
  12 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
12 13 import com.cnlive.core.libs.base.util.AlertUtil;
13 14 import com.cnlive.share.BuildConfig;
14 15 import com.cnlive.share.arouter.ARouterUtil;
... ... @@ -172,12 +173,13 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
172 173 try {
173 174 Gson gson = new Gson();
174 175 ShareIntegralTypeInfo integralTypeInfo = gson.fromJson(shareType, ShareIntegralTypeInfo.class);
175   -
  176 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  177 + String userId = service.getUid(this);
176 178 if ("witnessVideo".equals(integralTypeInfo.getShareType())) {
177 179 SharedPreferences preferences = this.getSharedPreferences("sharevideo", MODE_PRIVATE);
178   - boolean status = preferences.getBoolean(UserService.getUid(this), false);
  180 + boolean status = preferences.getBoolean(userId, false);
179 181 String newTime = DateTimeUtil.getCurrentTime();
180   - String oldtime = preferences.getString(UserService.getUid(this) + "time", "2019-04-10");
  182 + String oldtime = preferences.getString(userId + "time", "2019-04-10");
181 183 boolean sameDay = DateTimeUtil.isSameDay(newTime, oldtime);
182 184 if (!status) {
183 185 ARouterUtil.addIntegrationPic(this, "share_video", integralTypeInfo.getContentId(), "sharevideo");
... ... @@ -188,9 +190,9 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
188 190  
189 191 } else if (integralTypeInfo.getShareType() != null) {
190 192 SharedPreferences preferences = this.getSharedPreferences("sharearticle", MODE_PRIVATE);
191   - boolean status = preferences.getBoolean(UserService.getUid(this), false);
  193 + boolean status = preferences.getBoolean(userId, false);
192 194 String newTime = DateTimeUtil.getCurrentTime();
193   - String oldtime = preferences.getString(UserService.getUid(this) + "time", "2019-04-10");
  195 + String oldtime = preferences.getString(userId + "time", "2019-04-10");
194 196 boolean sameDay = DateTimeUtil.isSameDay(newTime, oldtime);
195 197 if (!status) {
196 198 ARouterUtil.addIntegrationPic(this, "share_article", integralTypeInfo.getContentId(), "sharearticle");
... ...
cloud/third_tool/src/main/AndroidManifest.xml
... ... @@ -14,7 +14,8 @@
14 14 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
15 15  
16 16 <application android:largeHeap="true">
17   -
  17 + <uses-library android:name="org.apache.http.legacy"
  18 + android:required="false" />
18 19 <meta-data
19 20 android:name="WEIBO_APPKEY"
20 21 android:value="3884700821" />
... ...
cloud/third_tool/src/main/java/com/cnlive/login/action/UserThirdAction.java deleted 100644 → 0
1   -package com.cnlive.login.action;
2   -
3   -import android.accounts.Account;
4   -import android.content.Context;
5   -import android.text.TextUtils;
6   -
7   -import com.cnlive.cloud.user.auth.UserService;
8   -import com.cnlive.cloud.user.model.CNLiveUserInfo;
9   -import com.cnlive.core.network.HttpConn;
10   -import com.cnlive.core.network.NetCallBack;
11   -import com.cnlive.core.network.model.BaseResult;
12   -import com.cnlive.core.network.model.UserData;
13   -
14   -import io.reactivex.Observable;
15   -
16   -//import com.cnlive.strike.user.model.CNLiveUserInfo;
17   -
18   -/**
19   - * created by hanyayun
20   - * on 2019/12/4
21   - */
22   -public class UserThirdAction {
23   -
24   -
25   - private static final int MAX_USER_COUNT = 1;
26   -
27   - public static void otherLogin(Context context, String thirdPartyPlat, String thirdPartyId, CallBack callBack) {
28   -
29   - HttpConn.action(UserThirdUtilAction.otherLogin(context, thirdPartyPlat, thirdPartyId), new NetCallBack<BaseResult<UserData>>() {
30   - @Override
31   - public void onRequestState(int state) {
32   - if (null != callBack) {
33   - callBack.callback(state, "", null);
34   - }
35   - }
36   -
37   - @Override
38   - public void onSuccess(BaseResult<UserData> data) {
39   - loginAppAction(data, context, "", "", true, callBack);
40   - }
41   -
42   - @Override
43   - public void onFailure(String errCode, String errMsg, Exception e) {
44   - if (null != callBack) {
45   - callBack.callback(Integer.parseInt(errCode), errMsg, null);
46   - }
47   - }
48   - });
49   - }
50   -
51   -
52   - public static void otherLoginBindMobile(Context context, String phone, String countryCode, String ems,
53   - String thirdPartyPlat, String thirdPartyId, String nickName, String gender,
54   - String location, String faceUrl, CallBack callBack) {
55   -
56   - HttpConn.action(UserThirdUtilAction.otherLoginBindMobile(context, phone, countryCode, ems,
57   - thirdPartyPlat, thirdPartyId, nickName, gender, location, faceUrl), new NetCallBack<BaseResult<UserData>>() {
58   - @Override
59   - public void onRequestState(int state) {
60   - if (null != callBack) {
61   - callBack.callback(state, "", null);
62   - }
63   - }
64   -
65   - @Override
66   - public void onSuccess(BaseResult<UserData> data) {
67   - loginAppAction(data,context, "", "", true, callBack);
68   - }
69   -
70   - @Override
71   - public void onFailure(String errCode, String errMsg, Exception e) {
72   -
73   - }
74   - });
75   - }
76   -
77   -
78   - private static Observable<CNLiveUserInfo> loginAppAction(BaseResult<UserData> data, Context context, String userName, String userPassword, boolean otherLogin, CallBack callBack) {
79   - CNLiveUserInfo userinfo = null;
80   - if (null == data || null == data.getData()) {
81   - if (null != callBack) {
82   - callBack.callback(-5, "获取账户信息失败 请重试.", null);
83   - }
84   - } else if (TextUtils.isEmpty(data.getData().getMobile())) {
85   - callBack.callback(-5, "绑定手机号已失效..", null);
86   - } else {
87   - //更新登录用户信息
88   - UserService userService = UserService.getInstance(context);
89   - userService.loginAppAccount(
90   - otherLogin ? data.getData().getMobile() : userName,
91   - otherLogin ? data.getData().getMobile() : userPassword,
92   - data.getData());
93   - //保留近期登录用户
94   - Account[] accounts = userService.getUserList();
95   - userinfo = userService.getAppAccount();
96   - if (accounts.length <= MAX_USER_COUNT) {
97   - callBack.callback(0, "", userinfo);
98   - } else {
99   - CNLiveUserInfo finalUserinfo = userinfo;
100   - userService.removeUser(accounts[0], future -> callBack.callback(0, "", finalUserinfo));
101   - }
102   - }
103   - return Observable.just(userinfo);
104   - }
105   -
106   -
107   - public interface CallBack {
108   - void callback(int state, String msg, Object object);
109   - }
110   -}
cloud/third_tool/src/main/java/com/cnlive/login/action/UserThirdUtilAction.java deleted 100644 → 0
1   -package com.cnlive.login.action;
2   -
3   -import android.content.Context;
4   -
5   -import com.cnlive.core.libs.base.application.AppConfig;
6   -import com.cnlive.core.network.api.ApiBaseServiceOpen;
7   -import com.cnlive.core.network.model.BaseResult;
8   -import com.cnlive.core.network.model.UserData;
9   -import com.cnlive.core.network.request.BaseRequest;
10   -
11   -import java.util.HashMap;
12   -import java.util.Map;
13   -
14   -import io.reactivex.Observable;
15   -
16   -/**
17   - * created by hanyayun
18   - * on 2019/12/4
19   - */
20   -public class UserThirdUtilAction {
21   -
22   - /**
23   - * 其他平台账户登录
24   - *
25   - * @param context
26   - * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren
27   - * @param thirdPartyId 第三方用户ID
28   - * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr];
29   - * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同
30   - */
31   - public static Observable<BaseResult<UserData>> otherLogin(Context context, String thirdPartyPlat, String thirdPartyId) {
32   -
33   - Map<String, String> requestMap = new HashMap<>();
34   - requestMap.put("appId", AppConfig.getAppId());
35   - requestMap.put("thirdPartyPlat", thirdPartyPlat);
36   - requestMap.put("thirdPartyId", thirdPartyId);
37   - requestMap.put("frmId", AppConfig.getAppChannel());
38   - requestMap.put("clientPlat", "a");
39   - return BaseRequest.init().service(ApiBaseServiceOpen.class).loginIn3rdForWJJ(requestMap);
40   - }
41   -
42   - /**
43   - * 其他平台账户版定手机号并登录
44   - *
45   - * @param context
46   - * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren
47   - * @param thirdPartyId 第三方用户ID
48   - * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr];
49   - * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同
50   - */
51   -
52   -
53   - public static Observable<BaseResult<UserData>> otherLoginBindMobile(Context context,
54   - String phone,
55   - String countryCode,
56   - String ems,
57   - String thirdPartyPlat,
58   - String thirdPartyId,
59   - String nickName,
60   - String gender,
61   - String location,
62   - String faceUrl) {
63   - Map<String, String> requestMap = new HashMap<>();
64   -
65   - requestMap.put("frmId", AppConfig.getAppChannel());
66   - requestMap.put("clientPlat", "a");
67   - requestMap.put("uuid", AppConfig.getAppUUID());
68   -
69   - requestMap.put("appId", AppConfig.getAppId());
70   - requestMap.put("mobile", phone);
71   - requestMap.put("countryCode", countryCode);
72   - requestMap.put("verificationCode", ems);
73   -
74   - requestMap.put("thirdPartyPlat", thirdPartyPlat);
75   - requestMap.put("thirdPartyId", thirdPartyId);
76   - requestMap.put("nickName", nickName);
77   - requestMap.put("gender", gender);
78   - requestMap.put("location", location);
79   - requestMap.put("faceUrl", faceUrl);
80   -
81   - return BaseRequest.init().service(ApiBaseServiceOpen.class).loginIn3rdAndMobileForWJJ(requestMap);
82   - }
83   -}
cloud/user/src/main/java/com/cnlive/cloud/user/frame/data/OtherUserInfo.java renamed to cloud/third_tool/src/main/java/com/cnlive/login/model/OtherUserInfo.java
1   -package com.cnlive.cloud.user.frame.data;
  1 +package com.cnlive.login.model;
2 2  
3 3 import java.io.Serializable;
4 4  
... ...
cloud/third_tool/src/main/java/com/cnlive/login/model/ThirdLoginInfo.java
1 1 package com.cnlive.login.model;
2 2  
3 3  
4   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
5 4  
6 5 /**
7 6 * 作者: 吴奎庆
... ...
cloud/third_tool/src/main/java/com/cnlive/login/utils/ThirdLoginUtil.java
1 1 package com.cnlive.login.utils;
2 2  
  3 +import android.app.Activity;
3 4 import android.content.Context;
  5 +import android.content.Intent;
4 6 import android.text.TextUtils;
  7 +import android.util.Log;
5 8  
6   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
  9 +import com.cnlive.core.libs.base.application.AppConfig;
  10 +import com.cnlive.core.libs.base.util.AlertUtil;
  11 +import com.cnlive.login.model.OtherUserInfo;
7 12 import com.cnlive.login.model.ThirdLoginInfo;
8 13 import com.cnlive.login.observer.ThirdLoginObservable;
  14 +import com.cnlive.share.BuildConfig;
9 15 import com.sina.weibo.sdk.auth.Oauth2AccessToken;
  16 +import com.sina.weibo.sdk.auth.WbAuthListener;
  17 +import com.sina.weibo.sdk.auth.WbConnectErrorMessage;
  18 +import com.sina.weibo.sdk.auth.sso.SsoHandler;
10 19 import com.sina.weibo.sdk.net.HttpManager;
11 20 import com.sina.weibo.sdk.net.WeiboParameters;
12 21 import com.tencent.connect.UserInfo;
  22 +import com.tencent.mm.opensdk.modelmsg.SendAuth;
  23 +import com.tencent.mm.opensdk.openapi.IWXAPI;
  24 +import com.tencent.mm.opensdk.openapi.WXAPIFactory;
13 25 import com.tencent.tauth.IUiListener;
14 26 import com.tencent.tauth.Tencent;
15 27 import com.tencent.tauth.UiError;
... ... @@ -37,6 +49,101 @@ import static com.tencent.open.SocialConstants.PARAM_OPEN_ID;
37 49 * 简介: 三方登陆的工具类
38 50 */
39 51 public class ThirdLoginUtil {
  52 +
  53 + //qq登录
  54 + private static Tencent mTencent;
  55 + public static final String ACOPE_ALL = "all";
  56 + private static Activity mContext;
  57 +
  58 + private static SsoHandler mSsoHandler;
  59 +
  60 + public static void init(Context context) {
  61 + synchronized (Tencent.class) {
  62 + if (mTencent == null) {
  63 + mTencent = Tencent.createInstance(BuildConfig.QQ_SHARE, context);
  64 + }
  65 + }
  66 + }
  67 +
  68 +
  69 + /**
  70 + * 是否安装qq
  71 + * @param context
  72 + * @return
  73 + */
  74 + public static boolean isQQInstalled(Activity context){
  75 + boolean isInstall = false;
  76 + mContext = context;
  77 + isInstall = mTencent.isQQInstalled(context);
  78 + if(isInstall) mTencent.login(context, ACOPE_ALL, listener);
  79 + return isInstall;
  80 + }
  81 +
  82 + /**
  83 + * 回调处理
  84 + * @param requestCode
  85 + * @param resultCode
  86 + * @param data
  87 + */
  88 + public static void getQQResult(int requestCode, int resultCode, Intent data){
  89 + Tencent.onActivityResultData(requestCode, resultCode, data, listener);
  90 + }
  91 +
  92 +
  93 + /**
  94 + * 微博登录
  95 + * @param activity
  96 + */
  97 + public static void loginWeibo(Activity activity){
  98 + if(mSsoHandler == null)mSsoHandler = new SsoHandler(activity);
  99 + mSsoHandler.authorize(new WbAuthListener() {
  100 + @Override
  101 + public void onSuccess(Oauth2AccessToken oauth2AccessToken) {
  102 + getWeiBoInfo(activity, oauth2AccessToken);
  103 + }
  104 +
  105 + @Override
  106 + public void cancel() {
  107 + AlertUtil.showDeftToast(activity, "取消登录");
  108 + }
  109 +
  110 + @Override
  111 + public void onFailure(WbConnectErrorMessage wbConnectErrorMessage) {
  112 + AlertUtil.showDeftToast(activity, "登录失败");
  113 + }
  114 + });
  115 + }
  116 +
  117 + /**
  118 + * 微博回调处理
  119 + * @param requestCode
  120 + * @param resultCode
  121 + * @param data
  122 + */
  123 + public static void getWeiboResult(int requestCode, int resultCode, Intent data){
  124 + if (mSsoHandler != null) {
  125 + try {
  126 + mSsoHandler.authorizeCallBack(requestCode, resultCode, data);
  127 + } catch (Exception e) {
  128 + Log.e("新浪异常:", "", e);
  129 + }
  130 + }
  131 + }
  132 +
  133 + /**
  134 + * 微信登录
  135 + * @param activity
  136 + * @param wechatAppId
  137 + */
  138 + public static void loginWechat(Activity activity,String wechatAppId){
  139 + SendAuth.Req req = new SendAuth.Req();
  140 + req.scope = "snsapi_userinfo";
  141 + req.state = BuildConfig.SEND_AUTH_REQ_STATE;
  142 +
  143 + IWXAPI iwxapi = WXAPIFactory.createWXAPI(activity, AppConfig.getWechatAppid(), true);
  144 + iwxapi.registerApp(wechatAppId);
  145 + iwxapi.sendReq(req);
  146 + }
40 147 /**
41 148 * 获取微博信息
42 149 *
... ... @@ -206,4 +313,20 @@ public class ThirdLoginUtil {
206 313 });
207 314 }
208 315  
  316 + static IUiListener listener = new IUiListener() {
  317 + @Override
  318 + public void onComplete(Object o) {
  319 + getQQInfo(mContext, mTencent, o);
  320 + }
  321 +
  322 + @Override
  323 + public void onError(UiError uiError) {
  324 + AlertUtil.showDeftToast(mContext, "登录失败");
  325 + }
  326 +
  327 + @Override
  328 + public void onCancel() {
  329 + AlertUtil.showDeftToast(mContext, "取消登录");
  330 + }
  331 + };
209 332 }
... ...
cloud/third_tool/src/main/java/com/cnlive/share/arouter/ARouterUtil.java
... ... @@ -3,9 +3,9 @@ package com.cnlive.share.arouter;
3 3 import android.content.Context;
4 4  
5 5 import com.alibaba.android.arouter.launcher.ARouter;
  6 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
6 7 import com.cnlive.core.libs.base.util.SharedPreferencesHelper;
7 8 import com.cnlive.core.network.action.CoinRainAction;
8   -import com.cnlive.cloud.user.auth.UserService;
9 9  
10 10 public class ARouterUtil {
11 11 /**
... ... @@ -14,7 +14,9 @@ public class ARouterUtil {
14 14 public static void addIntegrationPic(Context context, String taskId, String contentId, String addtype) {
15 15 Boolean app_is_show_integral = SharedPreferencesHelper.getInstance(context).getBoolValue("APP_IS_SHOW_INTEGRAL");
16 16 if (app_is_show_integral) {
17   - CoinRainAction.code(context, UserService.getUid(context), taskId, contentId, addtype,false);
  17 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  18 + String sid = service.getUid(context);
  19 + CoinRainAction.code(context, sid, taskId, contentId, addtype,false);
18 20 }
19 21 }
20 22  
... ...
cloud/third_tool/src/main/java/com/cnlive/share/ui/ShareImgActivity.java
... ... @@ -15,6 +15,8 @@ import android.view.ViewGroup;
15 15 import android.widget.LinearLayout;
16 16  
17 17 import com.alibaba.android.arouter.facade.annotation.Route;
  18 +import com.alibaba.android.arouter.launcher.ARouter;
  19 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
18 20 import com.cnlive.core.libs.base.util.AlertUtil;
19 21 import com.cnlive.core.libs.base.util.DoublePressed;
20 22 import com.cnlive.share.BuildConfig;
... ... @@ -23,7 +25,6 @@ import com.cnlive.share.data.IconInfo;
23 25 import com.cnlive.share.observable.ShareClickObservable;
24 26 import com.cnlive.share.util.ShareUtils;
25 27 import com.cnlive.share.util.Util;
26   -import com.cnlive.cloud.user.auth.UserService;
27 28 import com.sina.weibo.sdk.share.WbShareCallback;
28 29 import com.sina.weibo.sdk.share.WbShareHandler;
29 30 import com.tencent.connect.common.Constants;
... ... @@ -90,8 +91,11 @@ public class ShareImgActivity extends AppCompatActivity implements ShareDialogLi
90 91 }
91 92  
92 93 private void initList() {
93   - if (getIntent().getStringExtra("fileName") != null)
94   - fileName = UserService.getUid(this) + getIntent().getStringExtra("fileName");
  94 + if (getIntent().getStringExtra("fileName") != null){
  95 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  96 + String sid = service.getUid(this);
  97 + fileName = sid + getIntent().getStringExtra("fileName");
  98 + }
95 99 SharedPreferences sp = this.getSharedPreferences("sp", Context.MODE_PRIVATE);
96 100 String bt = sp.getString("share_img_string", "");
97 101 bitmap = convertStringToIcon(bt);
... ...
cloud/third_tool/src/main/java/com/cnlive/share/util/ShareUtils.java
... ... @@ -16,6 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
16 16 import com.bumptech.glide.Glide;
17 17 import com.bumptech.glide.request.RequestOptions;
18 18 import com.cnlive.core.libs.base.application.AppConfig;
  19 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
19 20 import com.cnlive.core.libs.base.util.AlertUtil;
20 21 import com.cnlive.core.libs.base.util.FileUtils;
21 22 import com.cnlive.core.libs.base.util.NetworkUtil;
... ... @@ -33,7 +34,6 @@ import com.cnlive.share.data.ShareInfo;
33 34 import com.cnlive.share.data.ShareIntegralTypeInfo;
34 35 import com.cnlive.share.model.ShareReleaseInfoUtil;
35 36 import com.cnlive.share.model.ShortLinkInfo;
36   -import com.cnlive.cloud.user.auth.UserService;
37 37 import com.google.gson.Gson;
38 38 import com.sina.weibo.sdk.api.ImageObject;
39 39 import com.sina.weibo.sdk.api.TextObject;
... ... @@ -284,12 +284,14 @@ public class ShareUtils {
284 284 */
285 285 public static void processQQCallBack(Activity mContext, String shareType, String contentId) {
286 286 if (TextUtils.isEmpty(shareType)) return;
  287 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  288 + String sid = service.getUid(mContext);
287 289 switch (shareType) {
288 290 case "witnessVideo":
289 291 SharedPreferences preferences = mContext.getSharedPreferences("sharevideo", MODE_PRIVATE);
290   - boolean status = preferences.getBoolean(UserService.getUid(mContext), false);
  292 + boolean status = preferences.getBoolean(sid, false);
291 293 String newTime = DateTimeUtil.getCurrentTime();
292   - String oldtime = preferences.getString(UserService.getUid(mContext) + "time", "2019-04-10");
  294 + String oldtime = preferences.getString(sid + "time", "2019-04-10");
293 295 boolean sameDay = DateTimeUtil.isSameDay(newTime, oldtime);
294 296 if (!status) {
295 297 ARouterUtil.addIntegrationPic(mContext, "share_video", contentId, "sharevideo");
... ... @@ -300,9 +302,9 @@ public class ShareUtils {
300 302 break;
301 303 default:
302 304 SharedPreferences preferences1 = mContext.getSharedPreferences("sharearticle", MODE_PRIVATE);
303   - boolean status1 = preferences1.getBoolean(UserService.getUid(mContext), false);
  305 + boolean status1 = preferences1.getBoolean(sid, false);
304 306 String newTime1 = DateTimeUtil.getCurrentTime();
305   - String oldtime1 = preferences1.getString(UserService.getUid(mContext) + "time", "2019-04-10");
  307 + String oldtime1 = preferences1.getString(sid + "time", "2019-04-10");
306 308 boolean sameDay1 = DateTimeUtil.isSameDay(newTime1, oldtime1);
307 309 if (!status1) {
308 310 ARouterUtil.addIntegrationPic(mContext, "share_article", contentId, "sharearticle");
... ...
cloud/third_tool/src/main/java/com/cnlive/share/util/Util.java
... ... @@ -20,10 +20,11 @@ import android.graphics.Rect;
20 20 import android.net.Uri;
21 21 import android.text.TextUtils;
22 22  
  23 +import com.alibaba.android.arouter.launcher.ARouter;
23 24 import com.cnlive.core.libs.base.application.AppConfig;
  25 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
24 26 import com.cnlive.core.network.util.UriUtil;
25 27 import com.cnlive.share.BuildConfig;
26   -import com.cnlive.cloud.user.auth.UserService;
27 28 import com.sina.weibo.sdk.WbSdk;
28 29 import com.sina.weibo.sdk.auth.AuthInfo;
29 30 import com.tencent.mm.opensdk.openapi.IWXAPI;
... ... @@ -156,6 +157,8 @@ public class Util {
156 157 */
157 158 public static String processUrlData(String shareInfoUrl, Context mContext, boolean isToWjj) {
158 159 if (shareInfoUrl.contains("http://wjjh5.cnlive.com") || shareInfoUrl.contains("http://wjjh5test.cnlive.com")) {
  160 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  161 + String userId = service.getUid(mContext);
159 162 Uri oldUri = Uri.parse(shareInfoUrl);
160 163 //判断分享地址中是否有参数,如果没有则先拼接问号
161 164 if (oldUri.getQueryParameterNames().size() <= 0) {
... ... @@ -164,13 +167,13 @@ public class Util {
164 167 }
165 168 if (!shareInfoUrl.contains("?sid=") && !shareInfoUrl.contains("&sid=")) {
166 169 StringBuilder pageUrl = new StringBuilder(shareInfoUrl);
167   - pageUrl.append(oldUri.getQueryParameterNames().size() <= 0 ? "sid=" : "&sid=").append(UserService.getUid(mContext));
  170 + pageUrl.append(oldUri.getQueryParameterNames().size() <= 0 ? "sid=" : "&sid=").append(userId);
168 171 shareInfoUrl = pageUrl.toString();
169 172 }
170 173  
171 174 if (!shareInfoUrl.contains("?shareSid=") && !shareInfoUrl.contains("&shareSid=")) {
172 175 StringBuilder pageUrl = new StringBuilder(shareInfoUrl);
173   - pageUrl.append("&shareSid=").append(UserService.getUid(mContext));
  176 + pageUrl.append("&shareSid=").append(userId);
174 177 shareInfoUrl = pageUrl.toString();
175 178 }
176 179 if (!shareInfoUrl.contains("?isApp=") && !shareInfoUrl.contains("&isApp=")) {
... ... @@ -208,15 +211,16 @@ public class Util {
208 211 String url = urls[0];
209 212 StringBuilder pageUrl = new StringBuilder(url);
210 213 pageUrl.append("?");
  214 +
211 215 for (String key : uri.getQueryParameterNames()) {
212 216 if ("sid".equals(key)) {
213   - pageUrl.append(key).append("=").append(Uri.encode(TextUtils.isEmpty(UserService.getUid(mContext)) ? "" : UserService.getUid(mContext))).append("&");
  217 + pageUrl.append(key).append("=").append(Uri.encode(TextUtils.isEmpty(userId) ? "" : userId)).append("&");
214 218 } else if ("ver".equals(key)) {
215 219 pageUrl.append(key).append("=").append(Uri.encode(TextUtils.isEmpty(AppConfig.getAppVersion()) ? "" : AppConfig.getAppVersion())).append("&");
216 220 } else if ("plat".equals(key)) {
217 221 pageUrl.append(key).append("=").append(Uri.encode("a")).append("&");
218 222 } else if ("shareSid".equals(key)) {
219   - pageUrl.append(key).append("=").append(Uri.encode(TextUtils.isEmpty(UserService.getUid(mContext)) ? "" : UserService.getUid(mContext))).append("&");
  223 + pageUrl.append(key).append("=").append(Uri.encode(TextUtils.isEmpty(userId) ? "" : userId)).append("&");
220 224 } else if ("isApp".equals(key)) {
221 225 pageUrl.append(key).append("=").append(isToWjj).append("&");
222 226 } else if ("wjjFrom".equals(key)) {
... ...
cloud/user/build.gradle
... ... @@ -49,6 +49,6 @@ dependencies {
49 49 implementation "com.cnlive.libs:emoj:$rootProject.libEmoj"
50 50 //图片选择器
51 51 implementation "com.cnlive.libs:mediapicker:$rootProject.libMediaPicker"
52   -// implementation project(path: ':cloud:third_tool')
  52 + implementation project(path: ':cloud:third_tool')
53 53  
54 54 }
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/UserUtilAction.java
... ... @@ -325,6 +325,70 @@ public class UserUtilAction {
325 325 // return null;
326 326 // }
327 327  
  328 +
  329 + /**
  330 + * 其他平台账户登录
  331 + *
  332 + * @param context
  333 + * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren
  334 + * @param thirdPartyId 第三方用户ID
  335 + * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr];
  336 + * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同
  337 + */
  338 + public static Observable<BaseResult<UserData>> otherLogin(Context context, String thirdPartyPlat, String thirdPartyId) {
  339 +
  340 + Map<String, String> requestMap = new HashMap<>();
  341 + requestMap.put("appId", AppConfig.getAppId());
  342 + requestMap.put("thirdPartyPlat", thirdPartyPlat);
  343 + requestMap.put("thirdPartyId", thirdPartyId);
  344 + requestMap.put("frmId", AppConfig.getAppChannel());
  345 + requestMap.put("clientPlat", "a");
  346 + return BaseRequest.init().service(ApiBaseServiceOpen.class).loginIn3rdForWJJ(requestMap);
  347 + }
  348 +
  349 + /**
  350 + * 其他平台账户版定手机号并登录
  351 + *
  352 + * @param context
  353 + * @param thirdPartyPlat 平台类型 1:sina 2:qq 3:weixin 4:renren
  354 + * @param thirdPartyId 第三方用户ID
  355 + * [qq: 建议使用openid, wx: 建议使用unionid, sina: 建议使用idstr];
  356 + * 注意:同一用户在登录Sp下不同app时,thirdPartyId必须相同
  357 + */
  358 +
  359 +
  360 + public static Observable<BaseResult<UserData>> otherLoginBindMobile(Context context,
  361 + String phone,
  362 + String countryCode,
  363 + String ems,
  364 + String thirdPartyPlat,
  365 + String thirdPartyId,
  366 + String nickName,
  367 + String gender,
  368 + String location,
  369 + String faceUrl) {
  370 + Map<String, String> requestMap = new HashMap<>();
  371 +
  372 + requestMap.put("frmId", AppConfig.getAppChannel());
  373 + requestMap.put("clientPlat", "a");
  374 + requestMap.put("uuid", AppConfig.getAppUUID());
  375 +
  376 + requestMap.put("appId", AppConfig.getAppId());
  377 + requestMap.put("mobile", phone);
  378 + requestMap.put("countryCode", countryCode);
  379 + requestMap.put("verificationCode", ems);
  380 +
  381 + requestMap.put("thirdPartyPlat", thirdPartyPlat);
  382 + requestMap.put("thirdPartyId", thirdPartyId);
  383 + requestMap.put("nickName", nickName);
  384 + requestMap.put("gender", gender);
  385 + requestMap.put("location", location);
  386 + requestMap.put("faceUrl", faceUrl);
  387 +
  388 + return BaseRequest.init().service(ApiBaseServiceOpen.class).loginIn3rdAndMobileForWJJ(requestMap);
  389 + }
  390 +
  391 +
328 392 private static String getPath() {
329 393 String path = Environment.getExternalStorageDirectory() + "/strike/image/";
330 394 File file = new File(path);
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/frame/presenter/LoginDialogPresenter.java
... ... @@ -13,7 +13,6 @@ import com.cnlive.core.network.model.BaseResult;
13 13 import com.cnlive.cloud.user.R;
14 14 import com.cnlive.cloud.user.UserUtilAction;
15 15 import com.cnlive.cloud.user.auth.UserService;
16   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
17 16 import com.cnlive.cloud.user.frame.data.QuickLoginData;
18 17 import com.cnlive.cloud.user.frame.view.LoginDialogView;
19 18 import com.cnlive.cloud.user.model.CNLiveUserInfo;
... ... @@ -21,6 +20,7 @@ import com.cnlive.cloud.user.router.user.UserAction;
21 20 import com.cnlive.cloud.user.ui.activity.LoginDialogActivity;
22 21 import com.cnlive.cloud.user.util.RegexUtils;
23 22 import com.cnlive.cloud.user.util.TimeEvent;
  23 +import com.cnlive.login.model.OtherUserInfo;
24 24  
25 25 import java.util.Arrays;
26 26 import java.util.Collections;
... ... @@ -40,6 +40,7 @@ public class LoginDialogPresenter extends BasePresenter&lt;LoginDialogView&gt; {
40 40 private static final String TAG = "QuickLoginPresenter";
41 41  
42 42 private Disposable event;
  43 + private Disposable otherEvent;
43 44 private Disposable sendMsgBefQuickLogin;
44 45 private TimerWaitUtil timerUtil; //计时工具类
45 46  
... ... @@ -65,8 +66,10 @@ public class LoginDialogPresenter extends BasePresenter&lt;LoginDialogView&gt; {
65 66 Account account = accounts.length > 0 ? accounts[0] : null;
66 67 String name = account == null ? "" : account.name;
67 68 //页面填充数据
68   - ifViewAttached(view -> view.uploadInputData(name));
69   - ifViewAttached(view -> view.uploadListData(accounts));
  69 + if(getView() != null){
  70 + getView().uploadInputData(name);
  71 + getView().uploadListData(accounts);
  72 + }
70 73 }
71 74  
72 75 private void startTimer() {
... ... @@ -217,26 +220,27 @@ public class LoginDialogPresenter extends BasePresenter&lt;LoginDialogView&gt; {
217 220 break;
218 221 }
219 222 }
220   -// /**
221   -// * 三方登陆
222   -// *
223   -// * @param context
224   -// * @param otherUserInfo
225   -// */
226   -// public void otherLogin(LoginDialogActivity context, OtherUserInfo otherUserInfo) {
227   -// if (otherUserInfo == null) {
228   -// getView().showToast(context.getString(R.string.user_toast_other_info_error));
229   -// } else {
230   -// cancelLoad();
231   -// context.isLogin = true;
232   -//
233   -// UserAction.otherLogin(context, context.otherUserInfo.getLoginType(), context.otherUserInfo.getThirdPartyId(), initLoginEvent(context, false, otherUserInfo));
234   -// }
235   -// }
236   -//
237   -// private Event<CNLiveUserInfo> initLoginEvent(LoginDialogActivity context, Boolean retry) {
238   -// return initLoginEvent(context, retry, null);
239   -// }
  223 + /**
  224 + * 三方登陆
  225 + *
  226 + * @param context
  227 + * @param otherUserInfo
  228 + */
  229 + public void otherLogin(LoginDialogActivity context, OtherUserInfo otherUserInfo) {
  230 + if (otherUserInfo == null) {
  231 + getView().showToast(context.getString(R.string.user_toast_other_info_error));
  232 + } else {
  233 + cancelLoad();
  234 + context.isLogin = true;
  235 +
  236 + otherEvent = UserAction.otherLogin(context, otherUserInfo.getLoginType(), otherUserInfo.getThirdPartyId(), new UserAction.CallBack() {
  237 + @Override
  238 + public void callback(int state, String msg, Object object) {
  239 + initLoginEvent(context, state,msg,false, otherUserInfo);
  240 + }
  241 + });
  242 + }
  243 + }
240 244  
241 245  
242 246 public void cancelLoad() {
... ... @@ -246,6 +250,13 @@ public class LoginDialogPresenter extends BasePresenter&lt;LoginDialogView&gt; {
246 250 }
247 251 event = null;
248 252 }
  253 +
  254 + if (otherEvent != null) {
  255 + if (!otherEvent.isDisposed()) {
  256 + otherEvent.dispose();
  257 + }
  258 + otherEvent = null;
  259 + }
249 260 }
250 261  
251 262 /**
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/frame/presenter/QuickLoginPresenter.java
1 1 package com.cnlive.cloud.user.frame.presenter;
2 2  
3 3 import android.accounts.Account;
  4 +import android.app.Activity;
4 5 import android.content.Context;
5 6 import android.text.TextUtils;
6 7  
7 8 import com.cnlive.cloud.user.R;
8 9 import com.cnlive.cloud.user.UserUtilAction;
9 10 import com.cnlive.cloud.user.auth.UserService;
10   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
11 11 import com.cnlive.cloud.user.frame.data.QuickLoginData;
12 12 import com.cnlive.cloud.user.frame.view.QuickLoginView;
13 13 import com.cnlive.cloud.user.model.CNLiveUserInfo;
14 14 import com.cnlive.cloud.user.router.user.UserAction;
  15 +import com.cnlive.cloud.user.ui.activity.LoginDialogActivity;
15 16 import com.cnlive.cloud.user.ui.fragment.QuickLoginFragment;
16 17 import com.cnlive.cloud.user.util.RegexUtils;
17 18 import com.cnlive.cloud.user.util.TimeEvent;
... ... @@ -21,6 +22,7 @@ import com.cnlive.core.network.model.BaseResult;
21 22 import com.cnlive.core.network.HttpConn;
22 23 import com.cnlive.core.network.NetCallBack;
23 24 import com.cnlive.core.libs.base.util.TimerWaitUtil;
  25 +import com.cnlive.login.model.OtherUserInfo;
24 26  
25 27 import java.util.Arrays;
26 28 import java.util.Collections;
... ... @@ -38,7 +40,7 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
38 40  
39 41 private Disposable event;
40 42 private Disposable sendMsgBefQuickLogin;
41   -// private Event otherEvent;
  43 + private Disposable otherEvent;
42 44  
43 45 public void deleteUserInfo(Context context, String userName) {
44 46 UserService.getInstance(context).removeUser(userName, future -> {
... ... @@ -62,8 +64,8 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
62 64 Account account = accounts.length > 0 ? accounts[0] : null;
63 65 String name = account == null ? "" : account.name;
64 66 //页面填充数据
65   - ifViewAttached(view -> view.uploadInputData(name));
66   - ifViewAttached(view -> view.uploadListData(accounts));
  67 + getView().uploadInputData(name);
  68 + getView().uploadListData(accounts);
67 69 }
68 70  
69 71 private void startTimer() {
... ... @@ -137,6 +139,29 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
137 139 }
138 140 }
139 141  
  142 +
  143 + /**
  144 + * 三方登陆
  145 + *
  146 + * @param context
  147 + * @param otherUserInfo
  148 + */
  149 + public void otherLogin(QuickLoginFragment context, OtherUserInfo otherUserInfo) {
  150 + if (otherUserInfo == null) {
  151 + getView().showToast(context.getString(R.string.user_toast_other_info_error));
  152 + } else {
  153 + cancelLoad();
  154 + context.isLogin = true;
  155 +
  156 + otherEvent = UserAction.otherLogin(context.getActivity(), otherUserInfo.getLoginType(), otherUserInfo.getThirdPartyId(), new UserAction.CallBack() {
  157 + @Override
  158 + public void callback(int state, String msg, Object object) {
  159 + initLoginEvent(context, state,msg,false, otherUserInfo);
  160 + }
  161 + });
  162 + }
  163 + }
  164 +
140 165 private void initLoginEvent(QuickLoginFragment context, int state, String msg, Boolean retry, OtherUserInfo otherUserInfo) {
141 166 switch (state) {
142 167 //请求成功
... ... @@ -173,10 +198,12 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
173 198 }
174 199 break;
175 200 case HttpConn.ON_START:
176   - ifViewAttached(view -> view.showProgress());
  201 + if(getView() != null) getView().showProgress();
  202 +// ifViewAttached(view -> view.showProgress());
177 203 break;
178 204 case HttpConn.ON_END:
179   - ifViewAttached(view -> view.hideProgress());
  205 + if(getView() != null) getView().hideProgress();
  206 +// ifViewAttached(view -> view.hideProgress());
180 207 break;
181 208 case 41010: //手机号无效
182 209 ifViewAttached(view -> view.showToast(msg));
... ... @@ -301,5 +328,12 @@ public class QuickLoginPresenter extends BasePresenter&lt;QuickLoginView&gt; {
301 328 }
302 329 event = null;
303 330 }
  331 +
  332 + if (otherEvent != null) {
  333 + if (!otherEvent.isDisposed()) {
  334 + otherEvent.dispose();
  335 + }
  336 + otherEvent = null;
  337 + }
304 338 }
305 339 }
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/frame/view/LoginDialogView.java
... ... @@ -19,13 +19,13 @@ import com.cnlive.core.libs.base.frame.view.BaseView;
19 19 import com.cnlive.core.libs.base.util.AlertUtil;
20 20 import com.cnlive.core.libs.base.util.DoublePressed;
21 21 import com.cnlive.cloud.user.R;
22   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
23 22 import com.cnlive.cloud.user.sms.OnSmsCatchListener;
24 23 import com.cnlive.cloud.user.sms.SmsVerifyCatcher;
25 24 import com.cnlive.cloud.user.ui.activity.FirstLoginActivity;
26 25 import com.cnlive.cloud.user.ui.activity.LoginActivity;
27 26 import com.cnlive.cloud.user.ui.activity.LoginDialogActivity;
28 27 import com.cnlive.cloud.user.util.UserRouterHelper;
  28 +import com.cnlive.login.model.OtherUserInfo;
29 29  
30 30 import java.util.regex.Matcher;
31 31 import java.util.regex.Pattern;
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/frame/view/QuickLoginView.java
... ... @@ -17,7 +17,6 @@ import android.view.View;
17 17  
18 18 import com.alibaba.android.arouter.launcher.ARouter;
19 19 import com.cnlive.cloud.user.R;
20   -import com.cnlive.cloud.user.frame.data.OtherUserInfo;
21 20 import com.cnlive.cloud.user.model.LoginSuccessInfo;
22 21 import com.cnlive.cloud.user.sms.OnSmsCatchListener;
23 22 import com.cnlive.cloud.user.sms.SmsVerifyCatcher;
... ... @@ -28,6 +27,8 @@ import com.cnlive.core.libs.base.application.AppConfig;
28 27 import com.cnlive.core.libs.base.frame.view.BaseView;
29 28 import com.cnlive.core.libs.base.util.AlertUtil;
30 29 import com.cnlive.core.libs.base.util.DoublePressed;
  30 +import com.cnlive.login.model.OtherUserInfo;
  31 +
31 32 import java.util.regex.Matcher;
32 33 import java.util.regex.Pattern;
33 34  
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/router/user/UserAction.java
... ... @@ -76,6 +76,31 @@ public class UserAction {
76 76  
77 77 }
78 78  
  79 +
  80 + public static Disposable otherLogin(Context context, String thirdPartyPlat, String thirdPartyId, CallBack callBack) {
  81 +
  82 + return HttpConn.action(UserUtilAction.otherLogin(context, thirdPartyPlat, thirdPartyId), new NetCallBack<BaseResult<UserData>>() {
  83 + @Override
  84 + public void onRequestState(int state) {
  85 + if (null != callBack) {
  86 + callBack.callback(state, "", null);
  87 + }
  88 + }
  89 +
  90 + @Override
  91 + public void onSuccess(BaseResult<UserData> data) {
  92 + loginAppAction(data, context, "", "", true, callBack);
  93 + }
  94 +
  95 + @Override
  96 + public void onFailure(String errCode, String errMsg, Exception e) {
  97 + if (null != callBack) {
  98 + callBack.callback(Integer.parseInt(errCode), errMsg, null);
  99 + }
  100 + }
  101 + });
  102 + }
  103 +
79 104 private static Observable<CNLiveUserInfo> loginAppAction(BaseResult<UserData> data, Context context, String userName, String userPassword, boolean otherLogin, CallBack callBack) {
80 105 CNLiveUserInfo userinfo = null;
81 106 if (null == data || null == data.getData()) {
... ... @@ -104,6 +129,32 @@ public class UserAction {
104 129 return Observable.just(userinfo);
105 130 }
106 131  
  132 +
  133 + public static void otherLoginBindMobile(Context context, String phone, String countryCode, String ems,
  134 + String thirdPartyPlat, String thirdPartyId, String nickName, String gender,
  135 + String location, String faceUrl, CallBack callBack) {
  136 +
  137 + HttpConn.action(UserUtilAction.otherLoginBindMobile(context, phone, countryCode, ems,
  138 + thirdPartyPlat, thirdPartyId, nickName, gender, location, faceUrl), new NetCallBack<BaseResult<UserData>>() {
  139 + @Override
  140 + public void onRequestState(int state) {
  141 + if (null != callBack) {
  142 + callBack.callback(state, "", null);
  143 + }
  144 + }
  145 +
  146 + @Override
  147 + public void onSuccess(BaseResult<UserData> data) {
  148 + loginAppAction(data,context, "", "", true, callBack);
  149 + }
  150 +
  151 + @Override
  152 + public void onFailure(String errCode, String errMsg, Exception e) {
  153 +
  154 + }
  155 + });
  156 + }
  157 +
107 158 public interface CallBack {
108 159 void callback(int state, String msg, Object object);
109 160 }
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/ui/activity/LoginDialogActivity.java
... ... @@ -25,6 +25,15 @@ import com.cnlive.cloud.user.frame.view.LoginDialogView;
25 25 import com.cnlive.cloud.user.router.user.UserAction;
26 26 import com.cnlive.cloud.user.sms.SmsVerifyCatcher;
27 27 import com.cnlive.cloud.user.ui.adapter.UserListAdapter;
  28 +import com.cnlive.login.model.OtherUserInfo;
  29 +import com.cnlive.login.model.ThirdLoginInfo;
  30 +import com.cnlive.login.observer.ThirdLoginObservable;
  31 +import com.cnlive.login.observer.WechatLoginObservable;
  32 +import com.cnlive.login.utils.ThirdLoginUtil;
  33 +import com.cnlive.share.data.WeChatInfo;
  34 +import com.cnlive.share.util.Util;
  35 +
  36 +import java.util.Observable;
28 37  
29 38 import static com.cnlive.cloud.user.ui.activity.LoginActivity.TAG_CLICK_AD;
30 39  
... ... @@ -48,11 +57,11 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
48 57 public boolean hasLogin = false;//是否已经登录
49 58 public Uri uri;
50 59 public String tagShare;
51   - //三方登陆
52   - //qq的权限
53   - public final String ACOPE_ALL = "all";
  60 +
54 61 //三方登陆的信息
  62 + public OtherUserInfo otherUserInfo;
55 63 public Boolean clickAd;
  64 +
56 65 public String tagUrl;
57 66 public ActivityLoginDialogBinding binding;
58 67 public QuickLoginData data;
... ... @@ -83,7 +92,7 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
83 92 p.height = WindowManager.LayoutParams.MATCH_PARENT;
84 93 p.width = (ScreenUtils.getScreenWidth(this) - dp2px(88));
85 94 getWindow().setAttributes(p);
86   -// initThreeLogin();
  95 + initThreeLogin();
87 96 uri = UserAction.getUri(this);
88 97 tagUrl = getIntent().getStringExtra(TAG_URL);
89 98 clickAd = getIntent().getBooleanExtra(TAG_CLICK_AD, false);
... ... @@ -108,6 +117,15 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
108 117 }
109 118  
110 119  
  120 + /**
  121 + * 初始化第三方
  122 + */
  123 + private void initThreeLogin() {
  124 + ThirdLoginUtil.init(this);
  125 + WechatLoginObservable.getInstance().addObserver(this);
  126 + ThirdLoginObservable.getInstance().addObserver(this);
  127 + }
  128 +
111 129  
112 130 @Override
113 131 public void onStart() {
... ... @@ -153,8 +171,24 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
153 171 // }
154 172 else if (id == R.id.iv_qq) {
155 173 if (DoublePressed.onDoublePressed()) return;
  174 + if (!ThirdLoginUtil.isQQInstalled(LoginDialogActivity.this) && getMvpView() != null)
  175 + getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
156 176 } else if (id == R.id.iv_wb) {
157 177 if (DoublePressed.onDoublePressed()) return;
  178 + if (Util.isWeiboInstallAndInit(this)) {
  179 + ThirdLoginUtil.loginWeibo(LoginDialogActivity.this);
  180 + } else {
  181 + if (getMvpView() != null) getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  182 + }
  183 + } else if (id == R.id.iv_wc) {
  184 + if (DoublePressed.onDoublePressed()) return;
  185 + if (Util.isWXAppInstalledAndSupported(this)) {
  186 + new Thread(() -> {
  187 + ThirdLoginUtil.loginWechat(LoginDialogActivity.this, AppConfig.getWechatAppid());
  188 + }).start();
  189 + } else {
  190 + if (getMvpView() != null) getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  191 + }
158 192 } else if (id == R.id.iv_close) {
159 193 finish();
160 194 }
... ... @@ -190,6 +224,9 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
190 224 super.onDestroy();
191 225 if (getMvpView() != null) getMvpView().hideProgress();
192 226 if (getPresenter() != null) getPresenter().destroy();
  227 +
  228 + WechatLoginObservable.getInstance().deleteObserver(this);
  229 + ThirdLoginObservable.getInstance().deleteObserver(this);
193 230 }
194 231  
195 232 @Override
... ... @@ -214,6 +251,9 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
214 251 }
215 252 }
216 253  
  254 + ThirdLoginUtil.getQQResult(requestCode, resultCode, data);
  255 + ThirdLoginUtil.getWeiboResult(requestCode, resultCode, data);
  256 +
217 257 }
218 258  
219 259 @Override
... ... @@ -225,6 +265,48 @@ public class LoginDialogActivity extends BaseActivity&lt;LoginDialogView, LoginDial
225 265 }
226 266 }
227 267  
  268 + //微信登录回调接口
  269 + @Override
  270 + public void update(Observable observable, Object o) {
  271 + if (observable instanceof WechatLoginObservable && null != o) {
  272 + WeChatInfo weChatInfo = (WeChatInfo) o;
  273 + if (weChatInfo != null) {
  274 + otherUserInfo = new OtherUserInfo();
  275 + otherUserInfo.setFaceUrl(weChatInfo.getHeadimgurl());
  276 + if ("1".equals(weChatInfo.getSex())) {
  277 + otherUserInfo.setGender("m");
  278 + } else if ("2".equals(weChatInfo.getSex())) {
  279 + otherUserInfo.setGender("f");
  280 + } else {
  281 + otherUserInfo.setGender("n");
  282 + }
  283 +
  284 + otherUserInfo.setNickName(weChatInfo.getNickname());
  285 + if (!TextUtils.isEmpty(weChatInfo.getProvince())) {
  286 + otherUserInfo.setLocation(weChatInfo.getProvince());
  287 + } else {
  288 + otherUserInfo.setLocation(weChatInfo.getCountry());
  289 + }
  290 +
  291 + otherUserInfo.setThirdPartyId(weChatInfo.getUnionid());
  292 + otherUserInfo.setLoginType("3");
  293 + }
  294 + if (otherUserInfo != null && getPresenter() != null)
  295 + getPresenter().otherLogin(this, otherUserInfo);
  296 + } else if (observable instanceof ThirdLoginObservable) {
  297 + ThirdLoginInfo info = (ThirdLoginInfo) o;
  298 + if (info != null) {
  299 + if (info.getType() == 1) {
  300 + if (info.getOtherUserInfo() != null) otherUserInfo = info.getOtherUserInfo();
  301 + getPresenter().otherLogin(this, otherUserInfo);
  302 + } else if (info.getType() == 2) {
  303 + if (getMvpView() != null) getMvpView().showToast(info.getMessage());
  304 + }
  305 + }
  306 +
  307 + }
  308 + }
  309 +
228 310 @Override
229 311 public void finish() {
230 312 super.finish();
... ...
cloud/user/src/main/java/com/cnlive/cloud/user/ui/fragment/QuickLoginFragment.java
... ... @@ -11,6 +11,7 @@ import androidx.databinding.ViewDataBinding;
11 11  
12 12 import com.cnlive.cloud.user.databinding.FragmentQuickLoginBinding;
13 13 import com.cnlive.cloud.user.frame.presenter.QuickLoginPresenter;
  14 +import com.cnlive.cloud.user.ui.activity.LoginDialogActivity;
14 15 import com.cnlive.core.libs.base.application.AppConfig;
15 16 import com.cnlive.core.libs.base.frame.fragment.BaseFragment;
16 17 import com.cnlive.core.libs.base.util.DoublePressed;
... ... @@ -22,6 +23,16 @@ import com.cnlive.cloud.user.sms.SmsVerifyCatcher;
22 23 import com.cnlive.cloud.user.ui.activity.LoginActivity;
23 24 import com.cnlive.cloud.user.ui.activity.SelectCountryActivity;
24 25 import com.cnlive.cloud.user.ui.adapter.UserListAdapter;
  26 +import com.cnlive.login.model.OtherUserInfo;
  27 +import com.cnlive.login.model.ThirdLoginInfo;
  28 +import com.cnlive.login.observer.ThirdLoginObservable;
  29 +import com.cnlive.login.observer.WechatLoginObservable;
  30 +import com.cnlive.login.utils.ThirdLoginUtil;
  31 +import com.cnlive.share.BuildConfig;
  32 +import com.cnlive.share.data.WeChatInfo;
  33 +import com.cnlive.share.util.Util;
  34 +
  35 +import java.util.Observable;
25 36  
26 37 /**
27 38 * @author Lynn
... ... @@ -48,6 +59,10 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
48 59 public String tagUrl;
49 60 public static String TAG_URL = "tagurl";
50 61  
  62 + //三方登陆的信息
  63 + public OtherUserInfo otherUserInfo;
  64 + private boolean needEntranceBtn;
  65 +
51 66 @Override
52 67 protected int getBindLayoutId() {
53 68 return R.layout.fragment_quick_login;
... ... @@ -100,6 +115,7 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
100 115  
101 116 @Override
102 117 protected void initView() {
  118 + initThreeLogin();
103 119 adapter = new UserListAdapter(getActivity(), 0);
104 120 adapter.setClickListener((name) -> getMvpView().onUploadLoginUser(name));
105 121 adapter.setDeleteListener((name) -> getMvpView().onDeleteLoginUser(name));
... ... @@ -116,6 +132,16 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
116 132 if (getMvpView() != null) getMvpView().initView();
117 133 }
118 134  
  135 +
  136 + /**
  137 + * 初始化第三方
  138 + */
  139 + private void initThreeLogin() {
  140 + ThirdLoginUtil.init(getActivity());
  141 + WechatLoginObservable.getInstance().addObserver(this);
  142 + ThirdLoginObservable.getInstance().addObserver(this);
  143 + }
  144 +
119 145 @Override
120 146 public void onStart() {
121 147 super.onStart();
... ... @@ -158,8 +184,28 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
158 184 if (DoublePressed.onDoublePressed()) return;
159 185 SelectCountryActivity.startSelectCountryActivity(getActivity(), 1010, countryCode);
160 186  
161   - } else {
162   - if (getMvpView() != null) getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  187 + }else if (id == R.id.iv_qq) {
  188 + if (DoublePressed.onDoublePressed()) return;
  189 + if (!ThirdLoginUtil.isQQInstalled(getActivity()) && getMvpView() != null)
  190 + getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  191 + } else if (id == R.id.iv_wb) {
  192 + if (DoublePressed.onDoublePressed()) return;
  193 + if (Util.isWeiboInstallAndInit(getActivity())) {
  194 + ThirdLoginUtil.loginWeibo(getActivity());
  195 + } else {
  196 + if (getMvpView() != null) getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  197 + }
  198 + } else if (id == R.id.iv_wc) {
  199 + if (DoublePressed.onDoublePressed()) return;
  200 + if (Util.isWXAppInstalledAndSupported(getActivity())) {
  201 + new Thread(() -> {
  202 + ThirdLoginUtil.loginWechat(getActivity(), AppConfig.getWechatAppid());
  203 + }).start();
  204 + } else {
  205 + if (getMvpView() != null) getMvpView().showToast("您未安装该第三方应用,无法获取用户信息!");
  206 + }
  207 + } else if (id == R.id.iv_close) {
  208 + getActivity().finish();
163 209 }
164 210 }
165 211  
... ... @@ -193,6 +239,8 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
193 239 super.onDestroy();
194 240 if (getMvpView() != null) getMvpView().hideProgress();
195 241 if (getPresenter() != null) getPresenter().destroy();
  242 + WechatLoginObservable.getInstance().deleteObserver(this);
  243 + ThirdLoginObservable.getInstance().deleteObserver(this);
196 244 }
197 245  
198 246 @Override
... ... @@ -216,6 +264,9 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
216 264 return;
217 265 }
218 266 }
  267 +
  268 + ThirdLoginUtil.getQQResult(requestCode, resultCode, data);
  269 + ThirdLoginUtil.getWeiboResult(requestCode, resultCode, data);
219 270 }
220 271  
221 272 @Override
... ... @@ -227,5 +278,46 @@ public class QuickLoginFragment extends BaseFragment&lt;QuickLoginView, QuickLoginP
227 278 }
228 279 }
229 280  
  281 + //微信登录回调接口
  282 + @Override
  283 + public void update(Observable observable, Object o) {
  284 + if (observable instanceof WechatLoginObservable && null != o) {
  285 + WeChatInfo weChatInfo = (WeChatInfo) o;
  286 + if (weChatInfo != null) {
  287 + otherUserInfo = new OtherUserInfo();
  288 + otherUserInfo.setFaceUrl(weChatInfo.getHeadimgurl());
  289 + if ("1".equals(weChatInfo.getSex())) {
  290 + otherUserInfo.setGender("m");
  291 + } else if ("2".equals(weChatInfo.getSex())) {
  292 + otherUserInfo.setGender("f");
  293 + } else {
  294 + otherUserInfo.setGender("n");
  295 + }
  296 +
  297 + otherUserInfo.setNickName(weChatInfo.getNickname());
  298 + if (!TextUtils.isEmpty(weChatInfo.getProvince())) {
  299 + otherUserInfo.setLocation(weChatInfo.getProvince());
  300 + } else {
  301 + otherUserInfo.setLocation(weChatInfo.getCountry());
  302 + }
  303 +
  304 + otherUserInfo.setThirdPartyId(weChatInfo.getUnionid());
  305 + otherUserInfo.setLoginType("3");
  306 + }
  307 + if (otherUserInfo != null && getPresenter() != null)
  308 + getPresenter().otherLogin(this, otherUserInfo);
  309 + } else if (observable instanceof ThirdLoginObservable) {
  310 + ThirdLoginInfo info = (ThirdLoginInfo) o;
  311 + if (info != null) {
  312 + if (info.getType() == 1) {
  313 + if (info.getOtherUserInfo() != null) otherUserInfo = info.getOtherUserInfo();
  314 + getPresenter().otherLogin(this, otherUserInfo);
  315 + } else if (info.getType() == 2) {
  316 + if (getMvpView() != null) getMvpView().showToast(info.getMessage());
  317 + }
  318 + }
  319 +
  320 + }
  321 + }
230 322  
231 323 }
... ...
core/base/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpBasePresenter.java
... ... @@ -163,7 +163,7 @@ public class MvpBasePresenter&lt;V extends MvpView&gt; implements MvpPresenter&lt;V&gt; {
163 163 * {@inheritDoc}
164 164 */
165 165 public void destroy() {
166   - detachView(false);
  166 +// detachView(false);
167 167 presenterDestroyed = true;
168 168 }
169 169 }
... ...
core/database/.gitignore 0 → 100644
  1 +/build
... ...
core/database/build.gradle 0 → 100644
  1 +apply plugin: 'com.android.library'
  2 +apply plugin: 'org.greenrobot.greendao'
  3 +
  4 +android {
  5 +// compileSdkVersion 29
  6 +// buildToolsVersion "29.0.2"
  7 +//
  8 +//
  9 +// defaultConfig {
  10 +// minSdkVersion 16
  11 +// targetSdkVersion 29
  12 +// versionCode 1
  13 +// versionName "1.0"
  14 +//
  15 +// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  16 +// consumerProguardFiles 'consumer-rules.pro'
  17 +// }
  18 +//
  19 +// buildTypes {
  20 +// release {
  21 +// minifyEnabled false
  22 +// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  23 +// }
  24 +// }
  25 +
  26 +}
  27 +
  28 +greendao {
  29 + schemaVersion 1 //数据库版本号
  30 + daoPackage 'com.cnlive.database.dao'
  31 + targetGenDir 'src/main/java'
  32 + generateTests false //设置为true以自动生成单元测试。
  33 + targetGenDirTests 'src/main/java'
  34 +}
  35 +
  36 +dependencies {
  37 + implementation fileTree(dir: 'libs', include: ['*.jar'])
  38 +
  39 + //数据库加密
  40 + implementation 'net.zetetic:android-database-sqlcipher:3.5.6'
  41 +}
... ...
core/database/consumer-rules.pro 0 → 100644
core/database/proguard-rules.pro 0 → 100644
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
... ...
core/database/src/androidTest/java/com/cnlive/database/ExampleInstrumentedTest.java 0 → 100644
  1 +package com.cnlive.database;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import androidx.test.platform.app.InstrumentationRegistry;
  6 +import androidx.test.ext.junit.runners.AndroidJUnit4;
  7 +
  8 +import org.junit.Test;
  9 +import org.junit.runner.RunWith;
  10 +
  11 +import static org.junit.Assert.*;
  12 +
  13 +/**
  14 + * Instrumented test, which will execute on an Android device.
  15 + *
  16 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  17 + */
  18 +@RunWith(AndroidJUnit4.class)
  19 +public class ExampleInstrumentedTest {
  20 + @Test
  21 + public void useAppContext() {
  22 + // Context of the app under test.
  23 + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
  24 +
  25 + assertEquals("com.cnlive.database.test", appContext.getPackageName());
  26 + }
  27 +}
... ...
core/database/src/main/AndroidManifest.xml 0 → 100644
  1 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  2 + package="com.cnlive.database" />
... ...
core/database/src/main/java/com/cnlive/database/api/AudioDownAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +import android.os.Build;
  5 +import android.os.Environment;
  6 +
  7 +import com.alibaba.android.arouter.launcher.ARouter;
  8 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
  9 +import com.cnlive.database.bean.DownloadInfo;
  10 +import com.cnlive.database.dao.DownloadInfoDao;
  11 +import com.cnlive.database.dbUtil.DaoHelper;
  12 +
  13 +import java.io.File;
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * Created by hanyayun on 2019/05/13.
  18 + */
  19 +public class AudioDownAPI {
  20 +
  21 + /**
  22 + * 下载完成并且本地是存在
  23 + * @param activityId
  24 + * @param context
  25 + * @return
  26 + */
  27 + public static String isDown(String activityId, Context context){
  28 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  29 + String userId = service.getUid(context);
  30 + List<DownloadInfo> downloadInfos = DaoHelper.getInstance(context).getDownloadInfoDao().queryBuilder().where(DownloadInfoDao.Properties.UrlId.eq(activityId)).list();
  31 + if(downloadInfos != null && downloadInfos.size() > 0 && downloadInfos.get(0).getDownloadStatus() != null &&
  32 + downloadInfos.get(0).getDownloadStatus().equals("over") && new File((Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ?context.getExternalFilesDir(""):Environment.getExternalStorageDirectory()) + "/strike/voice/" + userId+"/"+downloadInfos.get(0).getFileName()).exists()) {
  33 + return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ?context.getExternalFilesDir(""):Environment.getExternalStorageDirectory().getAbsolutePath()) + "/strike/voice/" + userId+"/"+downloadInfos.get(0).getFileName();
  34 + }
  35 + return null;
  36 + }
  37 +}
... ...
core/database/src/main/java/com/cnlive/database/api/DBFriendCircleDetailAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +
  6 +import com.cnlive.database.bean.DBMomentDetail;
  7 +import com.cnlive.database.bean.DBMomentItem;
  8 +import com.cnlive.database.dao.DBMomentDetailDao;
  9 +import com.cnlive.database.dao.DBMomentItemDao;
  10 +import com.cnlive.database.dbUtil.DaoHelper;
  11 +
  12 +import org.greenrobot.greendao.query.WhereCondition;
  13 +
  14 +import java.util.List;
  15 +
  16 +
  17 +public class DBFriendCircleDetailAPI {
  18 + public static void insertData(Context context, List<DBMomentItem> dbMomentItems) {
  19 + if (dbMomentItems == null) return;
  20 + DaoHelper.getInstance(context).getDBMomentItemDao().insertInTx(dbMomentItems);
  21 + }
  22 +
  23 +
  24 + public static long insertData(Context context, DBMomentDetail momentDetail) {
  25 + if (momentDetail == null) return -1;
  26 + return DaoHelper.getInstance(context).getDBMomentDetailDao().insertOrReplace(momentDetail);
  27 + }
  28 +
  29 + public static void removeData(Context context, int type, String sid) {
  30 + WhereCondition sidWC = DBMomentDetailDao.Properties.Sid.eq(sid + "_" + type);
  31 + WhereCondition typeWC = DBMomentDetailDao.Properties.Type.eq(type);
  32 +
  33 + DBMomentItemDao itemDao = DaoHelper.getInstance(context).getDBMomentItemDao();
  34 + DBMomentDetailDao detailDao = DaoHelper.getInstance(context).getDBMomentDetailDao();
  35 +
  36 + DBMomentDetail oldData = detailDao.queryBuilder().where(sidWC, typeWC).unique();
  37 + if (oldData != null && oldData.getMomentItems() != null)
  38 + itemDao.deleteInTx(oldData.getMomentItems());
  39 + }
  40 +
  41 + public static DBMomentDetail loadData(Context context, int type, String sid) {
  42 + DBMomentDetailDao dao = DaoHelper.getInstance(context).getDBMomentDetailDao();
  43 + DBMomentDetail data = dao.queryBuilder()
  44 + .where(DBMomentDetailDao.Properties.Sid.eq(sid + "_" + type), DBMomentDetailDao.Properties.Type.eq(type))
  45 + .unique();
  46 +
  47 + return data != null ? data : new DBMomentDetail();
  48 + }
  49 +
  50 + public static void deleteMomentItem(Context context, String momentId) {
  51 + DBMomentItemDao dao = DaoHelper.getInstance(context).getDBMomentItemDao();
  52 + dao.deleteInTx(dao.queryBuilder().where(DBMomentItemDao.Properties.ItemId.eq(momentId)).list());
  53 + }
  54 +
  55 +}
... ...
core/database/src/main/java/com/cnlive/database/api/DBFriendCircleMessageAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.alibaba.android.arouter.launcher.ARouter;
  6 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
  7 +import com.cnlive.database.bean.DBFriendCircleMessage;
  8 +import com.cnlive.database.dao.DBFriendCircleMessageDao;
  9 +import com.cnlive.database.dbUtil.DaoHelper;
  10 +
  11 +import java.util.Collections;
  12 +import java.util.List;
  13 +
  14 +public class DBFriendCircleMessageAPI {
  15 +
  16 + /**
  17 + * 添加新消息至数据库
  18 + *
  19 + * @return
  20 + */
  21 + public static void insertData(Context context, List<DBFriendCircleMessage> items) {
  22 + if (items == null || items.size() == 0) return;
  23 + DBFriendCircleMessageDao dao = DaoHelper.getInstance(context).getFriendCircleMessageDao();
  24 + dao.insertOrReplaceInTx(items);
  25 + }
  26 +
  27 + /**
  28 + * 读取历史新消息
  29 + *
  30 + * @return
  31 + */
  32 + public static List<DBFriendCircleMessage> loadData(Context context) {
  33 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  34 + String sid = service.getUid(context);
  35 + DBFriendCircleMessageDao dao = DaoHelper.getInstance(context).getFriendCircleMessageDao();
  36 + List<DBFriendCircleMessage> list = dao.queryBuilder().where(DBFriendCircleMessageDao.Properties.Sid.eq(sid)).list();
  37 + Collections.reverse(list);
  38 + return list;
  39 + }
  40 +
  41 + /**
  42 + * 清空新消息数据
  43 + *
  44 + * @return
  45 + */
  46 + public static void cleanData(Context context) {
  47 + DBFriendCircleMessageDao dao = DaoHelper.getInstance(context).getFriendCircleMessageDao();
  48 + dao.deleteAll();
  49 + }
  50 +
  51 +}
... ...
core/database/src/main/java/com/cnlive/database/api/DBWitnessDetailAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.cnlive.database.bean.Witness;
  6 +import com.cnlive.database.dao.WitnessDao;
  7 +import com.cnlive.database.dbUtil.DaoHelper;
  8 +
  9 +import org.greenrobot.greendao.query.WhereCondition;
  10 +
  11 +import java.util.Collections;
  12 +import java.util.List;
  13 +
  14 +
  15 +public class DBWitnessDetailAPI {
  16 +
  17 +
  18 + public static long insertData(Context context, Witness momentDetail) {
  19 + if (momentDetail == null) return -1;
  20 + long insert = DaoHelper.getInstance(context).getWitnessDao().insert(momentDetail);
  21 + return insert;
  22 +
  23 + }
  24 +
  25 + public static void removeData(Context context, String id) {
  26 + WhereCondition mediasWC = WitnessDao.Properties.Id.eq(id);
  27 +
  28 + WitnessDao itemDao = DaoHelper.getInstance(context).getWitnessDao();
  29 +
  30 + Witness oldData = itemDao.queryBuilder().where(mediasWC).unique();
  31 + if (oldData != null)
  32 + itemDao.deleteInTx(oldData);
  33 + }
  34 +
  35 + public static List<Witness> loadData(Context context) {
  36 + WitnessDao dao = DaoHelper.getInstance(context).getWitnessDao();
  37 + List<Witness> list = dao.queryBuilder().list();
  38 + Collections.reverse(list);
  39 + return list;
  40 + }
  41 +
  42 +
  43 + public static void deleteWitnessItem(Context context, String time) {
  44 + WitnessDao dao = DaoHelper.getInstance(context).getWitnessDao();
  45 + dao.deleteInTx(dao.queryBuilder().where(WitnessDao.Properties.TimeStamp.eq(time)).unique());
  46 + }
  47 +
  48 +
  49 + public static void update(Context context, String time, Witness up) {
  50 + WitnessDao dao = DaoHelper.getInstance(context).getWitnessDao();
  51 + Witness load = dao.load(time);
  52 + load.setId(up.getId());
  53 + load.setSid(up.getSid());
  54 + load.setMedias(up.getMedias());
  55 + load.setTitle(up.getTitle());
  56 + load.setWit(up.getWit());
  57 + load.setType(up.getType());
  58 + load.setVideotype(up.getVideotype());
  59 + load.setGopath(up.getGopath());
  60 + load.setMultiplecategory(up.getMultiplecategory());
  61 + load.setTag(up.getTag());
  62 + load.setTimeStamp(time);
  63 + load.setDutation(up.getDutation());
  64 + load.setSrc(up.getSrc());
  65 + dao.updateInTx(load);
  66 + }
  67 +
  68 +}
... ...
core/database/src/main/java/com/cnlive/database/api/DarenDetailAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +import android.util.Log;
  5 +
  6 +import com.cnlive.database.bean.DarenDetailMsg;
  7 +import com.cnlive.database.dao.DarenDetailMsgDao;
  8 +import com.cnlive.database.dbUtil.DaoHelper;
  9 +
  10 +/**
  11 + * Created by Lynn on 2018/7/21.
  12 + */
  13 +
  14 +public class DarenDetailAPI {
  15 + /**
  16 + * 插入达人详情
  17 + */
  18 + public static long insertData(Context context, DarenDetailMsg data) {
  19 + if (data == null) return -1;
  20 + DarenDetailMsgDao dao = DaoHelper.getInstance(context).getDarenDetailDao();
  21 + removeItem(context, data.getSid(), data.getDarenId());
  22 + Log.e("LynnTest", "end : " + System.currentTimeMillis());
  23 + return dao.insertOrReplace(data);
  24 + }
  25 +
  26 + /**
  27 + * @param context
  28 + * @param sid
  29 + * @param darenId
  30 + * @return
  31 + */
  32 + public static DarenDetailMsg loadData(Context context, String sid, String darenId) {
  33 + DarenDetailMsgDao dao = DaoHelper.getInstance(context).getDarenDetailDao();
  34 + return dao.queryBuilder()
  35 + .where(DarenDetailMsgDao.Properties.DarenId.eq(darenId), DarenDetailMsgDao.Properties.Sid.eq(sid)).unique();
  36 + }
  37 +
  38 + public static void clean(Context context) {
  39 + DarenDetailMsgDao darenDetailMsgDao = DaoHelper.getInstance(context).getDarenDetailDao();
  40 + darenDetailMsgDao.deleteAll();
  41 + }
  42 +
  43 + public static void removeItem(Context context, String sid, String darenId) {
  44 + DarenDetailMsgDao darenDetailMsgDao = DaoHelper.getInstance(context).getDarenDetailDao();
  45 + DarenDetailMsg darenDetailMsg = loadData(context, sid, darenId);
  46 + if (darenDetailMsg != null) darenDetailMsgDao.delete(darenDetailMsg);
  47 + }
  48 +
  49 + /**
  50 + * 更新达人是否被关注
  51 + *
  52 + * @param context
  53 + * @param sid
  54 + * @param darenId
  55 + * @param fans
  56 + */
  57 + public static void updateDarenState(Context context, String sid, String darenId, boolean fans) {
  58 + Log.e("LynnTest", "start : " + System.currentTimeMillis());
  59 + DarenDetailMsg detailMsg = loadData(context, sid, darenId);
  60 + if (detailMsg == null)
  61 + return;
  62 + detailMsg.setFan(fans);
  63 + insertData(context, detailMsg);
  64 + }
  65 +}
... ...
core/database/src/main/java/com/cnlive/database/api/ExceptionInfoAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.cnlive.database.bean.ExceptionInfo;
  6 +import com.cnlive.database.dao.ExceptionInfoDao;
  7 +import com.cnlive.database.dbUtil.DaoHelper;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * Created by xiansong on 2017/12/22.
  13 + */
  14 +
  15 +public class ExceptionInfoAPI {
  16 +
  17 + /**
  18 + * 获取异常日志列表
  19 + *
  20 + * @param context
  21 + * @return
  22 + */
  23 + public static List<ExceptionInfo> getList(Context context, String userId) {
  24 + ExceptionInfoDao dao = DaoHelper.getInstance(context).getExceptionInfoDao();
  25 + return dao.loadAll();
  26 + }
  27 +
  28 + /**
  29 + * 插入异常日志
  30 + *
  31 + * @param context
  32 + * @param info
  33 + */
  34 + public static void insertItem(Context context, ExceptionInfo info) {
  35 + ExceptionInfoDao dao = DaoHelper.getInstance(context).getExceptionInfoDao();
  36 + dao.insert(info);
  37 + }
  38 +
  39 +}
... ...
core/database/src/main/java/com/cnlive/database/api/NewNumberApi.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.cnlive.database.bean.NewsNumber;
  6 +import com.cnlive.database.dao.NewsNumberDao;
  7 +import com.cnlive.database.dbUtil.DaoHelper;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * Created by Lynn on 2019/8/9.
  13 + */
  14 +public class NewNumberApi {
  15 + public static long insertData(Context context, NewsNumber newsNumber) {
  16 + if (newsNumber == null) {
  17 + return -1;
  18 + }
  19 +
  20 + NewsNumberDao dao = DaoHelper.getInstance(context).getNewsNumberDao();
  21 + if (loadData(context, newsNumber.getTs()) != null) {
  22 + return -1;
  23 + }
  24 + return dao.insertOrReplace(newsNumber);
  25 +
  26 + }
  27 +
  28 + public static List<NewsNumber> loadDatas(Context context, long ts, int limit, int pageNo) {
  29 + NewsNumberDao dao = DaoHelper.getInstance(context).getNewsNumberDao();
  30 + if (ts == -1) {
  31 + return dao.queryBuilder().orderDesc(NewsNumberDao.Properties.Ts).limit(limit).offset(pageNo * limit).list();
  32 + } else {
  33 + return dao.queryBuilder().orderDesc(NewsNumberDao.Properties.Ts).where(NewsNumberDao.Properties.Ts.lt(ts)).limit(limit).offset(pageNo * limit).list();
  34 + }
  35 + }
  36 +
  37 + public static long loadCount(Context context, long ts) {
  38 + NewsNumberDao dao = DaoHelper.getInstance(context).getNewsNumberDao();
  39 + if (ts == -1) {
  40 + return dao.queryBuilder().count();
  41 + }
  42 + return dao.queryBuilder().where(NewsNumberDao.Properties.Ts.le(ts)).count();
  43 + }
  44 +
  45 + public static NewsNumber loadData(Context context, String ts) {
  46 + NewsNumberDao dao = DaoHelper.getInstance(context).getNewsNumberDao();
  47 + return dao.queryBuilder().where(NewsNumberDao.Properties.Ts.eq(ts)).unique();
  48 + }
  49 +
  50 + /**
  51 + * 获取最新一条数据的时间戳
  52 + *
  53 + * @param userId
  54 + * @return
  55 + */
  56 + public static String loadNewestData(Context context, String userId) {
  57 + NewsNumberDao dao = DaoHelper.getInstance(context).getNewsNumberDao();
  58 + return dao.queryBuilder().orderDesc(NewsNumberDao.Properties.Ts).list().get(0).getTs();
  59 + }
  60 +}
... ...
core/database/src/main/java/com/cnlive/database/api/SearchContentAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.alibaba.android.arouter.launcher.ARouter;
  6 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
  7 +import com.cnlive.database.bean.SearchContent;
  8 +import com.cnlive.database.dao.SearchContentDao;
  9 +import com.cnlive.database.dbUtil.DaoHelper;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.Collections;
  13 +import java.util.List;
  14 +
  15 +
  16 +public class SearchContentAPI {
  17 +
  18 + public static boolean insertData(Context context, String history) {
  19 + SearchContentDao dao = DaoHelper.getInstance(context).getSearchContentDao();
  20 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  21 + String sid = service.getUid(context);
  22 + List<String> searchStrings = new ArrayList<>();
  23 + for (SearchContent item : loadData(context)) {
  24 + searchStrings.add(item.getContent());
  25 + }
  26 + SearchContent searchHistory = new SearchContent();
  27 + searchHistory.setContent(history);
  28 + searchHistory.setSid(sid);
  29 + if (!searchStrings.contains(history)) {
  30 + dao.insert(searchHistory);
  31 + return true;
  32 + } else {
  33 + dao.delete(dao.queryBuilder().where(SearchContentDao.Properties.Content.eq(history)).unique());
  34 + dao.insert(searchHistory);
  35 + }
  36 + return false;
  37 + }
  38 +
  39 +
  40 + public static List<SearchContent> loadData(Context context) {
  41 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  42 + String sid = service.getUid(context);
  43 + SearchContentDao dao = DaoHelper.getInstance(context).getSearchContentDao();
  44 + List<SearchContent> list = dao.queryBuilder().where(SearchContentDao.Properties.Sid.eq(sid)).list();
  45 + Collections.reverse(list);
  46 + return list;
  47 + }
  48 +
  49 +
  50 + public static void cleanData(Context context) {
  51 + SearchContentDao dao = DaoHelper.getInstance(context).getSearchContentDao();
  52 + dao.deleteAll();
  53 + }
  54 +}
... ...
core/database/src/main/java/com/cnlive/database/api/SearchHistoryAPI.java 0 → 100644
  1 +package com.cnlive.database.api;
  2 +
  3 +import android.content.Context;
  4 +
  5 +import com.alibaba.android.arouter.launcher.ARouter;
  6 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
  7 +import com.cnlive.database.bean.SearchHistory;
  8 +import com.cnlive.database.dao.SearchHistoryDao;
  9 +import com.cnlive.database.dbUtil.DaoHelper;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.Collections;
  13 +import java.util.List;
  14 +
  15 +/**
  16 + * Created by cnlive201803 on 2018/5/30.
  17 + */
  18 +
  19 +public class SearchHistoryAPI {
  20 + /**
  21 + * 插入搜索历史
  22 + *
  23 + * @param context
  24 + * @param history
  25 + */
  26 + public static boolean insertData(Context context, String history) {
  27 + SearchHistoryDao dao = DaoHelper.getInstance(context).getSearchHistoryDao();
  28 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  29 + String sid = service.getUid(context);
  30 + List<String> searchStrings = new ArrayList<>();
  31 + for (SearchHistory item : loadData(context)) {
  32 + searchStrings.add(item.getHistory());
  33 + }
  34 + SearchHistory searchHistory = new SearchHistory();
  35 + searchHistory.setHistory(history);
  36 + searchHistory.setSid(sid);
  37 + if (!searchStrings.contains(history)) {
  38 + dao.insert(searchHistory);
  39 + return true;
  40 + } else {
  41 + dao.delete(dao.queryBuilder().where(SearchHistoryDao.Properties.History.eq(history)).unique());
  42 + dao.insert(searchHistory);
  43 + }
  44 + return false;
  45 + }
  46 +
  47 + /**
  48 + * 读取搜索历史
  49 + *
  50 + * @param context
  51 + * @return
  52 + */
  53 + public static List<SearchHistory> loadData(Context context) {
  54 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  55 + String sid = service.getUid(context);
  56 + SearchHistoryDao dao = DaoHelper.getInstance(context).getSearchHistoryDao();
  57 + List<SearchHistory> list = dao.queryBuilder().where(SearchHistoryDao.Properties.Sid.eq(sid)).list();
  58 + Collections.reverse(list);
  59 + return list;
  60 + }
  61 +
  62 + /**
  63 + * 情况搜索历史
  64 + *
  65 + * @param context
  66 + */
  67 + public static void cleanData(Context context) {
  68 + SearchHistoryDao dao = DaoHelper.getInstance(context).getSearchHistoryDao();
  69 + dao.deleteAll();
  70 + }
  71 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/AudioPlayHistoricalRecord.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "AUDIO_PLAY_HISTORICAL_RECORD".
  14 + */
  15 +@Entity
  16 +public class AudioPlayHistoricalRecord {
  17 +
  18 + @Id
  19 + private long contentId;
  20 + private String activeId;
  21 + private String aid;
  22 + private Long time;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 40652824)
  28 + public AudioPlayHistoricalRecord() {
  29 + }
  30 +
  31 + public AudioPlayHistoricalRecord(long contentId) {
  32 + this.contentId = contentId;
  33 + }
  34 +
  35 + @Generated(hash = 2071813412)
  36 + public AudioPlayHistoricalRecord(long contentId, String activeId, String aid, Long time) {
  37 + this.contentId = contentId;
  38 + this.activeId = activeId;
  39 + this.aid = aid;
  40 + this.time = time;
  41 + }
  42 +
  43 + public long getContentId() {
  44 + return contentId;
  45 + }
  46 +
  47 + public void setContentId(long contentId) {
  48 + this.contentId = contentId;
  49 + }
  50 +
  51 + public String getActiveId() {
  52 + return activeId;
  53 + }
  54 +
  55 + public void setActiveId(String activeId) {
  56 + this.activeId = activeId;
  57 + }
  58 +
  59 + public String getAid() {
  60 + return aid;
  61 + }
  62 +
  63 + public void setAid(String aid) {
  64 + this.aid = aid;
  65 + }
  66 +
  67 + public Long getTime() {
  68 + return time;
  69 + }
  70 +
  71 + public void setTime(Long time) {
  72 + this.time = time;
  73 + }
  74 +
  75 + // KEEP METHODS - put your custom methods here
  76 + // KEEP METHODS END
  77 +
  78 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/AudioPlayLastInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "AUDIO_PLAY_LAST_INFO".
  15 + */
  16 +@Entity
  17 +public class AudioPlayLastInfo {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String sid;
  22 + private String activityId;
  23 + private String cmccId;
  24 + private String aid;
  25 + private String poster;
  26 + private String shareUrl;
  27 + private String contentId;
  28 + private String actor;
  29 + private String title;
  30 + private String channelName;
  31 + private String albumName;
  32 + private Double schedule;
  33 + private Integer counts;
  34 + private Boolean playState;
  35 + private String productId;
  36 + private String productType;
  37 + private String aProductId;
  38 + private String aProductType;
  39 + private Boolean isPayAlbum;
  40 + private Boolean isPayItem;
  41 + private String siteId;
  42 +
  43 + // KEEP FIELDS - put your custom fields here
  44 + // KEEP FIELDS END
  45 +
  46 + @Generated(hash = 1438086698)
  47 + public AudioPlayLastInfo() {
  48 + }
  49 +
  50 + public AudioPlayLastInfo(String sid) {
  51 + this.sid = sid;
  52 + }
  53 +
  54 + @Generated(hash = 927843729)
  55 + public AudioPlayLastInfo(@NotNull String sid, String activityId, String cmccId, String aid, String poster, String shareUrl, String contentId, String actor, String title, String channelName, String albumName, Double schedule, Integer counts, Boolean playState, String productId, String productType, String aProductId, String aProductType, Boolean isPayAlbum, Boolean isPayItem,
  56 + String siteId) {
  57 + this.sid = sid;
  58 + this.activityId = activityId;
  59 + this.cmccId = cmccId;
  60 + this.aid = aid;
  61 + this.poster = poster;
  62 + this.shareUrl = shareUrl;
  63 + this.contentId = contentId;
  64 + this.actor = actor;
  65 + this.title = title;
  66 + this.channelName = channelName;
  67 + this.albumName = albumName;
  68 + this.schedule = schedule;
  69 + this.counts = counts;
  70 + this.playState = playState;
  71 + this.productId = productId;
  72 + this.productType = productType;
  73 + this.aProductId = aProductId;
  74 + this.aProductType = aProductType;
  75 + this.isPayAlbum = isPayAlbum;
  76 + this.isPayItem = isPayItem;
  77 + this.siteId = siteId;
  78 + }
  79 +
  80 + @NotNull
  81 + public String getSid() {
  82 + return sid;
  83 + }
  84 +
  85 + /** Not-null value; ensure this value is available before it is saved to the database. */
  86 + public void setSid(@NotNull String sid) {
  87 + this.sid = sid;
  88 + }
  89 +
  90 + public String getActivityId() {
  91 + return activityId;
  92 + }
  93 +
  94 + public void setActivityId(String activityId) {
  95 + this.activityId = activityId;
  96 + }
  97 +
  98 + public String getCmccId() {
  99 + return cmccId;
  100 + }
  101 +
  102 + public void setCmccId(String cmccId) {
  103 + this.cmccId = cmccId;
  104 + }
  105 +
  106 + public String getAid() {
  107 + return aid;
  108 + }
  109 +
  110 + public void setAid(String aid) {
  111 + this.aid = aid;
  112 + }
  113 +
  114 + public String getPoster() {
  115 + return poster;
  116 + }
  117 +
  118 + public void setPoster(String poster) {
  119 + this.poster = poster;
  120 + }
  121 +
  122 + public String getShareUrl() {
  123 + return shareUrl;
  124 + }
  125 +
  126 + public void setShareUrl(String shareUrl) {
  127 + this.shareUrl = shareUrl;
  128 + }
  129 +
  130 + public String getContentId() {
  131 + return contentId;
  132 + }
  133 +
  134 + public void setContentId(String contentId) {
  135 + this.contentId = contentId;
  136 + }
  137 +
  138 + public String getActor() {
  139 + return actor;
  140 + }
  141 +
  142 + public void setActor(String actor) {
  143 + this.actor = actor;
  144 + }
  145 +
  146 + public String getTitle() {
  147 + return title;
  148 + }
  149 +
  150 + public void setTitle(String title) {
  151 + this.title = title;
  152 + }
  153 +
  154 + public String getChannelName() {
  155 + return channelName;
  156 + }
  157 +
  158 + public void setChannelName(String channelName) {
  159 + this.channelName = channelName;
  160 + }
  161 +
  162 + public String getAlbumName() {
  163 + return albumName;
  164 + }
  165 +
  166 + public void setAlbumName(String albumName) {
  167 + this.albumName = albumName;
  168 + }
  169 +
  170 + public Double getSchedule() {
  171 + return schedule;
  172 + }
  173 +
  174 + public void setSchedule(Double schedule) {
  175 + this.schedule = schedule;
  176 + }
  177 +
  178 + public Integer getCounts() {
  179 + return counts;
  180 + }
  181 +
  182 + public void setCounts(Integer counts) {
  183 + this.counts = counts;
  184 + }
  185 +
  186 + public Boolean getPlayState() {
  187 + return playState;
  188 + }
  189 +
  190 + public void setPlayState(Boolean playState) {
  191 + this.playState = playState;
  192 + }
  193 +
  194 + public String getProductId() {
  195 + return productId;
  196 + }
  197 +
  198 + public void setProductId(String productId) {
  199 + this.productId = productId;
  200 + }
  201 +
  202 + public String getProductType() {
  203 + return productType;
  204 + }
  205 +
  206 + public void setProductType(String productType) {
  207 + this.productType = productType;
  208 + }
  209 +
  210 + public String getAProductId() {
  211 + return aProductId;
  212 + }
  213 +
  214 + public void setAProductId(String aProductId) {
  215 + this.aProductId = aProductId;
  216 + }
  217 +
  218 + public String getAProductType() {
  219 + return aProductType;
  220 + }
  221 +
  222 + public void setAProductType(String aProductType) {
  223 + this.aProductType = aProductType;
  224 + }
  225 +
  226 + public Boolean getIsPayAlbum() {
  227 + return isPayAlbum;
  228 + }
  229 +
  230 + public void setIsPayAlbum(Boolean isPayAlbum) {
  231 + this.isPayAlbum = isPayAlbum;
  232 + }
  233 +
  234 + public Boolean getIsPayItem() {
  235 + return isPayItem;
  236 + }
  237 +
  238 + public void setIsPayItem(Boolean isPayItem) {
  239 + this.isPayItem = isPayItem;
  240 + }
  241 +
  242 + public String getSiteId() {
  243 + return siteId;
  244 + }
  245 +
  246 + public void setSiteId(String siteId) {
  247 + this.siteId = siteId;
  248 + }
  249 +
  250 + // KEEP METHODS - put your custom methods here
  251 + // KEEP METHODS END
  252 +
  253 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ChatFileMsg.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "CHAT_FILE_MSG".
  14 + */
  15 +@Entity
  16 +public class ChatFileMsg {
  17 +
  18 + @Id
  19 + private long msgUniqueId;
  20 + private String fromUserId;
  21 + private String fromUserNick;
  22 + private String filePath;
  23 + private String fileName;
  24 + private Long fileSize;
  25 + private Long msgTime;
  26 +
  27 + // KEEP FIELDS - put your custom fields here
  28 + // KEEP FIELDS END
  29 +
  30 + @Generated(hash = 948317961)
  31 + public ChatFileMsg() {
  32 + }
  33 +
  34 + public ChatFileMsg(long msgUniqueId) {
  35 + this.msgUniqueId = msgUniqueId;
  36 + }
  37 +
  38 + @Generated(hash = 623510594)
  39 + public ChatFileMsg(long msgUniqueId, String fromUserId, String fromUserNick, String filePath, String fileName, Long fileSize, Long msgTime) {
  40 + this.msgUniqueId = msgUniqueId;
  41 + this.fromUserId = fromUserId;
  42 + this.fromUserNick = fromUserNick;
  43 + this.filePath = filePath;
  44 + this.fileName = fileName;
  45 + this.fileSize = fileSize;
  46 + this.msgTime = msgTime;
  47 + }
  48 +
  49 + public long getMsgUniqueId() {
  50 + return msgUniqueId;
  51 + }
  52 +
  53 + public void setMsgUniqueId(long msgUniqueId) {
  54 + this.msgUniqueId = msgUniqueId;
  55 + }
  56 +
  57 + public String getFromUserId() {
  58 + return fromUserId;
  59 + }
  60 +
  61 + public void setFromUserId(String fromUserId) {
  62 + this.fromUserId = fromUserId;
  63 + }
  64 +
  65 + public String getFromUserNick() {
  66 + return fromUserNick;
  67 + }
  68 +
  69 + public void setFromUserNick(String fromUserNick) {
  70 + this.fromUserNick = fromUserNick;
  71 + }
  72 +
  73 + public String getFilePath() {
  74 + return filePath;
  75 + }
  76 +
  77 + public void setFilePath(String filePath) {
  78 + this.filePath = filePath;
  79 + }
  80 +
  81 + public String getFileName() {
  82 + return fileName;
  83 + }
  84 +
  85 + public void setFileName(String fileName) {
  86 + this.fileName = fileName;
  87 + }
  88 +
  89 + public Long getFileSize() {
  90 + return fileSize;
  91 + }
  92 +
  93 + public void setFileSize(Long fileSize) {
  94 + this.fileSize = fileSize;
  95 + }
  96 +
  97 + public Long getMsgTime() {
  98 + return msgTime;
  99 + }
  100 +
  101 + public void setMsgTime(Long msgTime) {
  102 + this.msgTime = msgTime;
  103 + }
  104 +
  105 + // KEEP METHODS - put your custom methods here
  106 + // KEEP METHODS END
  107 +
  108 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ChatImageAndVideoMsg.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "CHAT_IMAGE_AND_VIDEO_MSG".
  15 + */
  16 +@Entity
  17 +public class ChatImageAndVideoMsg {
  18 +
  19 + @NotNull
  20 + private String sid;
  21 + private String conversationType;
  22 +
  23 + @NotNull
  24 + private String targetId;
  25 + private String sendState;
  26 + private Long sendTime;
  27 +
  28 + @Id
  29 + @NotNull
  30 + private String msgUniqueId;
  31 + private String messageLocator;
  32 + private String msgType;
  33 + private Long serverTime;
  34 + private Boolean isNewMessage;
  35 +
  36 + // KEEP FIELDS - put your custom fields here
  37 + // KEEP FIELDS END
  38 +
  39 + @Generated(hash = 1744419488)
  40 + public ChatImageAndVideoMsg() {
  41 + }
  42 +
  43 + public ChatImageAndVideoMsg(String msgUniqueId) {
  44 + this.msgUniqueId = msgUniqueId;
  45 + }
  46 +
  47 + @Generated(hash = 1571121271)
  48 + public ChatImageAndVideoMsg(@NotNull String sid, String conversationType, @NotNull String targetId, String sendState, Long sendTime, @NotNull String msgUniqueId, String messageLocator, String msgType, Long serverTime,
  49 + Boolean isNewMessage) {
  50 + this.sid = sid;
  51 + this.conversationType = conversationType;
  52 + this.targetId = targetId;
  53 + this.sendState = sendState;
  54 + this.sendTime = sendTime;
  55 + this.msgUniqueId = msgUniqueId;
  56 + this.messageLocator = messageLocator;
  57 + this.msgType = msgType;
  58 + this.serverTime = serverTime;
  59 + this.isNewMessage = isNewMessage;
  60 + }
  61 +
  62 + @NotNull
  63 + public String getSid() {
  64 + return sid;
  65 + }
  66 +
  67 + /** Not-null value; ensure this value is available before it is saved to the database. */
  68 + public void setSid(@NotNull String sid) {
  69 + this.sid = sid;
  70 + }
  71 +
  72 + public String getConversationType() {
  73 + return conversationType;
  74 + }
  75 +
  76 + public void setConversationType(String conversationType) {
  77 + this.conversationType = conversationType;
  78 + }
  79 +
  80 + @NotNull
  81 + public String getTargetId() {
  82 + return targetId;
  83 + }
  84 +
  85 + /** Not-null value; ensure this value is available before it is saved to the database. */
  86 + public void setTargetId(@NotNull String targetId) {
  87 + this.targetId = targetId;
  88 + }
  89 +
  90 + public String getSendState() {
  91 + return sendState;
  92 + }
  93 +
  94 + public void setSendState(String sendState) {
  95 + this.sendState = sendState;
  96 + }
  97 +
  98 + public Long getSendTime() {
  99 + return sendTime;
  100 + }
  101 +
  102 + public void setSendTime(Long sendTime) {
  103 + this.sendTime = sendTime;
  104 + }
  105 +
  106 + @NotNull
  107 + public String getMsgUniqueId() {
  108 + return msgUniqueId;
  109 + }
  110 +
  111 + /** Not-null value; ensure this value is available before it is saved to the database. */
  112 + public void setMsgUniqueId(@NotNull String msgUniqueId) {
  113 + this.msgUniqueId = msgUniqueId;
  114 + }
  115 +
  116 + public String getMessageLocator() {
  117 + return messageLocator;
  118 + }
  119 +
  120 + public void setMessageLocator(String messageLocator) {
  121 + this.messageLocator = messageLocator;
  122 + }
  123 +
  124 + public String getMsgType() {
  125 + return msgType;
  126 + }
  127 +
  128 + public void setMsgType(String msgType) {
  129 + this.msgType = msgType;
  130 + }
  131 +
  132 + public Long getServerTime() {
  133 + return serverTime;
  134 + }
  135 +
  136 + public void setServerTime(Long serverTime) {
  137 + this.serverTime = serverTime;
  138 + }
  139 +
  140 + public Boolean getIsNewMessage() {
  141 + return isNewMessage;
  142 + }
  143 +
  144 + public void setIsNewMessage(Boolean isNewMessage) {
  145 + this.isNewMessage = isNewMessage;
  146 + }
  147 +
  148 + // KEEP METHODS - put your custom methods here
  149 + // KEEP METHODS END
  150 +
  151 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ChatMedia.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "CHAT_MEDIA".
  15 + */
  16 +@Entity
  17 +public class ChatMedia {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String cachePath;
  22 + private String conversationId;
  23 + private String mediaType;
  24 + private String thumbPath;
  25 + private String videoDur;
  26 + private Long cacheTime;
  27 +
  28 + // KEEP FIELDS - put your custom fields here
  29 + // KEEP FIELDS END
  30 +
  31 + @Generated(hash = 1634186503)
  32 + public ChatMedia() {
  33 + }
  34 +
  35 + public ChatMedia(String cachePath) {
  36 + this.cachePath = cachePath;
  37 + }
  38 +
  39 + @Generated(hash = 868735363)
  40 + public ChatMedia(@NotNull String cachePath, String conversationId, String mediaType, String thumbPath, String videoDur,
  41 + Long cacheTime) {
  42 + this.cachePath = cachePath;
  43 + this.conversationId = conversationId;
  44 + this.mediaType = mediaType;
  45 + this.thumbPath = thumbPath;
  46 + this.videoDur = videoDur;
  47 + this.cacheTime = cacheTime;
  48 + }
  49 +
  50 + @NotNull
  51 + public String getCachePath() {
  52 + return cachePath;
  53 + }
  54 +
  55 + /** Not-null value; ensure this value is available before it is saved to the database. */
  56 + public void setCachePath(@NotNull String cachePath) {
  57 + this.cachePath = cachePath;
  58 + }
  59 +
  60 + public String getConversationId() {
  61 + return conversationId;
  62 + }
  63 +
  64 + public void setConversationId(String conversationId) {
  65 + this.conversationId = conversationId;
  66 + }
  67 +
  68 + public String getMediaType() {
  69 + return mediaType;
  70 + }
  71 +
  72 + public void setMediaType(String mediaType) {
  73 + this.mediaType = mediaType;
  74 + }
  75 +
  76 + public String getThumbPath() {
  77 + return thumbPath;
  78 + }
  79 +
  80 + public void setThumbPath(String thumbPath) {
  81 + this.thumbPath = thumbPath;
  82 + }
  83 +
  84 + public String getVideoDur() {
  85 + return videoDur;
  86 + }
  87 +
  88 + public void setVideoDur(String videoDur) {
  89 + this.videoDur = videoDur;
  90 + }
  91 +
  92 + public Long getCacheTime() {
  93 + return cacheTime;
  94 + }
  95 +
  96 + public void setCacheTime(Long cacheTime) {
  97 + this.cacheTime = cacheTime;
  98 + }
  99 +
  100 + // KEEP METHODS - put your custom methods here
  101 + // KEEP METHODS END
  102 +
  103 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ContactList.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "CONTACT_LIST".
  15 + */
  16 +@Entity
  17 +public class ContactList {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String friendId;
  22 + private String friendFaceUrl;
  23 + private String friendNickName;
  24 + private String friendRemark;
  25 + private String friendCustomInfoJson;
  26 +
  27 + // KEEP FIELDS - put your custom fields here
  28 + // KEEP FIELDS END
  29 +
  30 + @Generated(hash = 218058078)
  31 + public ContactList() {
  32 + }
  33 +
  34 + public ContactList(String friendId) {
  35 + this.friendId = friendId;
  36 + }
  37 +
  38 + @Generated(hash = 998692329)
  39 + public ContactList(@NotNull String friendId, String friendFaceUrl, String friendNickName, String friendRemark,
  40 + String friendCustomInfoJson) {
  41 + this.friendId = friendId;
  42 + this.friendFaceUrl = friendFaceUrl;
  43 + this.friendNickName = friendNickName;
  44 + this.friendRemark = friendRemark;
  45 + this.friendCustomInfoJson = friendCustomInfoJson;
  46 + }
  47 +
  48 + @NotNull
  49 + public String getFriendId() {
  50 + return friendId;
  51 + }
  52 +
  53 + /** Not-null value; ensure this value is available before it is saved to the database. */
  54 + public void setFriendId(@NotNull String friendId) {
  55 + this.friendId = friendId;
  56 + }
  57 +
  58 + public String getFriendFaceUrl() {
  59 + return friendFaceUrl;
  60 + }
  61 +
  62 + public void setFriendFaceUrl(String friendFaceUrl) {
  63 + this.friendFaceUrl = friendFaceUrl;
  64 + }
  65 +
  66 + public String getFriendNickName() {
  67 + return friendNickName;
  68 + }
  69 +
  70 + public void setFriendNickName(String friendNickName) {
  71 + this.friendNickName = friendNickName;
  72 + }
  73 +
  74 + public String getFriendRemark() {
  75 + return friendRemark;
  76 + }
  77 +
  78 + public void setFriendRemark(String friendRemark) {
  79 + this.friendRemark = friendRemark;
  80 + }
  81 +
  82 + public String getFriendCustomInfoJson() {
  83 + return friendCustomInfoJson;
  84 + }
  85 +
  86 + public void setFriendCustomInfoJson(String friendCustomInfoJson) {
  87 + this.friendCustomInfoJson = friendCustomInfoJson;
  88 + }
  89 +
  90 + // KEEP METHODS - put your custom methods here
  91 + // KEEP METHODS END
  92 +
  93 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ContanctDaRenEntity.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "CONTANCT_DA_REN_ENTITY".
  14 + */
  15 +@Entity
  16 +public class ContanctDaRenEntity {
  17 +
  18 + @Id
  19 + private String uid;
  20 + private String cacheData;
  21 +
  22 + // KEEP FIELDS - put your custom fields here
  23 + // KEEP FIELDS END
  24 +
  25 + @Generated(hash = 1669209659)
  26 + public ContanctDaRenEntity() {
  27 + }
  28 +
  29 + public ContanctDaRenEntity(String uid) {
  30 + this.uid = uid;
  31 + }
  32 +
  33 + @Generated(hash = 2054202587)
  34 + public ContanctDaRenEntity(String uid, String cacheData) {
  35 + this.uid = uid;
  36 + this.cacheData = cacheData;
  37 + }
  38 +
  39 + public String getUid() {
  40 + return uid;
  41 + }
  42 +
  43 + public void setUid(String uid) {
  44 + this.uid = uid;
  45 + }
  46 +
  47 + public String getCacheData() {
  48 + return cacheData;
  49 + }
  50 +
  51 + public void setCacheData(String cacheData) {
  52 + this.cacheData = cacheData;
  53 + }
  54 +
  55 + // KEEP METHODS - put your custom methods here
  56 + // KEEP METHODS END
  57 +
  58 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ContanctGroupChatEntity.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "CONTANCT_GROUP_CHAT_ENTITY".
  14 + */
  15 +@Entity
  16 +public class ContanctGroupChatEntity {
  17 +
  18 + @Id
  19 + private String uid;
  20 + private String cacheGroupListData;
  21 + private String cacheRequestNetData;
  22 +
  23 + // KEEP FIELDS - put your custom fields here
  24 + // KEEP FIELDS END
  25 +
  26 + @Generated(hash = 1958547765)
  27 + public ContanctGroupChatEntity() {
  28 + }
  29 +
  30 + public ContanctGroupChatEntity(String uid) {
  31 + this.uid = uid;
  32 + }
  33 +
  34 + @Generated(hash = 823251597)
  35 + public ContanctGroupChatEntity(String uid, String cacheGroupListData, String cacheRequestNetData) {
  36 + this.uid = uid;
  37 + this.cacheGroupListData = cacheGroupListData;
  38 + this.cacheRequestNetData = cacheRequestNetData;
  39 + }
  40 +
  41 + public String getUid() {
  42 + return uid;
  43 + }
  44 +
  45 + public void setUid(String uid) {
  46 + this.uid = uid;
  47 + }
  48 +
  49 + public String getCacheGroupListData() {
  50 + return cacheGroupListData;
  51 + }
  52 +
  53 + public void setCacheGroupListData(String cacheGroupListData) {
  54 + this.cacheGroupListData = cacheGroupListData;
  55 + }
  56 +
  57 + public String getCacheRequestNetData() {
  58 + return cacheRequestNetData;
  59 + }
  60 +
  61 + public void setCacheRequestNetData(String cacheRequestNetData) {
  62 + this.cacheRequestNetData = cacheRequestNetData;
  63 + }
  64 +
  65 + // KEEP METHODS - put your custom methods here
  66 + // KEEP METHODS END
  67 +
  68 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DBFriendCircleMessage.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "DBFRIEND_CIRCLE_MESSAGE".
  15 + */
  16 +@Entity
  17 +public class DBFriendCircleMessage {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String time;
  22 + private String sid;
  23 + private String momentId;
  24 + private String userIcon;
  25 + private String userName;
  26 + private String message;
  27 + private String contentImage;
  28 + private String contentType;
  29 + private String contentTitle;
  30 +
  31 + // KEEP FIELDS - put your custom fields here
  32 + // KEEP FIELDS END
  33 +
  34 + @Generated(hash = 1504929696)
  35 + public DBFriendCircleMessage() {
  36 + }
  37 +
  38 + public DBFriendCircleMessage(String time) {
  39 + this.time = time;
  40 + }
  41 +
  42 + @Generated(hash = 64828352)
  43 + public DBFriendCircleMessage(@NotNull String time, String sid, String momentId, String userIcon, String userName, String message, String contentImage, String contentType,
  44 + String contentTitle) {
  45 + this.time = time;
  46 + this.sid = sid;
  47 + this.momentId = momentId;
  48 + this.userIcon = userIcon;
  49 + this.userName = userName;
  50 + this.message = message;
  51 + this.contentImage = contentImage;
  52 + this.contentType = contentType;
  53 + this.contentTitle = contentTitle;
  54 + }
  55 +
  56 + @NotNull
  57 + public String getTime() {
  58 + return time;
  59 + }
  60 +
  61 + /** Not-null value; ensure this value is available before it is saved to the database. */
  62 + public void setTime(@NotNull String time) {
  63 + this.time = time;
  64 + }
  65 +
  66 + public String getSid() {
  67 + return sid;
  68 + }
  69 +
  70 + public void setSid(String sid) {
  71 + this.sid = sid;
  72 + }
  73 +
  74 + public String getMomentId() {
  75 + return momentId;
  76 + }
  77 +
  78 + public void setMomentId(String momentId) {
  79 + this.momentId = momentId;
  80 + }
  81 +
  82 + public String getUserIcon() {
  83 + return userIcon;
  84 + }
  85 +
  86 + public void setUserIcon(String userIcon) {
  87 + this.userIcon = userIcon;
  88 + }
  89 +
  90 + public String getUserName() {
  91 + return userName;
  92 + }
  93 +
  94 + public void setUserName(String userName) {
  95 + this.userName = userName;
  96 + }
  97 +
  98 + public String getMessage() {
  99 + return message;
  100 + }
  101 +
  102 + public void setMessage(String message) {
  103 + this.message = message;
  104 + }
  105 +
  106 + public String getContentImage() {
  107 + return contentImage;
  108 + }
  109 +
  110 + public void setContentImage(String contentImage) {
  111 + this.contentImage = contentImage;
  112 + }
  113 +
  114 + public String getContentType() {
  115 + return contentType;
  116 + }
  117 +
  118 + public void setContentType(String contentType) {
  119 + this.contentType = contentType;
  120 + }
  121 +
  122 + public String getContentTitle() {
  123 + return contentTitle;
  124 + }
  125 +
  126 + public void setContentTitle(String contentTitle) {
  127 + this.contentTitle = contentTitle;
  128 + }
  129 +
  130 + // KEEP METHODS - put your custom methods here
  131 + // KEEP METHODS END
  132 +
  133 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DBMomentDetail.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +
  4 +import com.cnlive.database.dao.DaoSession;
  5 +
  6 +import org.greenrobot.greendao.DaoException;
  7 +import org.greenrobot.greendao.annotation.Entity;
  8 +import org.greenrobot.greendao.annotation.Generated;
  9 +import org.greenrobot.greendao.annotation.Id;
  10 +import org.greenrobot.greendao.annotation.JoinProperty;
  11 +import org.greenrobot.greendao.annotation.NotNull;
  12 +import org.greenrobot.greendao.annotation.ToMany;
  13 +
  14 +import java.util.List;
  15 +import com.cnlive.database.dao.DBMomentItemDao;
  16 +import com.cnlive.database.dao.DBMomentDetailDao;
  17 +
  18 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  19 +
  20 +// KEEP INCLUDES - put your custom includes here
  21 +// KEEP INCLUDES END
  22 +
  23 +/**
  24 + * Entity mapped to table "DBMOMENT_DETAIL".
  25 + */
  26 +@Entity(active = true)
  27 +public class DBMomentDetail {
  28 +
  29 + @Id
  30 + private String sid;
  31 + private int type;
  32 +
  33 + @NotNull
  34 + private String userIcon;
  35 +
  36 + @NotNull
  37 + private String userName;
  38 +
  39 + @NotNull
  40 + private String signature;
  41 +
  42 + /** Used to resolve relations */
  43 + @Generated(hash = 2040040024)
  44 + private transient DaoSession daoSession;
  45 + /** Used for active entity operations. */
  46 + @Generated(hash = 1017905756)
  47 + private transient DBMomentDetailDao myDao;
  48 + @ToMany(joinProperties = {
  49 + @JoinProperty(name = "sid", referencedName = "sid")
  50 + })
  51 + private List<DBMomentItem> momentItems;
  52 +
  53 + // KEEP FIELDS - put your custom fields here
  54 + // KEEP FIELDS END
  55 +
  56 + @Generated(hash = 1385898938)
  57 + public DBMomentDetail() {
  58 + }
  59 +
  60 + public DBMomentDetail(String sid) {
  61 + this.sid = sid;
  62 + }
  63 +
  64 + @Generated(hash = 1620964741)
  65 + public DBMomentDetail(String sid, int type, @NotNull String userIcon, @NotNull String userName, @NotNull String signature) {
  66 + this.sid = sid;
  67 + this.type = type;
  68 + this.userIcon = userIcon;
  69 + this.userName = userName;
  70 + this.signature = signature;
  71 + }
  72 +
  73 + /** called by internal mechanisms, do not call yourself. */
  74 + @Generated(hash = 1813724927)
  75 + public void __setDaoSession(DaoSession daoSession) {
  76 + this.daoSession = daoSession;
  77 + myDao = daoSession != null ? daoSession.getDBMomentDetailDao() : null;
  78 + }
  79 +
  80 + public String getSid() {
  81 + return sid;
  82 + }
  83 +
  84 + public void setSid(String sid) {
  85 + this.sid = sid;
  86 + }
  87 +
  88 + public int getType() {
  89 + return type;
  90 + }
  91 +
  92 + public void setType(int type) {
  93 + this.type = type;
  94 + }
  95 +
  96 + @NotNull
  97 + public String getUserIcon() {
  98 + return userIcon;
  99 + }
  100 +
  101 + /** Not-null value; ensure this value is available before it is saved to the database. */
  102 + public void setUserIcon(@NotNull String userIcon) {
  103 + this.userIcon = userIcon;
  104 + }
  105 +
  106 + @NotNull
  107 + public String getUserName() {
  108 + return userName;
  109 + }
  110 +
  111 + /** Not-null value; ensure this value is available before it is saved to the database. */
  112 + public void setUserName(@NotNull String userName) {
  113 + this.userName = userName;
  114 + }
  115 +
  116 + @NotNull
  117 + public String getSignature() {
  118 + return signature;
  119 + }
  120 +
  121 + /** Not-null value; ensure this value is available before it is saved to the database. */
  122 + public void setSignature(@NotNull String signature) {
  123 + this.signature = signature;
  124 + }
  125 +
  126 + /**
  127 + * To-many relationship, resolved on first access (and after reset).
  128 + * Changes to to-many relations are not persisted, make changes to the target entity.
  129 + */
  130 + @Generated(hash = 842034949)
  131 + public List<DBMomentItem> getMomentItems() {
  132 + if (momentItems == null) {
  133 + final DaoSession daoSession = this.daoSession;
  134 + if (daoSession == null) {
  135 + throw new DaoException("Entity is detached from DAO context");
  136 + }
  137 + DBMomentItemDao targetDao = daoSession.getDBMomentItemDao();
  138 + List<DBMomentItem> momentItemsNew = targetDao._queryDBMomentDetail_MomentItems(sid);
  139 + synchronized (this) {
  140 + if (momentItems == null) {
  141 + momentItems = momentItemsNew;
  142 + }
  143 + }
  144 + }
  145 + return momentItems;
  146 + }
  147 +
  148 + /** Resets a to-many relationship, making the next get call to query for a fresh result. */
  149 + @Generated(hash = 2004767669)
  150 + public synchronized void resetMomentItems() {
  151 + momentItems = null;
  152 + }
  153 +
  154 + /**
  155 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
  156 + * Entity must attached to an entity context.
  157 + */
  158 + @Generated(hash = 128553479)
  159 + public void delete() {
  160 + if (myDao == null) {
  161 + throw new DaoException("Entity is detached from DAO context");
  162 + }
  163 + myDao.delete(this);
  164 + }
  165 +
  166 + /**
  167 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
  168 + * Entity must attached to an entity context.
  169 + */
  170 + @Generated(hash = 713229351)
  171 + public void update() {
  172 + if (myDao == null) {
  173 + throw new DaoException("Entity is detached from DAO context");
  174 + }
  175 + myDao.update(this);
  176 + }
  177 +
  178 + /**
  179 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
  180 + * Entity must attached to an entity context.
  181 + */
  182 + @Generated(hash = 1942392019)
  183 + public void refresh() {
  184 + if (myDao == null) {
  185 + throw new DaoException("Entity is detached from DAO context");
  186 + }
  187 + myDao.refresh(this);
  188 + }
  189 +
  190 + // KEEP METHODS - put your custom methods here
  191 + // KEEP METHODS END
  192 +
  193 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DBMomentItem.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +
  4 +import com.cnlive.database.dao.DaoSession;
  5 +
  6 +import org.greenrobot.greendao.DaoException;
  7 +import org.greenrobot.greendao.annotation.Entity;
  8 +import org.greenrobot.greendao.annotation.Generated;
  9 +import org.greenrobot.greendao.annotation.Id;
  10 +import org.greenrobot.greendao.annotation.NotNull;
  11 +import org.greenrobot.greendao.annotation.ToOne;
  12 +import com.cnlive.database.dao.DBMomentDetailDao;
  13 +import com.cnlive.database.dao.DBMomentItemDao;
  14 +
  15 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
  16 +
  17 +/**
  18 + * Entity mapped to table "DBMOMENT_ITEM".
  19 + */
  20 +@Entity(active = true)
  21 +public class DBMomentItem {
  22 +
  23 + @Id
  24 + private String id;
  25 + private String itemId;
  26 +
  27 + @NotNull
  28 + private String momentItemDetail;
  29 + private String sid;
  30 +
  31 + /** Used to resolve relations */
  32 + @Generated(hash = 2040040024)
  33 + private transient DaoSession daoSession;
  34 + /** Used for active entity operations. */
  35 + @Generated(hash = 1682324949)
  36 + private transient DBMomentItemDao myDao;
  37 + @ToOne(joinProperty = "sid")
  38 + private DBMomentDetail dBMomentDetail;
  39 +
  40 + @Generated(hash = 1023063607)
  41 + private transient String dBMomentDetail__resolvedKey;
  42 +
  43 + @Generated(hash = 1283454445)
  44 + public DBMomentItem() {
  45 + }
  46 +
  47 + public DBMomentItem(String id) {
  48 + this.id = id;
  49 + }
  50 +
  51 + @Generated(hash = 821818299)
  52 + public DBMomentItem(String id, String itemId, @NotNull String momentItemDetail, String sid) {
  53 + this.id = id;
  54 + this.itemId = itemId;
  55 + this.momentItemDetail = momentItemDetail;
  56 + this.sid = sid;
  57 + }
  58 +
  59 + /** called by internal mechanisms, do not call yourself. */
  60 + @Generated(hash = 1118667076)
  61 + public void __setDaoSession(DaoSession daoSession) {
  62 + this.daoSession = daoSession;
  63 + myDao = daoSession != null ? daoSession.getDBMomentItemDao() : null;
  64 + }
  65 +
  66 + public String getId() {
  67 + return id;
  68 + }
  69 +
  70 + public void setId(String id) {
  71 + this.id = id;
  72 + }
  73 +
  74 + public String getItemId() {
  75 + return itemId;
  76 + }
  77 +
  78 + public void setItemId(String itemId) {
  79 + this.itemId = itemId;
  80 + }
  81 +
  82 + @NotNull
  83 + public String getMomentItemDetail() {
  84 + return momentItemDetail;
  85 + }
  86 +
  87 + /** Not-null value; ensure this value is available before it is saved to the database. */
  88 + public void setMomentItemDetail(@NotNull String momentItemDetail) {
  89 + this.momentItemDetail = momentItemDetail;
  90 + }
  91 +
  92 + public String getSid() {
  93 + return sid;
  94 + }
  95 +
  96 + public void setSid(String sid) {
  97 + this.sid = sid;
  98 + }
  99 +
  100 + /** To-one relationship, resolved on first access. */
  101 + @Generated(hash = 159643884)
  102 + public DBMomentDetail getDBMomentDetail() {
  103 + String __key = this.sid;
  104 + if (dBMomentDetail__resolvedKey == null || dBMomentDetail__resolvedKey != __key) {
  105 + final DaoSession daoSession = this.daoSession;
  106 + if (daoSession == null) {
  107 + throw new DaoException("Entity is detached from DAO context");
  108 + }
  109 + DBMomentDetailDao targetDao = daoSession.getDBMomentDetailDao();
  110 + DBMomentDetail dBMomentDetailNew = targetDao.load(__key);
  111 + synchronized (this) {
  112 + dBMomentDetail = dBMomentDetailNew;
  113 + dBMomentDetail__resolvedKey = __key;
  114 + }
  115 + }
  116 + return dBMomentDetail;
  117 + }
  118 +
  119 + /** called by internal mechanisms, do not call yourself. */
  120 + @Generated(hash = 495632760)
  121 + public void setDBMomentDetail(DBMomentDetail dBMomentDetail) {
  122 + synchronized (this) {
  123 + this.dBMomentDetail = dBMomentDetail;
  124 + sid = dBMomentDetail == null ? null : dBMomentDetail.getSid();
  125 + dBMomentDetail__resolvedKey = sid;
  126 + }
  127 + }
  128 +
  129 + /**
  130 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
  131 + * Entity must attached to an entity context.
  132 + */
  133 + @Generated(hash = 128553479)
  134 + public void delete() {
  135 + if (myDao == null) {
  136 + throw new DaoException("Entity is detached from DAO context");
  137 + }
  138 + myDao.delete(this);
  139 + }
  140 +
  141 + /**
  142 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
  143 + * Entity must attached to an entity context.
  144 + */
  145 + @Generated(hash = 713229351)
  146 + public void update() {
  147 + if (myDao == null) {
  148 + throw new DaoException("Entity is detached from DAO context");
  149 + }
  150 + myDao.update(this);
  151 + }
  152 +
  153 + /**
  154 + * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
  155 + * Entity must attached to an entity context.
  156 + */
  157 + @Generated(hash = 1942392019)
  158 + public void refresh() {
  159 + if (myDao == null) {
  160 + throw new DaoException("Entity is detached from DAO context");
  161 + }
  162 + myDao.refresh(this);
  163 + }
  164 +
  165 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DarenDetailMsg.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "DAREN_DETAIL_MSG".
  14 + */
  15 +@Entity
  16 +public class DarenDetailMsg {
  17 +
  18 + @Id
  19 + private String darenId;
  20 + private String image;
  21 + private String custSign;
  22 + private String fansNum;
  23 + private Boolean fan;
  24 + private String sid;
  25 + private String address;
  26 + private String shopName;
  27 + private Float grade;
  28 + private Boolean online;
  29 + private String orderCount;
  30 + private String commentCount;
  31 + private String propagandas;
  32 + private String content;
  33 + private String category;
  34 +
  35 + // KEEP FIELDS - put your custom fields here
  36 + // KEEP FIELDS END
  37 +
  38 + @Generated(hash = 1523727014)
  39 + public DarenDetailMsg() {
  40 + }
  41 +
  42 + public DarenDetailMsg(String darenId) {
  43 + this.darenId = darenId;
  44 + }
  45 +
  46 + @Generated(hash = 708127880)
  47 + public DarenDetailMsg(String darenId, String image, String custSign, String fansNum, Boolean fan, String sid, String address, String shopName, Float grade, Boolean online, String orderCount, String commentCount, String propagandas, String content, String category) {
  48 + this.darenId = darenId;
  49 + this.image = image;
  50 + this.custSign = custSign;
  51 + this.fansNum = fansNum;
  52 + this.fan = fan;
  53 + this.sid = sid;
  54 + this.address = address;
  55 + this.shopName = shopName;
  56 + this.grade = grade;
  57 + this.online = online;
  58 + this.orderCount = orderCount;
  59 + this.commentCount = commentCount;
  60 + this.propagandas = propagandas;
  61 + this.content = content;
  62 + this.category = category;
  63 + }
  64 +
  65 + public String getDarenId() {
  66 + return darenId;
  67 + }
  68 +
  69 + public void setDarenId(String darenId) {
  70 + this.darenId = darenId;
  71 + }
  72 +
  73 + public String getImage() {
  74 + return image;
  75 + }
  76 +
  77 + public void setImage(String image) {
  78 + this.image = image;
  79 + }
  80 +
  81 + public String getCustSign() {
  82 + return custSign;
  83 + }
  84 +
  85 + public void setCustSign(String custSign) {
  86 + this.custSign = custSign;
  87 + }
  88 +
  89 + public String getFansNum() {
  90 + return fansNum;
  91 + }
  92 +
  93 + public void setFansNum(String fansNum) {
  94 + this.fansNum = fansNum;
  95 + }
  96 +
  97 + public Boolean getFan() {
  98 + return fan;
  99 + }
  100 +
  101 + public void setFan(Boolean fan) {
  102 + this.fan = fan;
  103 + }
  104 +
  105 + public String getSid() {
  106 + return sid;
  107 + }
  108 +
  109 + public void setSid(String sid) {
  110 + this.sid = sid;
  111 + }
  112 +
  113 + public String getAddress() {
  114 + return address;
  115 + }
  116 +
  117 + public void setAddress(String address) {
  118 + this.address = address;
  119 + }
  120 +
  121 + public String getShopName() {
  122 + return shopName;
  123 + }
  124 +
  125 + public void setShopName(String shopName) {
  126 + this.shopName = shopName;
  127 + }
  128 +
  129 + public Float getGrade() {
  130 + return grade;
  131 + }
  132 +
  133 + public void setGrade(Float grade) {
  134 + this.grade = grade;
  135 + }
  136 +
  137 + public Boolean getOnline() {
  138 + return online;
  139 + }
  140 +
  141 + public void setOnline(Boolean online) {
  142 + this.online = online;
  143 + }
  144 +
  145 + public String getOrderCount() {
  146 + return orderCount;
  147 + }
  148 +
  149 + public void setOrderCount(String orderCount) {
  150 + this.orderCount = orderCount;
  151 + }
  152 +
  153 + public String getCommentCount() {
  154 + return commentCount;
  155 + }
  156 +
  157 + public void setCommentCount(String commentCount) {
  158 + this.commentCount = commentCount;
  159 + }
  160 +
  161 + public String getPropagandas() {
  162 + return propagandas;
  163 + }
  164 +
  165 + public void setPropagandas(String propagandas) {
  166 + this.propagandas = propagandas;
  167 + }
  168 +
  169 + public String getContent() {
  170 + return content;
  171 + }
  172 +
  173 + public void setContent(String content) {
  174 + this.content = content;
  175 + }
  176 +
  177 + public String getCategory() {
  178 + return category;
  179 + }
  180 +
  181 + public void setCategory(String category) {
  182 + this.category = category;
  183 + }
  184 +
  185 + // KEEP METHODS - put your custom methods here
  186 + // KEEP METHODS END
  187 +
  188 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DarenListMsg.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "DAREN_LIST_MSG".
  15 + */
  16 +@Entity
  17 +public class DarenListMsg {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String sid;
  22 + private String darenList;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 1764232799)
  28 + public DarenListMsg() {
  29 + }
  30 +
  31 + public DarenListMsg(String sid) {
  32 + this.sid = sid;
  33 + }
  34 +
  35 + @Generated(hash = 619713886)
  36 + public DarenListMsg(@NotNull String sid, String darenList) {
  37 + this.sid = sid;
  38 + this.darenList = darenList;
  39 + }
  40 +
  41 + @NotNull
  42 + public String getSid() {
  43 + return sid;
  44 + }
  45 +
  46 + /** Not-null value; ensure this value is available before it is saved to the database. */
  47 + public void setSid(@NotNull String sid) {
  48 + this.sid = sid;
  49 + }
  50 +
  51 + public String getDarenList() {
  52 + return darenList;
  53 + }
  54 +
  55 + public void setDarenList(String darenList) {
  56 + this.darenList = darenList;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DownloadInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +
  9 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  10 +
  11 +// KEEP INCLUDES - put your custom includes here
  12 +// KEEP INCLUDES END
  13 +
  14 +/**
  15 + * Entity mapped to table "DOWNLOAD_INFO".
  16 + */
  17 +@Entity
  18 +public class DownloadInfo{
  19 +
  20 + @Id
  21 + @NotNull
  22 + private String urlId;
  23 + private String url;
  24 + private String downloadStatus;
  25 + private String fileName;
  26 + private Long total;
  27 + private Long progress;
  28 + private String albumId;
  29 + private String contentId;
  30 + private String cmccId;
  31 + private String shareUrl;
  32 + private String albumImg;
  33 + private String actor;
  34 + private String albumName;
  35 + private Double schedule;
  36 + private String channelName;
  37 + private String fileSize;
  38 + private Integer counts;
  39 +
  40 + // KEEP FIELDS - put your custom fields here
  41 + // KEEP FIELDS END
  42 +
  43 + @Generated(hash = 327086747)
  44 + public DownloadInfo() {
  45 + }
  46 +
  47 + public DownloadInfo(String urlId) {
  48 + this.urlId = urlId;
  49 + }
  50 +
  51 + @Generated(hash = 986395589)
  52 + public DownloadInfo(@NotNull String urlId, String url, String downloadStatus, String fileName, Long total, Long progress, String albumId, String contentId, String cmccId, String shareUrl, String albumImg, String actor, String albumName, Double schedule, String channelName, String fileSize,
  53 + Integer counts) {
  54 + this.urlId = urlId;
  55 + this.url = url;
  56 + this.downloadStatus = downloadStatus;
  57 + this.fileName = fileName;
  58 + this.total = total;
  59 + this.progress = progress;
  60 + this.albumId = albumId;
  61 + this.contentId = contentId;
  62 + this.cmccId = cmccId;
  63 + this.shareUrl = shareUrl;
  64 + this.albumImg = albumImg;
  65 + this.actor = actor;
  66 + this.albumName = albumName;
  67 + this.schedule = schedule;
  68 + this.channelName = channelName;
  69 + this.fileSize = fileSize;
  70 + this.counts = counts;
  71 + }
  72 +
  73 + @NotNull
  74 + public String getUrlId() {
  75 + return urlId;
  76 + }
  77 +
  78 + /** Not-null value; ensure this value is available before it is saved to the database. */
  79 + public void setUrlId(@NotNull String urlId) {
  80 + this.urlId = urlId;
  81 + }
  82 +
  83 + public String getUrl() {
  84 + return url;
  85 + }
  86 +
  87 + public void setUrl(String url) {
  88 + this.url = url;
  89 + }
  90 +
  91 + public String getDownloadStatus() {
  92 + return downloadStatus;
  93 + }
  94 +
  95 + public void setDownloadStatus(String downloadStatus) {
  96 + this.downloadStatus = downloadStatus;
  97 + }
  98 +
  99 + public String getFileName() {
  100 + return fileName;
  101 + }
  102 +
  103 + public void setFileName(String fileName) {
  104 + this.fileName = fileName;
  105 + }
  106 +
  107 + public Long getTotal() {
  108 + return total;
  109 + }
  110 +
  111 + public void setTotal(Long total) {
  112 + this.total = total;
  113 + }
  114 +
  115 + public Long getProgress() {
  116 + return progress;
  117 + }
  118 +
  119 + public void setProgress(Long progress) {
  120 + this.progress = progress;
  121 + }
  122 +
  123 + public String getAlbumId() {
  124 + return albumId;
  125 + }
  126 +
  127 + public void setAlbumId(String albumId) {
  128 + this.albumId = albumId;
  129 + }
  130 +
  131 + public String getContentId() {
  132 + return contentId;
  133 + }
  134 +
  135 + public void setContentId(String contentId) {
  136 + this.contentId = contentId;
  137 + }
  138 +
  139 + public String getCmccId() {
  140 + return cmccId;
  141 + }
  142 +
  143 + public void setCmccId(String cmccId) {
  144 + this.cmccId = cmccId;
  145 + }
  146 +
  147 + public String getShareUrl() {
  148 + return shareUrl;
  149 + }
  150 +
  151 + public void setShareUrl(String shareUrl) {
  152 + this.shareUrl = shareUrl;
  153 + }
  154 +
  155 + public String getAlbumImg() {
  156 + return albumImg;
  157 + }
  158 +
  159 + public void setAlbumImg(String albumImg) {
  160 + this.albumImg = albumImg;
  161 + }
  162 +
  163 + public String getActor() {
  164 + return actor;
  165 + }
  166 +
  167 + public void setActor(String actor) {
  168 + this.actor = actor;
  169 + }
  170 +
  171 + public String getAlbumName() {
  172 + return albumName;
  173 + }
  174 +
  175 + public void setAlbumName(String albumName) {
  176 + this.albumName = albumName;
  177 + }
  178 +
  179 + public Double getSchedule() {
  180 + return schedule;
  181 + }
  182 +
  183 + public void setSchedule(Double schedule) {
  184 + this.schedule = schedule;
  185 + }
  186 +
  187 + public String getChannelName() {
  188 + return channelName;
  189 + }
  190 +
  191 + public void setChannelName(String channelName) {
  192 + this.channelName = channelName;
  193 + }
  194 +
  195 + public String getFileSize() {
  196 + return fileSize;
  197 + }
  198 +
  199 + public void setFileSize(String fileSize) {
  200 + this.fileSize = fileSize;
  201 + }
  202 +
  203 + public Integer getCounts() {
  204 + return counts;
  205 + }
  206 +
  207 + public void setCounts(Integer counts) {
  208 + this.counts = counts;
  209 + }
  210 +
  211 + // KEEP METHODS - put your custom methods here
  212 + // KEEP METHODS END
  213 +
  214 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/DownloadNewInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * created by hanyayun
  7 + * on 2020/1/2
  8 + */
  9 +public class DownloadNewInfo implements Serializable {
  10 +
  11 + private String urlId;
  12 + private String url;
  13 + private String downloadStatus;
  14 + private String fileName;
  15 + private Long total;
  16 + private Long progress;
  17 + private String albumId;
  18 + private String contentId;
  19 + private String cmccId;
  20 + private String shareUrl;
  21 + private String albumImg;
  22 + private String actor;
  23 + private String albumName;
  24 + private Double schedule;
  25 + private String channelName;
  26 + private String fileSize;
  27 + private Integer counts;
  28 +
  29 +
  30 + public DownloadNewInfo(String urlId, String url, String downloadStatus, String fileName, Long total, Long progress, String albumId, String contentId, String cmccId, String shareUrl, String albumImg, String actor, String albumName, Double schedule, String channelName, String fileSize, Integer counts) {
  31 + this.urlId = urlId;
  32 + this.url = url;
  33 + this.downloadStatus = downloadStatus;
  34 + this.fileName = fileName;
  35 + this.total = total;
  36 + this.progress = progress;
  37 + this.albumId = albumId;
  38 + this.contentId = contentId;
  39 + this.cmccId = cmccId;
  40 + this.shareUrl = shareUrl;
  41 + this.albumImg = albumImg;
  42 + this.actor = actor;
  43 + this.albumName = albumName;
  44 + this.schedule = schedule;
  45 + this.channelName = channelName;
  46 + this.fileSize = fileSize;
  47 + this.counts = counts;
  48 + }
  49 +
  50 + public String getUrlId() {
  51 + return urlId;
  52 + }
  53 +
  54 + /** Not-null value; ensure this value is available before it is saved to the database. */
  55 + public void setUrlId(String urlId) {
  56 + this.urlId = urlId;
  57 + }
  58 +
  59 + public String getUrl() {
  60 + return url;
  61 + }
  62 +
  63 + public void setUrl(String url) {
  64 + this.url = url;
  65 + }
  66 +
  67 + public String getDownloadStatus() {
  68 + return downloadStatus;
  69 + }
  70 +
  71 + public void setDownloadStatus(String downloadStatus) {
  72 + this.downloadStatus = downloadStatus;
  73 + }
  74 +
  75 + public String getFileName() {
  76 + return fileName;
  77 + }
  78 +
  79 + public void setFileName(String fileName) {
  80 + this.fileName = fileName;
  81 + }
  82 +
  83 + public Long getTotal() {
  84 + return total;
  85 + }
  86 +
  87 + public void setTotal(Long total) {
  88 + this.total = total;
  89 + }
  90 +
  91 + public Long getProgress() {
  92 + return progress;
  93 + }
  94 +
  95 + public void setProgress(Long progress) {
  96 + this.progress = progress;
  97 + }
  98 +
  99 + public String getAlbumId() {
  100 + return albumId;
  101 + }
  102 +
  103 + public void setAlbumId(String albumId) {
  104 + this.albumId = albumId;
  105 + }
  106 +
  107 + public String getContentId() {
  108 + return contentId;
  109 + }
  110 +
  111 + public void setContentId(String contentId) {
  112 + this.contentId = contentId;
  113 + }
  114 +
  115 + public String getCmccId() {
  116 + return cmccId;
  117 + }
  118 +
  119 + public void setCmccId(String cmccId) {
  120 + this.cmccId = cmccId;
  121 + }
  122 +
  123 + public String getShareUrl() {
  124 + return shareUrl;
  125 + }
  126 +
  127 + public void setShareUrl(String shareUrl) {
  128 + this.shareUrl = shareUrl;
  129 + }
  130 +
  131 + public String getAlbumImg() {
  132 + return albumImg;
  133 + }
  134 +
  135 + public void setAlbumImg(String albumImg) {
  136 + this.albumImg = albumImg;
  137 + }
  138 +
  139 + public String getActor() {
  140 + return actor;
  141 + }
  142 +
  143 + public void setActor(String actor) {
  144 + this.actor = actor;
  145 + }
  146 +
  147 + public String getAlbumName() {
  148 + return albumName;
  149 + }
  150 +
  151 + public void setAlbumName(String albumName) {
  152 + this.albumName = albumName;
  153 + }
  154 +
  155 + public Double getSchedule() {
  156 + return schedule;
  157 + }
  158 +
  159 + public void setSchedule(Double schedule) {
  160 + this.schedule = schedule;
  161 + }
  162 +
  163 + public String getChannelName() {
  164 + return channelName;
  165 + }
  166 +
  167 + public void setChannelName(String channelName) {
  168 + this.channelName = channelName;
  169 + }
  170 +
  171 + public String getFileSize() {
  172 + return fileSize;
  173 + }
  174 +
  175 + public void setFileSize(String fileSize) {
  176 + this.fileSize = fileSize;
  177 + }
  178 +
  179 + public Integer getCounts() {
  180 + return counts;
  181 + }
  182 +
  183 + public void setCounts(Integer counts) {
  184 + this.counts = counts;
  185 + }
  186 +
  187 + // KEEP METHODS - put your custom methods here
  188 + // KEEP METHODS END
  189 +
  190 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/ExceptionInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "EXCEPTION_INFO".
  15 + */
  16 +@Entity
  17 +public class ExceptionInfo {
  18 +
  19 + @Id(autoincrement = true)
  20 + private Long id;
  21 +
  22 + @NotNull
  23 + private String ErrorTag;
  24 +
  25 + @NotNull
  26 + private String ErrorMessage;
  27 +
  28 + // KEEP FIELDS - put your custom fields here
  29 + // KEEP FIELDS END
  30 +
  31 + @Generated(hash = 841014831)
  32 + public ExceptionInfo() {
  33 + }
  34 +
  35 + public ExceptionInfo(Long id) {
  36 + this.id = id;
  37 + }
  38 +
  39 + @Generated(hash = 1539241816)
  40 + public ExceptionInfo(Long id, @NotNull String ErrorTag, @NotNull String ErrorMessage) {
  41 + this.id = id;
  42 + this.ErrorTag = ErrorTag;
  43 + this.ErrorMessage = ErrorMessage;
  44 + }
  45 +
  46 + public Long getId() {
  47 + return id;
  48 + }
  49 +
  50 + public void setId(Long id) {
  51 + this.id = id;
  52 + }
  53 +
  54 + @NotNull
  55 + public String getErrorTag() {
  56 + return ErrorTag;
  57 + }
  58 +
  59 + /** Not-null value; ensure this value is available before it is saved to the database. */
  60 + public void setErrorTag(@NotNull String ErrorTag) {
  61 + this.ErrorTag = ErrorTag;
  62 + }
  63 +
  64 + @NotNull
  65 + public String getErrorMessage() {
  66 + return ErrorMessage;
  67 + }
  68 +
  69 + /** Not-null value; ensure this value is available before it is saved to the database. */
  70 + public void setErrorMessage(@NotNull String ErrorMessage) {
  71 + this.ErrorMessage = ErrorMessage;
  72 + }
  73 +
  74 + // KEEP METHODS - put your custom methods here
  75 + // KEEP METHODS END
  76 +
  77 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/HolidayThemeInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "HOLIDAY_THEME_INFO".
  15 + */
  16 +@Entity
  17 +public class HolidayThemeInfo {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String appid;
  22 + private String clickAfter;
  23 + private String clickBefore;
  24 + private String holidayThemeId;
  25 + private String imagePackage;
  26 + private String showSource;
  27 + private String isShow;
  28 + private Integer updateType;
  29 + private Boolean isDonwLoadSucess;
  30 + private String skinType;
  31 +
  32 + // KEEP FIELDS - put your custom fields here
  33 + // KEEP FIELDS END
  34 +
  35 + @Generated(hash = 646770330)
  36 + public HolidayThemeInfo() {
  37 + }
  38 +
  39 + public HolidayThemeInfo(String appid) {
  40 + this.appid = appid;
  41 + }
  42 +
  43 + @Generated(hash = 754843222)
  44 + public HolidayThemeInfo(@NotNull String appid, String clickAfter, String clickBefore, String holidayThemeId, String imagePackage, String showSource, String isShow, Integer updateType, Boolean isDonwLoadSucess,
  45 + String skinType) {
  46 + this.appid = appid;
  47 + this.clickAfter = clickAfter;
  48 + this.clickBefore = clickBefore;
  49 + this.holidayThemeId = holidayThemeId;
  50 + this.imagePackage = imagePackage;
  51 + this.showSource = showSource;
  52 + this.isShow = isShow;
  53 + this.updateType = updateType;
  54 + this.isDonwLoadSucess = isDonwLoadSucess;
  55 + this.skinType = skinType;
  56 + }
  57 +
  58 + @NotNull
  59 + public String getAppid() {
  60 + return appid;
  61 + }
  62 +
  63 + /** Not-null value; ensure this value is available before it is saved to the database. */
  64 + public void setAppid(@NotNull String appid) {
  65 + this.appid = appid;
  66 + }
  67 +
  68 + public String getClickAfter() {
  69 + return clickAfter;
  70 + }
  71 +
  72 + public void setClickAfter(String clickAfter) {
  73 + this.clickAfter = clickAfter;
  74 + }
  75 +
  76 + public String getClickBefore() {
  77 + return clickBefore;
  78 + }
  79 +
  80 + public void setClickBefore(String clickBefore) {
  81 + this.clickBefore = clickBefore;
  82 + }
  83 +
  84 + public String getHolidayThemeId() {
  85 + return holidayThemeId;
  86 + }
  87 +
  88 + public void setHolidayThemeId(String holidayThemeId) {
  89 + this.holidayThemeId = holidayThemeId;
  90 + }
  91 +
  92 + public String getImagePackage() {
  93 + return imagePackage;
  94 + }
  95 +
  96 + public void setImagePackage(String imagePackage) {
  97 + this.imagePackage = imagePackage;
  98 + }
  99 +
  100 + public String getShowSource() {
  101 + return showSource;
  102 + }
  103 +
  104 + public void setShowSource(String showSource) {
  105 + this.showSource = showSource;
  106 + }
  107 +
  108 + public String getIsShow() {
  109 + return isShow;
  110 + }
  111 +
  112 + public void setIsShow(String isShow) {
  113 + this.isShow = isShow;
  114 + }
  115 +
  116 + public Integer getUpdateType() {
  117 + return updateType;
  118 + }
  119 +
  120 + public void setUpdateType(Integer updateType) {
  121 + this.updateType = updateType;
  122 + }
  123 +
  124 + public Boolean getIsDonwLoadSucess() {
  125 + return isDonwLoadSucess;
  126 + }
  127 +
  128 + public void setIsDonwLoadSucess(Boolean isDonwLoadSucess) {
  129 + this.isDonwLoadSucess = isDonwLoadSucess;
  130 + }
  131 +
  132 + public String getSkinType() {
  133 + return skinType;
  134 + }
  135 +
  136 + public void setSkinType(String skinType) {
  137 + this.skinType = skinType;
  138 + }
  139 +
  140 + // KEEP METHODS - put your custom methods here
  141 + // KEEP METHODS END
  142 +
  143 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMConversationInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "IMCONVERSATION_INFO".
  15 + */
  16 +@Entity
  17 +public class IMConversationInfo {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String conversationId;
  22 + private String conversationType;
  23 + private String title;
  24 + private String des;
  25 + private String faceUrl;
  26 + private String conversationFaceUrl;
  27 + private Long timeStep;
  28 + private Long unreadCount;
  29 +
  30 + // KEEP FIELDS - put your custom fields here
  31 + // KEEP FIELDS END
  32 +
  33 + @Generated(hash = 1584740420)
  34 + public IMConversationInfo() {
  35 + }
  36 +
  37 + public IMConversationInfo(String conversationId) {
  38 + this.conversationId = conversationId;
  39 + }
  40 +
  41 + @Generated(hash = 972213813)
  42 + public IMConversationInfo(@NotNull String conversationId, String conversationType, String title, String des, String faceUrl, String conversationFaceUrl, Long timeStep,
  43 + Long unreadCount) {
  44 + this.conversationId = conversationId;
  45 + this.conversationType = conversationType;
  46 + this.title = title;
  47 + this.des = des;
  48 + this.faceUrl = faceUrl;
  49 + this.conversationFaceUrl = conversationFaceUrl;
  50 + this.timeStep = timeStep;
  51 + this.unreadCount = unreadCount;
  52 + }
  53 +
  54 + @NotNull
  55 + public String getConversationId() {
  56 + return conversationId;
  57 + }
  58 +
  59 + /** Not-null value; ensure this value is available before it is saved to the database. */
  60 + public void setConversationId(@NotNull String conversationId) {
  61 + this.conversationId = conversationId;
  62 + }
  63 +
  64 + public String getConversationType() {
  65 + return conversationType;
  66 + }
  67 +
  68 + public void setConversationType(String conversationType) {
  69 + this.conversationType = conversationType;
  70 + }
  71 +
  72 + public String getTitle() {
  73 + return title;
  74 + }
  75 +
  76 + public void setTitle(String title) {
  77 + this.title = title;
  78 + }
  79 +
  80 + public String getDes() {
  81 + return des;
  82 + }
  83 +
  84 + public void setDes(String des) {
  85 + this.des = des;
  86 + }
  87 +
  88 + public String getFaceUrl() {
  89 + return faceUrl;
  90 + }
  91 +
  92 + public void setFaceUrl(String faceUrl) {
  93 + this.faceUrl = faceUrl;
  94 + }
  95 +
  96 + public String getConversationFaceUrl() {
  97 + return conversationFaceUrl;
  98 + }
  99 +
  100 + public void setConversationFaceUrl(String conversationFaceUrl) {
  101 + this.conversationFaceUrl = conversationFaceUrl;
  102 + }
  103 +
  104 + public Long getTimeStep() {
  105 + return timeStep;
  106 + }
  107 +
  108 + public void setTimeStep(Long timeStep) {
  109 + this.timeStep = timeStep;
  110 + }
  111 +
  112 + public Long getUnreadCount() {
  113 + return unreadCount;
  114 + }
  115 +
  116 + public void setUnreadCount(Long unreadCount) {
  117 + this.unreadCount = unreadCount;
  118 + }
  119 +
  120 + // KEEP METHODS - put your custom methods here
  121 + // KEEP METHODS END
  122 +
  123 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMGroupFaceMemberIds.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "IMGROUP_FACE_MEMBER_IDS".
  15 + */
  16 +@Entity
  17 +public class IMGroupFaceMemberIds {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String GroupId;
  22 + private String GroupFaceUrlIds;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 193259065)
  28 + public IMGroupFaceMemberIds() {
  29 + }
  30 +
  31 + public IMGroupFaceMemberIds(String GroupId) {
  32 + this.GroupId = GroupId;
  33 + }
  34 +
  35 + @Generated(hash = 1656457009)
  36 + public IMGroupFaceMemberIds(@NotNull String GroupId, String GroupFaceUrlIds) {
  37 + this.GroupId = GroupId;
  38 + this.GroupFaceUrlIds = GroupFaceUrlIds;
  39 + }
  40 +
  41 + @NotNull
  42 + public String getGroupId() {
  43 + return GroupId;
  44 + }
  45 +
  46 + /** Not-null value; ensure this value is available before it is saved to the database. */
  47 + public void setGroupId(@NotNull String GroupId) {
  48 + this.GroupId = GroupId;
  49 + }
  50 +
  51 + public String getGroupFaceUrlIds() {
  52 + return GroupFaceUrlIds;
  53 + }
  54 +
  55 + public void setGroupFaceUrlIds(String GroupFaceUrlIds) {
  56 + this.GroupFaceUrlIds = GroupFaceUrlIds;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMGroupMembers.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "IMGROUP_MEMBERS".
  15 + */
  16 +@Entity
  17 +public class IMGroupMembers {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String GroupId;
  22 + private String GroupName;
  23 + private String GroupFaceUrl;
  24 + private String CombineGroupFaceUrl;
  25 +
  26 + // KEEP FIELDS - put your custom fields here
  27 + // KEEP FIELDS END
  28 +
  29 + @Generated(hash = 183870571)
  30 + public IMGroupMembers() {
  31 + }
  32 +
  33 + public IMGroupMembers(String GroupId) {
  34 + this.GroupId = GroupId;
  35 + }
  36 +
  37 + @Generated(hash = 275046691)
  38 + public IMGroupMembers(@NotNull String GroupId, String GroupName, String GroupFaceUrl,
  39 + String CombineGroupFaceUrl) {
  40 + this.GroupId = GroupId;
  41 + this.GroupName = GroupName;
  42 + this.GroupFaceUrl = GroupFaceUrl;
  43 + this.CombineGroupFaceUrl = CombineGroupFaceUrl;
  44 + }
  45 +
  46 + @NotNull
  47 + public String getGroupId() {
  48 + return GroupId;
  49 + }
  50 +
  51 + /** Not-null value; ensure this value is available before it is saved to the database. */
  52 + public void setGroupId(@NotNull String GroupId) {
  53 + this.GroupId = GroupId;
  54 + }
  55 +
  56 + public String getGroupName() {
  57 + return GroupName;
  58 + }
  59 +
  60 + public void setGroupName(String GroupName) {
  61 + this.GroupName = GroupName;
  62 + }
  63 +
  64 + public String getGroupFaceUrl() {
  65 + return GroupFaceUrl;
  66 + }
  67 +
  68 + public void setGroupFaceUrl(String GroupFaceUrl) {
  69 + this.GroupFaceUrl = GroupFaceUrl;
  70 + }
  71 +
  72 + public String getCombineGroupFaceUrl() {
  73 + return CombineGroupFaceUrl;
  74 + }
  75 +
  76 + public void setCombineGroupFaceUrl(String CombineGroupFaceUrl) {
  77 + this.CombineGroupFaceUrl = CombineGroupFaceUrl;
  78 + }
  79 +
  80 + // KEEP METHODS - put your custom methods here
  81 + // KEEP METHODS END
  82 +
  83 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMGroupMembersList.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "IMGROUP_MEMBERS_LIST".
  14 + */
  15 +@Entity
  16 +public class IMGroupMembersList {
  17 +
  18 + @Id(autoincrement = true)
  19 + private Long id;
  20 + private String GroupId;
  21 + private String memberId;
  22 + private String memberRemark;
  23 + private String memberFaceUrl;
  24 + private String memberNick;
  25 + private String memberRoleType;
  26 + private String memberNameCard;
  27 +
  28 + // KEEP FIELDS - put your custom fields here
  29 + // KEEP FIELDS END
  30 +
  31 + @Generated(hash = 167732717)
  32 + public IMGroupMembersList() {
  33 + }
  34 +
  35 + public IMGroupMembersList(Long id) {
  36 + this.id = id;
  37 + }
  38 +
  39 + @Generated(hash = 404302734)
  40 + public IMGroupMembersList(Long id, String GroupId, String memberId, String memberRemark, String memberFaceUrl, String memberNick, String memberRoleType, String memberNameCard) {
  41 + this.id = id;
  42 + this.GroupId = GroupId;
  43 + this.memberId = memberId;
  44 + this.memberRemark = memberRemark;
  45 + this.memberFaceUrl = memberFaceUrl;
  46 + this.memberNick = memberNick;
  47 + this.memberRoleType = memberRoleType;
  48 + this.memberNameCard = memberNameCard;
  49 + }
  50 +
  51 + public Long getId() {
  52 + return id;
  53 + }
  54 +
  55 + public void setId(Long id) {
  56 + this.id = id;
  57 + }
  58 +
  59 + public String getGroupId() {
  60 + return GroupId;
  61 + }
  62 +
  63 + public void setGroupId(String GroupId) {
  64 + this.GroupId = GroupId;
  65 + }
  66 +
  67 + public String getMemberId() {
  68 + return memberId;
  69 + }
  70 +
  71 + public void setMemberId(String memberId) {
  72 + this.memberId = memberId;
  73 + }
  74 +
  75 + public String getMemberRemark() {
  76 + return memberRemark;
  77 + }
  78 +
  79 + public void setMemberRemark(String memberRemark) {
  80 + this.memberRemark = memberRemark;
  81 + }
  82 +
  83 + public String getMemberFaceUrl() {
  84 + return memberFaceUrl;
  85 + }
  86 +
  87 + public void setMemberFaceUrl(String memberFaceUrl) {
  88 + this.memberFaceUrl = memberFaceUrl;
  89 + }
  90 +
  91 + public String getMemberNick() {
  92 + return memberNick;
  93 + }
  94 +
  95 + public void setMemberNick(String memberNick) {
  96 + this.memberNick = memberNick;
  97 + }
  98 +
  99 + public String getMemberRoleType() {
  100 + return memberRoleType;
  101 + }
  102 +
  103 + public void setMemberRoleType(String memberRoleType) {
  104 + this.memberRoleType = memberRoleType;
  105 + }
  106 +
  107 + public String getMemberNameCard() {
  108 + return memberNameCard;
  109 + }
  110 +
  111 + public void setMemberNameCard(String memberNameCard) {
  112 + this.memberNameCard = memberNameCard;
  113 + }
  114 +
  115 + // KEEP METHODS - put your custom methods here
  116 + // KEEP METHODS END
  117 +
  118 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMGroupMembersManagerList.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "IMGROUP_MEMBERS_MANAGER_LIST".
  14 + */
  15 +@Entity
  16 +public class IMGroupMembersManagerList {
  17 +
  18 + @Id(autoincrement = true)
  19 + private Long id;
  20 + private String GroupId;
  21 + private String memberId;
  22 +
  23 + // KEEP FIELDS - put your custom fields here
  24 + // KEEP FIELDS END
  25 +
  26 + @Generated(hash = 1327955001)
  27 + public IMGroupMembersManagerList() {
  28 + }
  29 +
  30 + public IMGroupMembersManagerList(Long id) {
  31 + this.id = id;
  32 + }
  33 +
  34 + @Generated(hash = 1013490095)
  35 + public IMGroupMembersManagerList(Long id, String GroupId, String memberId) {
  36 + this.id = id;
  37 + this.GroupId = GroupId;
  38 + this.memberId = memberId;
  39 + }
  40 +
  41 + public Long getId() {
  42 + return id;
  43 + }
  44 +
  45 + public void setId(Long id) {
  46 + this.id = id;
  47 + }
  48 +
  49 + public String getGroupId() {
  50 + return GroupId;
  51 + }
  52 +
  53 + public void setGroupId(String GroupId) {
  54 + this.GroupId = GroupId;
  55 + }
  56 +
  57 + public String getMemberId() {
  58 + return memberId;
  59 + }
  60 +
  61 + public void setMemberId(String memberId) {
  62 + this.memberId = memberId;
  63 + }
  64 +
  65 + // KEEP METHODS - put your custom methods here
  66 + // KEEP METHODS END
  67 +
  68 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/IMUserInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "IMUSER_INFO".
  15 + */
  16 +@Entity
  17 +public class IMUserInfo {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String UserId;
  22 + private String NickName;
  23 + private String Remark;
  24 + private String FaceUrl;
  25 +
  26 + // KEEP FIELDS - put your custom fields here
  27 + // KEEP FIELDS END
  28 +
  29 + @Generated(hash = 699328686)
  30 + public IMUserInfo() {
  31 + }
  32 +
  33 + public IMUserInfo(String UserId) {
  34 + this.UserId = UserId;
  35 + }
  36 +
  37 + @Generated(hash = 1445813298)
  38 + public IMUserInfo(@NotNull String UserId, String NickName, String Remark,
  39 + String FaceUrl) {
  40 + this.UserId = UserId;
  41 + this.NickName = NickName;
  42 + this.Remark = Remark;
  43 + this.FaceUrl = FaceUrl;
  44 + }
  45 +
  46 + @NotNull
  47 + public String getUserId() {
  48 + return UserId;
  49 + }
  50 +
  51 + /** Not-null value; ensure this value is available before it is saved to the database. */
  52 + public void setUserId(@NotNull String UserId) {
  53 + this.UserId = UserId;
  54 + }
  55 +
  56 + public String getNickName() {
  57 + return NickName;
  58 + }
  59 +
  60 + public void setNickName(String NickName) {
  61 + this.NickName = NickName;
  62 + }
  63 +
  64 + public String getRemark() {
  65 + return Remark;
  66 + }
  67 +
  68 + public void setRemark(String Remark) {
  69 + this.Remark = Remark;
  70 + }
  71 +
  72 + public String getFaceUrl() {
  73 + return FaceUrl;
  74 + }
  75 +
  76 + public void setFaceUrl(String FaceUrl) {
  77 + this.FaceUrl = FaceUrl;
  78 + }
  79 +
  80 + // KEEP METHODS - put your custom methods here
  81 + // KEEP METHODS END
  82 +
  83 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/LaunchAdInfo.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "LAUNCH_AD_INFO".
  15 + */
  16 +@Entity
  17 +public class LaunchAdInfo {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String appid;
  22 + private String id;
  23 + private String wjjAdUrl;
  24 + private String wjjAdImgUrl;
  25 + private Boolean wjjAdv;
  26 + private String wjjAdImgPath;
  27 + private Integer duration;
  28 + private Integer modifyStatus;
  29 +
  30 + // KEEP FIELDS - put your custom fields here
  31 + // KEEP FIELDS END
  32 +
  33 + @Generated(hash = 727472882)
  34 + public LaunchAdInfo() {
  35 + }
  36 +
  37 + public LaunchAdInfo(String appid) {
  38 + this.appid = appid;
  39 + }
  40 +
  41 + @Generated(hash = 1914070053)
  42 + public LaunchAdInfo(@NotNull String appid, String id, String wjjAdUrl, String wjjAdImgUrl, Boolean wjjAdv, String wjjAdImgPath, Integer duration,
  43 + Integer modifyStatus) {
  44 + this.appid = appid;
  45 + this.id = id;
  46 + this.wjjAdUrl = wjjAdUrl;
  47 + this.wjjAdImgUrl = wjjAdImgUrl;
  48 + this.wjjAdv = wjjAdv;
  49 + this.wjjAdImgPath = wjjAdImgPath;
  50 + this.duration = duration;
  51 + this.modifyStatus = modifyStatus;
  52 + }
  53 +
  54 + @NotNull
  55 + public String getAppid() {
  56 + return appid;
  57 + }
  58 +
  59 + /** Not-null value; ensure this value is available before it is saved to the database. */
  60 + public void setAppid(@NotNull String appid) {
  61 + this.appid = appid;
  62 + }
  63 +
  64 + public String getId() {
  65 + return id;
  66 + }
  67 +
  68 + public void setId(String id) {
  69 + this.id = id;
  70 + }
  71 +
  72 + public String getWjjAdUrl() {
  73 + return wjjAdUrl;
  74 + }
  75 +
  76 + public void setWjjAdUrl(String wjjAdUrl) {
  77 + this.wjjAdUrl = wjjAdUrl;
  78 + }
  79 +
  80 + public String getWjjAdImgUrl() {
  81 + return wjjAdImgUrl;
  82 + }
  83 +
  84 + public void setWjjAdImgUrl(String wjjAdImgUrl) {
  85 + this.wjjAdImgUrl = wjjAdImgUrl;
  86 + }
  87 +
  88 + public Boolean getWjjAdv() {
  89 + return wjjAdv;
  90 + }
  91 +
  92 + public void setWjjAdv(Boolean wjjAdv) {
  93 + this.wjjAdv = wjjAdv;
  94 + }
  95 +
  96 + public String getWjjAdImgPath() {
  97 + return wjjAdImgPath;
  98 + }
  99 +
  100 + public void setWjjAdImgPath(String wjjAdImgPath) {
  101 + this.wjjAdImgPath = wjjAdImgPath;
  102 + }
  103 +
  104 + public Integer getDuration() {
  105 + return duration;
  106 + }
  107 +
  108 + public void setDuration(Integer duration) {
  109 + this.duration = duration;
  110 + }
  111 +
  112 + public Integer getModifyStatus() {
  113 + return modifyStatus;
  114 + }
  115 +
  116 + public void setModifyStatus(Integer modifyStatus) {
  117 + this.modifyStatus = modifyStatus;
  118 + }
  119 +
  120 + // KEEP METHODS - put your custom methods here
  121 + // KEEP METHODS END
  122 +
  123 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/NewContactFriendEntity.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "NEW_CONTACT_FRIEND_ENTITY".
  14 + */
  15 +@Entity
  16 +public class NewContactFriendEntity {
  17 +
  18 + @Id
  19 + private String uid;
  20 + private String cacheData;
  21 +
  22 + // KEEP FIELDS - put your custom fields here
  23 + // KEEP FIELDS END
  24 +
  25 + @Generated(hash = 1300800285)
  26 + public NewContactFriendEntity() {
  27 + }
  28 +
  29 + public NewContactFriendEntity(String uid) {
  30 + this.uid = uid;
  31 + }
  32 +
  33 + @Generated(hash = 1913403774)
  34 + public NewContactFriendEntity(String uid, String cacheData) {
  35 + this.uid = uid;
  36 + this.cacheData = cacheData;
  37 + }
  38 +
  39 + public String getUid() {
  40 + return uid;
  41 + }
  42 +
  43 + public void setUid(String uid) {
  44 + this.uid = uid;
  45 + }
  46 +
  47 + public String getCacheData() {
  48 + return cacheData;
  49 + }
  50 +
  51 + public void setCacheData(String cacheData) {
  52 + this.cacheData = cacheData;
  53 + }
  54 +
  55 + // KEEP METHODS - put your custom methods here
  56 + // KEEP METHODS END
  57 +
  58 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/NewPhoneContactEntity.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +
  7 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  8 +
  9 +// KEEP INCLUDES - put your custom includes here
  10 +// KEEP INCLUDES END
  11 +
  12 +/**
  13 + * Entity mapped to table "NEW_PHONE_CONTACT_ENTITY".
  14 + */
  15 +@Entity
  16 +public class NewPhoneContactEntity {
  17 +
  18 + @Id
  19 + private String uid;
  20 + private String cacheData;
  21 +
  22 + // KEEP FIELDS - put your custom fields here
  23 + // KEEP FIELDS END
  24 +
  25 + @Generated(hash = 1709040540)
  26 + public NewPhoneContactEntity() {
  27 + }
  28 +
  29 + public NewPhoneContactEntity(String uid) {
  30 + this.uid = uid;
  31 + }
  32 +
  33 + @Generated(hash = 2067323115)
  34 + public NewPhoneContactEntity(String uid, String cacheData) {
  35 + this.uid = uid;
  36 + this.cacheData = cacheData;
  37 + }
  38 +
  39 + public String getUid() {
  40 + return uid;
  41 + }
  42 +
  43 + public void setUid(String uid) {
  44 + this.uid = uid;
  45 + }
  46 +
  47 + public String getCacheData() {
  48 + return cacheData;
  49 + }
  50 +
  51 + public void setCacheData(String cacheData) {
  52 + this.cacheData = cacheData;
  53 + }
  54 +
  55 + // KEEP METHODS - put your custom methods here
  56 + // KEEP METHODS END
  57 +
  58 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/NewsNumber.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "NEWS_NUMBER".
  15 + */
  16 +@Entity
  17 +public class NewsNumber {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String ts;
  22 + private String newsList;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 79811361)
  28 + public NewsNumber() {
  29 + }
  30 +
  31 + public NewsNumber(String ts) {
  32 + this.ts = ts;
  33 + }
  34 +
  35 + @Generated(hash = 831653806)
  36 + public NewsNumber(@NotNull String ts, String newsList) {
  37 + this.ts = ts;
  38 + this.newsList = newsList;
  39 + }
  40 +
  41 + @NotNull
  42 + public String getTs() {
  43 + return ts;
  44 + }
  45 +
  46 + /** Not-null value; ensure this value is available before it is saved to the database. */
  47 + public void setTs(@NotNull String ts) {
  48 + this.ts = ts;
  49 + }
  50 +
  51 + public String getNewsList() {
  52 + return newsList;
  53 + }
  54 +
  55 + public void setNewsList(String newsList) {
  56 + this.newsList = newsList;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/SearchContent.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "SEARCH_CONTENT".
  15 + */
  16 +@Entity
  17 +public class SearchContent {
  18 + private String sid;
  19 +
  20 + @Id
  21 + @NotNull
  22 + private String content;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 206336392)
  28 + public SearchContent() {
  29 + }
  30 +
  31 + public SearchContent(String content) {
  32 + this.content = content;
  33 + }
  34 +
  35 + @Generated(hash = 634830022)
  36 + public SearchContent(String sid, @NotNull String content) {
  37 + this.sid = sid;
  38 + this.content = content;
  39 + }
  40 +
  41 + public String getSid() {
  42 + return sid;
  43 + }
  44 +
  45 + public void setSid(String sid) {
  46 + this.sid = sid;
  47 + }
  48 +
  49 + @NotNull
  50 + public String getContent() {
  51 + return content;
  52 + }
  53 +
  54 + /** Not-null value; ensure this value is available before it is saved to the database. */
  55 + public void setContent(@NotNull String content) {
  56 + this.content = content;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/SearchHistory.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "SEARCH_HISTORY".
  15 + */
  16 +@Entity
  17 +public class SearchHistory {
  18 + private String sid;
  19 +
  20 + @Id
  21 + @NotNull
  22 + private String history;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 1905904755)
  28 + public SearchHistory() {
  29 + }
  30 +
  31 + public SearchHistory(String history) {
  32 + this.history = history;
  33 + }
  34 +
  35 + @Generated(hash = 2087782047)
  36 + public SearchHistory(String sid, @NotNull String history) {
  37 + this.sid = sid;
  38 + this.history = history;
  39 + }
  40 +
  41 + public String getSid() {
  42 + return sid;
  43 + }
  44 +
  45 + public void setSid(String sid) {
  46 + this.sid = sid;
  47 + }
  48 +
  49 + @NotNull
  50 + public String getHistory() {
  51 + return history;
  52 + }
  53 +
  54 + /** Not-null value; ensure this value is available before it is saved to the database. */
  55 + public void setHistory(@NotNull String history) {
  56 + this.history = history;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/SysNumReadable.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "SYS_NUM_READABLE".
  15 + */
  16 +@Entity
  17 +public class SysNumReadable {
  18 +
  19 + @Id
  20 + @NotNull
  21 + private String homeId;
  22 + private Long timeStep;
  23 +
  24 + // KEEP FIELDS - put your custom fields here
  25 + // KEEP FIELDS END
  26 +
  27 + @Generated(hash = 1800751102)
  28 + public SysNumReadable() {
  29 + }
  30 +
  31 + public SysNumReadable(String homeId) {
  32 + this.homeId = homeId;
  33 + }
  34 +
  35 + @Generated(hash = 1562660788)
  36 + public SysNumReadable(@NotNull String homeId, Long timeStep) {
  37 + this.homeId = homeId;
  38 + this.timeStep = timeStep;
  39 + }
  40 +
  41 + @NotNull
  42 + public String getHomeId() {
  43 + return homeId;
  44 + }
  45 +
  46 + /** Not-null value; ensure this value is available before it is saved to the database. */
  47 + public void setHomeId(@NotNull String homeId) {
  48 + this.homeId = homeId;
  49 + }
  50 +
  51 + public Long getTimeStep() {
  52 + return timeStep;
  53 + }
  54 +
  55 + public void setTimeStep(Long timeStep) {
  56 + this.timeStep = timeStep;
  57 + }
  58 +
  59 + // KEEP METHODS - put your custom methods here
  60 + // KEEP METHODS END
  61 +
  62 +}
... ...
core/database/src/main/java/com/cnlive/database/bean/Witness.java 0 → 100644
  1 +package com.cnlive.database.bean;
  2 +
  3 +import org.greenrobot.greendao.annotation.Entity;
  4 +import org.greenrobot.greendao.annotation.Generated;
  5 +import org.greenrobot.greendao.annotation.Id;
  6 +import org.greenrobot.greendao.annotation.NotNull;
  7 +
  8 +// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
  9 +
  10 +// KEEP INCLUDES - put your custom includes here
  11 +// KEEP INCLUDES END
  12 +
  13 +/**
  14 + * Entity mapped to table "WITNESS".
  15 + */
  16 +@Entity
  17 +public class Witness {
  18 + private String id;
  19 + private String sid;
  20 + private String medias;
  21 + private String title;
  22 + private String wit;
  23 + private Integer type;
  24 + private String videotype;
  25 + private String gopath;
  26 + private Integer multiplecategory;
  27 + private String tag;
  28 +
  29 + @Id
  30 + @NotNull
  31 + private String timeStamp;
  32 + private String dutation;
  33 + private String src;
  34 + private String taglist;
  35 +
  36 + // KEEP FIELDS - put your custom fields here
  37 + // KEEP FIELDS END
  38 +
  39 + @Generated(hash = 24525325)
  40 + public Witness() {
  41 + }
  42 +
  43 + public Witness(String timeStamp) {
  44 + this.timeStamp = timeStamp;
  45 + }
  46 +
  47 + @Generated(hash = 193853156)
  48 + public Witness(String id, String sid, String medias, String title, String wit, Integer type, String videotype, String gopath, Integer multiplecategory, String tag, @NotNull String timeStamp, String dutation, String src,
  49 + String taglist) {
  50 + this.id = id;
  51 + this.sid = sid;
  52 + this.medias = medias;
  53 + this.title = title;
  54 + this.wit = wit;
  55 + this.type = type;
  56 + this.videotype = videotype;
  57 + this.gopath = gopath;
  58 + this.multiplecategory = multiplecategory;
  59 + this.tag = tag;
  60 + this.timeStamp = timeStamp;
  61 + this.dutation = dutation;
  62 + this.src = src;
  63 + this.taglist = taglist;
  64 + }
  65 +
  66 + public String getId() {
  67 + return id;
  68 + }
  69 +
  70 + public void setId(String id) {
  71 + this.id = id;
  72 + }
  73 +
  74 + public String getSid() {
  75 + return sid;
  76 + }
  77 +
  78 + public void setSid(String sid) {
  79 + this.sid = sid;
  80 + }
  81 +
  82 + public String getMedias() {
  83 + return medias;
  84 + }
  85 +
  86 + public void setMedias(String medias) {
  87 + this.medias = medias;
  88 + }
  89 +
  90 + public String getTitle() {
  91 + return title;
  92 + }
  93 +
  94 + public void setTitle(String title) {
  95 + this.title = title;
  96 + }
  97 +
  98 + public String getWit() {
  99 + return wit;
  100 + }
  101 +
  102 + public void setWit(String wit) {
  103 + this.wit = wit;
  104 + }
  105 +
  106 + public Integer getType() {
  107 + return type;
  108 + }
  109 +
  110 + public void setType(Integer type) {
  111 + this.type = type;
  112 + }
  113 +
  114 + public String getVideotype() {
  115 + return videotype;
  116 + }
  117 +
  118 + public void setVideotype(String videotype) {
  119 + this.videotype = videotype;
  120 + }
  121 +
  122 + public String getGopath() {
  123 + return gopath;
  124 + }
  125 +
  126 + public void setGopath(String gopath) {
  127 + this.gopath = gopath;
  128 + }
  129 +
  130 + public Integer getMultiplecategory() {
  131 + return multiplecategory;
  132 + }
  133 +
  134 + public void setMultiplecategory(Integer multiplecategory) {
  135 + this.multiplecategory = multiplecategory;
  136 + }
  137 +
  138 + public String getTag() {
  139 + return tag;
  140 + }
  141 +
  142 + public void setTag(String tag) {
  143 + this.tag = tag;
  144 + }
  145 +
  146 + @NotNull
  147 + public String getTimeStamp() {
  148 + return timeStamp;
  149 + }
  150 +
  151 + /** Not-null value; ensure this value is available before it is saved to the database. */
  152 + public void setTimeStamp(@NotNull String timeStamp) {
  153 + this.timeStamp = timeStamp;
  154 + }
  155 +
  156 + public String getDutation() {
  157 + return dutation;
  158 + }
  159 +
  160 + public void setDutation(String dutation) {
  161 + this.dutation = dutation;
  162 + }
  163 +
  164 + public String getSrc() {
  165 + return src;
  166 + }
  167 +
  168 + public void setSrc(String src) {
  169 + this.src = src;
  170 + }
  171 +
  172 + public String getTaglist() {
  173 + return taglist;
  174 + }
  175 +
  176 + public void setTaglist(String taglist) {
  177 + this.taglist = taglist;
  178 + }
  179 +
  180 + // KEEP METHODS - put your custom methods here
  181 + // KEEP METHODS END
  182 +
  183 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/AudioPlayHistoricalRecordDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.AudioPlayHistoricalRecord;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "AUDIO_PLAY_HISTORICAL_RECORD".
  17 +*/
  18 +public class AudioPlayHistoricalRecordDao extends AbstractDao<AudioPlayHistoricalRecord, Long> {
  19 +
  20 + public static final String TABLENAME = "AUDIO_PLAY_HISTORICAL_RECORD";
  21 +
  22 + /**
  23 + * Properties of entity AudioPlayHistoricalRecord.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property ContentId = new Property(0, long.class, "contentId", true, "_id");
  28 + public final static Property ActiveId = new Property(1, String.class, "activeId", false, "ACTIVE_ID");
  29 + public final static Property Aid = new Property(2, String.class, "aid", false, "AID");
  30 + public final static Property Time = new Property(3, Long.class, "time", false, "TIME");
  31 + }
  32 +
  33 +
  34 + public AudioPlayHistoricalRecordDao(DaoConfig config) {
  35 + super(config);
  36 + }
  37 +
  38 + public AudioPlayHistoricalRecordDao(DaoConfig config, DaoSession daoSession) {
  39 + super(config, daoSession);
  40 + }
  41 +
  42 + /** Creates the underlying database table. */
  43 + public static void createTable(Database db, boolean ifNotExists) {
  44 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  45 + db.execSQL("CREATE TABLE " + constraint + "\"AUDIO_PLAY_HISTORICAL_RECORD\" (" + //
  46 + "\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: contentId
  47 + "\"ACTIVE_ID\" TEXT," + // 1: activeId
  48 + "\"AID\" TEXT," + // 2: aid
  49 + "\"TIME\" INTEGER);"); // 3: time
  50 + }
  51 +
  52 + /** Drops the underlying database table. */
  53 + public static void dropTable(Database db, boolean ifExists) {
  54 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"AUDIO_PLAY_HISTORICAL_RECORD\"";
  55 + db.execSQL(sql);
  56 + }
  57 +
  58 + @Override
  59 + protected final void bindValues(DatabaseStatement stmt, AudioPlayHistoricalRecord entity) {
  60 + stmt.clearBindings();
  61 + stmt.bindLong(1, entity.getContentId());
  62 +
  63 + String activeId = entity.getActiveId();
  64 + if (activeId != null) {
  65 + stmt.bindString(2, activeId);
  66 + }
  67 +
  68 + String aid = entity.getAid();
  69 + if (aid != null) {
  70 + stmt.bindString(3, aid);
  71 + }
  72 +
  73 + Long time = entity.getTime();
  74 + if (time != null) {
  75 + stmt.bindLong(4, time);
  76 + }
  77 + }
  78 +
  79 + @Override
  80 + protected final void bindValues(SQLiteStatement stmt, AudioPlayHistoricalRecord entity) {
  81 + stmt.clearBindings();
  82 + stmt.bindLong(1, entity.getContentId());
  83 +
  84 + String activeId = entity.getActiveId();
  85 + if (activeId != null) {
  86 + stmt.bindString(2, activeId);
  87 + }
  88 +
  89 + String aid = entity.getAid();
  90 + if (aid != null) {
  91 + stmt.bindString(3, aid);
  92 + }
  93 +
  94 + Long time = entity.getTime();
  95 + if (time != null) {
  96 + stmt.bindLong(4, time);
  97 + }
  98 + }
  99 +
  100 + @Override
  101 + public Long readKey(Cursor cursor, int offset) {
  102 + return cursor.getLong(offset + 0);
  103 + }
  104 +
  105 + @Override
  106 + public AudioPlayHistoricalRecord readEntity(Cursor cursor, int offset) {
  107 + AudioPlayHistoricalRecord entity = new AudioPlayHistoricalRecord( //
  108 + cursor.getLong(offset + 0), // contentId
  109 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // activeId
  110 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // aid
  111 + cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // time
  112 + );
  113 + return entity;
  114 + }
  115 +
  116 + @Override
  117 + public void readEntity(Cursor cursor, AudioPlayHistoricalRecord entity, int offset) {
  118 + entity.setContentId(cursor.getLong(offset + 0));
  119 + entity.setActiveId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  120 + entity.setAid(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  121 + entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
  122 + }
  123 +
  124 + @Override
  125 + protected final Long updateKeyAfterInsert(AudioPlayHistoricalRecord entity, long rowId) {
  126 + entity.setContentId(rowId);
  127 + return rowId;
  128 + }
  129 +
  130 + @Override
  131 + public Long getKey(AudioPlayHistoricalRecord entity) {
  132 + if(entity != null) {
  133 + return entity.getContentId();
  134 + } else {
  135 + return null;
  136 + }
  137 + }
  138 +
  139 + @Override
  140 + public boolean hasKey(AudioPlayHistoricalRecord entity) {
  141 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  142 + }
  143 +
  144 + @Override
  145 + protected final boolean isEntityUpdateable() {
  146 + return true;
  147 + }
  148 +
  149 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/AudioPlayLastInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.AudioPlayLastInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "AUDIO_PLAY_LAST_INFO".
  17 +*/
  18 +public class AudioPlayLastInfoDao extends AbstractDao<AudioPlayLastInfo, String> {
  19 +
  20 + public static final String TABLENAME = "AUDIO_PLAY_LAST_INFO";
  21 +
  22 + /**
  23 + * Properties of entity AudioPlayLastInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", true, "SID");
  28 + public final static Property ActivityId = new Property(1, String.class, "activityId", false, "ACTIVITY_ID");
  29 + public final static Property CmccId = new Property(2, String.class, "cmccId", false, "CMCC_ID");
  30 + public final static Property Aid = new Property(3, String.class, "aid", false, "AID");
  31 + public final static Property Poster = new Property(4, String.class, "poster", false, "POSTER");
  32 + public final static Property ShareUrl = new Property(5, String.class, "shareUrl", false, "SHARE_URL");
  33 + public final static Property ContentId = new Property(6, String.class, "contentId", false, "CONTENT_ID");
  34 + public final static Property Actor = new Property(7, String.class, "actor", false, "ACTOR");
  35 + public final static Property Title = new Property(8, String.class, "title", false, "TITLE");
  36 + public final static Property ChannelName = new Property(9, String.class, "channelName", false, "CHANNEL_NAME");
  37 + public final static Property AlbumName = new Property(10, String.class, "albumName", false, "ALBUM_NAME");
  38 + public final static Property Schedule = new Property(11, Double.class, "schedule", false, "SCHEDULE");
  39 + public final static Property Counts = new Property(12, Integer.class, "counts", false, "COUNTS");
  40 + public final static Property PlayState = new Property(13, Boolean.class, "playState", false, "PLAY_STATE");
  41 + public final static Property ProductId = new Property(14, String.class, "productId", false, "PRODUCT_ID");
  42 + public final static Property ProductType = new Property(15, String.class, "productType", false, "PRODUCT_TYPE");
  43 + public final static Property AProductId = new Property(16, String.class, "aProductId", false, "A_PRODUCT_ID");
  44 + public final static Property AProductType = new Property(17, String.class, "aProductType", false, "A_PRODUCT_TYPE");
  45 + public final static Property IsPayAlbum = new Property(18, Boolean.class, "isPayAlbum", false, "IS_PAY_ALBUM");
  46 + public final static Property IsPayItem = new Property(19, Boolean.class, "isPayItem", false, "IS_PAY_ITEM");
  47 + public final static Property SiteId = new Property(20, String.class, "siteId", false, "SITE_ID");
  48 + }
  49 +
  50 +
  51 + public AudioPlayLastInfoDao(DaoConfig config) {
  52 + super(config);
  53 + }
  54 +
  55 + public AudioPlayLastInfoDao(DaoConfig config, DaoSession daoSession) {
  56 + super(config, daoSession);
  57 + }
  58 +
  59 + /** Creates the underlying database table. */
  60 + public static void createTable(Database db, boolean ifNotExists) {
  61 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  62 + db.execSQL("CREATE TABLE " + constraint + "\"AUDIO_PLAY_LAST_INFO\" (" + //
  63 + "\"SID\" TEXT PRIMARY KEY NOT NULL ," + // 0: sid
  64 + "\"ACTIVITY_ID\" TEXT," + // 1: activityId
  65 + "\"CMCC_ID\" TEXT," + // 2: cmccId
  66 + "\"AID\" TEXT," + // 3: aid
  67 + "\"POSTER\" TEXT," + // 4: poster
  68 + "\"SHARE_URL\" TEXT," + // 5: shareUrl
  69 + "\"CONTENT_ID\" TEXT," + // 6: contentId
  70 + "\"ACTOR\" TEXT," + // 7: actor
  71 + "\"TITLE\" TEXT," + // 8: title
  72 + "\"CHANNEL_NAME\" TEXT," + // 9: channelName
  73 + "\"ALBUM_NAME\" TEXT," + // 10: albumName
  74 + "\"SCHEDULE\" REAL," + // 11: schedule
  75 + "\"COUNTS\" INTEGER," + // 12: counts
  76 + "\"PLAY_STATE\" INTEGER," + // 13: playState
  77 + "\"PRODUCT_ID\" TEXT," + // 14: productId
  78 + "\"PRODUCT_TYPE\" TEXT," + // 15: productType
  79 + "\"A_PRODUCT_ID\" TEXT," + // 16: aProductId
  80 + "\"A_PRODUCT_TYPE\" TEXT," + // 17: aProductType
  81 + "\"IS_PAY_ALBUM\" INTEGER," + // 18: isPayAlbum
  82 + "\"IS_PAY_ITEM\" INTEGER," + // 19: isPayItem
  83 + "\"SITE_ID\" TEXT);"); // 20: siteId
  84 + }
  85 +
  86 + /** Drops the underlying database table. */
  87 + public static void dropTable(Database db, boolean ifExists) {
  88 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"AUDIO_PLAY_LAST_INFO\"";
  89 + db.execSQL(sql);
  90 + }
  91 +
  92 + @Override
  93 + protected final void bindValues(DatabaseStatement stmt, AudioPlayLastInfo entity) {
  94 + stmt.clearBindings();
  95 + stmt.bindString(1, entity.getSid());
  96 +
  97 + String activityId = entity.getActivityId();
  98 + if (activityId != null) {
  99 + stmt.bindString(2, activityId);
  100 + }
  101 +
  102 + String cmccId = entity.getCmccId();
  103 + if (cmccId != null) {
  104 + stmt.bindString(3, cmccId);
  105 + }
  106 +
  107 + String aid = entity.getAid();
  108 + if (aid != null) {
  109 + stmt.bindString(4, aid);
  110 + }
  111 +
  112 + String poster = entity.getPoster();
  113 + if (poster != null) {
  114 + stmt.bindString(5, poster);
  115 + }
  116 +
  117 + String shareUrl = entity.getShareUrl();
  118 + if (shareUrl != null) {
  119 + stmt.bindString(6, shareUrl);
  120 + }
  121 +
  122 + String contentId = entity.getContentId();
  123 + if (contentId != null) {
  124 + stmt.bindString(7, contentId);
  125 + }
  126 +
  127 + String actor = entity.getActor();
  128 + if (actor != null) {
  129 + stmt.bindString(8, actor);
  130 + }
  131 +
  132 + String title = entity.getTitle();
  133 + if (title != null) {
  134 + stmt.bindString(9, title);
  135 + }
  136 +
  137 + String channelName = entity.getChannelName();
  138 + if (channelName != null) {
  139 + stmt.bindString(10, channelName);
  140 + }
  141 +
  142 + String albumName = entity.getAlbumName();
  143 + if (albumName != null) {
  144 + stmt.bindString(11, albumName);
  145 + }
  146 +
  147 + Double schedule = entity.getSchedule();
  148 + if (schedule != null) {
  149 + stmt.bindDouble(12, schedule);
  150 + }
  151 +
  152 + Integer counts = entity.getCounts();
  153 + if (counts != null) {
  154 + stmt.bindLong(13, counts);
  155 + }
  156 +
  157 + Boolean playState = entity.getPlayState();
  158 + if (playState != null) {
  159 + stmt.bindLong(14, playState ? 1L: 0L);
  160 + }
  161 +
  162 + String productId = entity.getProductId();
  163 + if (productId != null) {
  164 + stmt.bindString(15, productId);
  165 + }
  166 +
  167 + String productType = entity.getProductType();
  168 + if (productType != null) {
  169 + stmt.bindString(16, productType);
  170 + }
  171 +
  172 + String aProductId = entity.getAProductId();
  173 + if (aProductId != null) {
  174 + stmt.bindString(17, aProductId);
  175 + }
  176 +
  177 + String aProductType = entity.getAProductType();
  178 + if (aProductType != null) {
  179 + stmt.bindString(18, aProductType);
  180 + }
  181 +
  182 + Boolean isPayAlbum = entity.getIsPayAlbum();
  183 + if (isPayAlbum != null) {
  184 + stmt.bindLong(19, isPayAlbum ? 1L: 0L);
  185 + }
  186 +
  187 + Boolean isPayItem = entity.getIsPayItem();
  188 + if (isPayItem != null) {
  189 + stmt.bindLong(20, isPayItem ? 1L: 0L);
  190 + }
  191 +
  192 + String siteId = entity.getSiteId();
  193 + if (siteId != null) {
  194 + stmt.bindString(21, siteId);
  195 + }
  196 + }
  197 +
  198 + @Override
  199 + protected final void bindValues(SQLiteStatement stmt, AudioPlayLastInfo entity) {
  200 + stmt.clearBindings();
  201 + stmt.bindString(1, entity.getSid());
  202 +
  203 + String activityId = entity.getActivityId();
  204 + if (activityId != null) {
  205 + stmt.bindString(2, activityId);
  206 + }
  207 +
  208 + String cmccId = entity.getCmccId();
  209 + if (cmccId != null) {
  210 + stmt.bindString(3, cmccId);
  211 + }
  212 +
  213 + String aid = entity.getAid();
  214 + if (aid != null) {
  215 + stmt.bindString(4, aid);
  216 + }
  217 +
  218 + String poster = entity.getPoster();
  219 + if (poster != null) {
  220 + stmt.bindString(5, poster);
  221 + }
  222 +
  223 + String shareUrl = entity.getShareUrl();
  224 + if (shareUrl != null) {
  225 + stmt.bindString(6, shareUrl);
  226 + }
  227 +
  228 + String contentId = entity.getContentId();
  229 + if (contentId != null) {
  230 + stmt.bindString(7, contentId);
  231 + }
  232 +
  233 + String actor = entity.getActor();
  234 + if (actor != null) {
  235 + stmt.bindString(8, actor);
  236 + }
  237 +
  238 + String title = entity.getTitle();
  239 + if (title != null) {
  240 + stmt.bindString(9, title);
  241 + }
  242 +
  243 + String channelName = entity.getChannelName();
  244 + if (channelName != null) {
  245 + stmt.bindString(10, channelName);
  246 + }
  247 +
  248 + String albumName = entity.getAlbumName();
  249 + if (albumName != null) {
  250 + stmt.bindString(11, albumName);
  251 + }
  252 +
  253 + Double schedule = entity.getSchedule();
  254 + if (schedule != null) {
  255 + stmt.bindDouble(12, schedule);
  256 + }
  257 +
  258 + Integer counts = entity.getCounts();
  259 + if (counts != null) {
  260 + stmt.bindLong(13, counts);
  261 + }
  262 +
  263 + Boolean playState = entity.getPlayState();
  264 + if (playState != null) {
  265 + stmt.bindLong(14, playState ? 1L: 0L);
  266 + }
  267 +
  268 + String productId = entity.getProductId();
  269 + if (productId != null) {
  270 + stmt.bindString(15, productId);
  271 + }
  272 +
  273 + String productType = entity.getProductType();
  274 + if (productType != null) {
  275 + stmt.bindString(16, productType);
  276 + }
  277 +
  278 + String aProductId = entity.getAProductId();
  279 + if (aProductId != null) {
  280 + stmt.bindString(17, aProductId);
  281 + }
  282 +
  283 + String aProductType = entity.getAProductType();
  284 + if (aProductType != null) {
  285 + stmt.bindString(18, aProductType);
  286 + }
  287 +
  288 + Boolean isPayAlbum = entity.getIsPayAlbum();
  289 + if (isPayAlbum != null) {
  290 + stmt.bindLong(19, isPayAlbum ? 1L: 0L);
  291 + }
  292 +
  293 + Boolean isPayItem = entity.getIsPayItem();
  294 + if (isPayItem != null) {
  295 + stmt.bindLong(20, isPayItem ? 1L: 0L);
  296 + }
  297 +
  298 + String siteId = entity.getSiteId();
  299 + if (siteId != null) {
  300 + stmt.bindString(21, siteId);
  301 + }
  302 + }
  303 +
  304 + @Override
  305 + public String readKey(Cursor cursor, int offset) {
  306 + return cursor.getString(offset + 0);
  307 + }
  308 +
  309 + @Override
  310 + public AudioPlayLastInfo readEntity(Cursor cursor, int offset) {
  311 + AudioPlayLastInfo entity = new AudioPlayLastInfo( //
  312 + cursor.getString(offset + 0), // sid
  313 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // activityId
  314 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // cmccId
  315 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // aid
  316 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // poster
  317 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // shareUrl
  318 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // contentId
  319 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // actor
  320 + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // title
  321 + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // channelName
  322 + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // albumName
  323 + cursor.isNull(offset + 11) ? null : cursor.getDouble(offset + 11), // schedule
  324 + cursor.isNull(offset + 12) ? null : cursor.getInt(offset + 12), // counts
  325 + cursor.isNull(offset + 13) ? null : cursor.getShort(offset + 13) != 0, // playState
  326 + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // productId
  327 + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // productType
  328 + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // aProductId
  329 + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17), // aProductType
  330 + cursor.isNull(offset + 18) ? null : cursor.getShort(offset + 18) != 0, // isPayAlbum
  331 + cursor.isNull(offset + 19) ? null : cursor.getShort(offset + 19) != 0, // isPayItem
  332 + cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20) // siteId
  333 + );
  334 + return entity;
  335 + }
  336 +
  337 + @Override
  338 + public void readEntity(Cursor cursor, AudioPlayLastInfo entity, int offset) {
  339 + entity.setSid(cursor.getString(offset + 0));
  340 + entity.setActivityId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  341 + entity.setCmccId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  342 + entity.setAid(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  343 + entity.setPoster(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  344 + entity.setShareUrl(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  345 + entity.setContentId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  346 + entity.setActor(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  347 + entity.setTitle(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
  348 + entity.setChannelName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
  349 + entity.setAlbumName(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
  350 + entity.setSchedule(cursor.isNull(offset + 11) ? null : cursor.getDouble(offset + 11));
  351 + entity.setCounts(cursor.isNull(offset + 12) ? null : cursor.getInt(offset + 12));
  352 + entity.setPlayState(cursor.isNull(offset + 13) ? null : cursor.getShort(offset + 13) != 0);
  353 + entity.setProductId(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
  354 + entity.setProductType(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
  355 + entity.setAProductId(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16));
  356 + entity.setAProductType(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17));
  357 + entity.setIsPayAlbum(cursor.isNull(offset + 18) ? null : cursor.getShort(offset + 18) != 0);
  358 + entity.setIsPayItem(cursor.isNull(offset + 19) ? null : cursor.getShort(offset + 19) != 0);
  359 + entity.setSiteId(cursor.isNull(offset + 20) ? null : cursor.getString(offset + 20));
  360 + }
  361 +
  362 + @Override
  363 + protected final String updateKeyAfterInsert(AudioPlayLastInfo entity, long rowId) {
  364 + return entity.getSid();
  365 + }
  366 +
  367 + @Override
  368 + public String getKey(AudioPlayLastInfo entity) {
  369 + if(entity != null) {
  370 + return entity.getSid();
  371 + } else {
  372 + return null;
  373 + }
  374 + }
  375 +
  376 + @Override
  377 + public boolean hasKey(AudioPlayLastInfo entity) {
  378 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  379 + }
  380 +
  381 + @Override
  382 + protected final boolean isEntityUpdateable() {
  383 + return true;
  384 + }
  385 +
  386 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ChatFileMsgDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ChatFileMsg;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CHAT_FILE_MSG".
  17 +*/
  18 +public class ChatFileMsgDao extends AbstractDao<ChatFileMsg, Long> {
  19 +
  20 + public static final String TABLENAME = "CHAT_FILE_MSG";
  21 +
  22 + /**
  23 + * Properties of entity ChatFileMsg.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property MsgUniqueId = new Property(0, long.class, "msgUniqueId", true, "_id");
  28 + public final static Property FromUserId = new Property(1, String.class, "fromUserId", false, "FROM_USER_ID");
  29 + public final static Property FromUserNick = new Property(2, String.class, "fromUserNick", false, "FROM_USER_NICK");
  30 + public final static Property FilePath = new Property(3, String.class, "filePath", false, "FILE_PATH");
  31 + public final static Property FileName = new Property(4, String.class, "fileName", false, "FILE_NAME");
  32 + public final static Property FileSize = new Property(5, Long.class, "fileSize", false, "FILE_SIZE");
  33 + public final static Property MsgTime = new Property(6, Long.class, "msgTime", false, "MSG_TIME");
  34 + }
  35 +
  36 +
  37 + public ChatFileMsgDao(DaoConfig config) {
  38 + super(config);
  39 + }
  40 +
  41 + public ChatFileMsgDao(DaoConfig config, DaoSession daoSession) {
  42 + super(config, daoSession);
  43 + }
  44 +
  45 + /** Creates the underlying database table. */
  46 + public static void createTable(Database db, boolean ifNotExists) {
  47 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  48 + db.execSQL("CREATE TABLE " + constraint + "\"CHAT_FILE_MSG\" (" + //
  49 + "\"_id\" INTEGER PRIMARY KEY NOT NULL ," + // 0: msgUniqueId
  50 + "\"FROM_USER_ID\" TEXT," + // 1: fromUserId
  51 + "\"FROM_USER_NICK\" TEXT," + // 2: fromUserNick
  52 + "\"FILE_PATH\" TEXT," + // 3: filePath
  53 + "\"FILE_NAME\" TEXT," + // 4: fileName
  54 + "\"FILE_SIZE\" INTEGER," + // 5: fileSize
  55 + "\"MSG_TIME\" INTEGER);"); // 6: msgTime
  56 + }
  57 +
  58 + /** Drops the underlying database table. */
  59 + public static void dropTable(Database db, boolean ifExists) {
  60 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CHAT_FILE_MSG\"";
  61 + db.execSQL(sql);
  62 + }
  63 +
  64 + @Override
  65 + protected final void bindValues(DatabaseStatement stmt, ChatFileMsg entity) {
  66 + stmt.clearBindings();
  67 + stmt.bindLong(1, entity.getMsgUniqueId());
  68 +
  69 + String fromUserId = entity.getFromUserId();
  70 + if (fromUserId != null) {
  71 + stmt.bindString(2, fromUserId);
  72 + }
  73 +
  74 + String fromUserNick = entity.getFromUserNick();
  75 + if (fromUserNick != null) {
  76 + stmt.bindString(3, fromUserNick);
  77 + }
  78 +
  79 + String filePath = entity.getFilePath();
  80 + if (filePath != null) {
  81 + stmt.bindString(4, filePath);
  82 + }
  83 +
  84 + String fileName = entity.getFileName();
  85 + if (fileName != null) {
  86 + stmt.bindString(5, fileName);
  87 + }
  88 +
  89 + Long fileSize = entity.getFileSize();
  90 + if (fileSize != null) {
  91 + stmt.bindLong(6, fileSize);
  92 + }
  93 +
  94 + Long msgTime = entity.getMsgTime();
  95 + if (msgTime != null) {
  96 + stmt.bindLong(7, msgTime);
  97 + }
  98 + }
  99 +
  100 + @Override
  101 + protected final void bindValues(SQLiteStatement stmt, ChatFileMsg entity) {
  102 + stmt.clearBindings();
  103 + stmt.bindLong(1, entity.getMsgUniqueId());
  104 +
  105 + String fromUserId = entity.getFromUserId();
  106 + if (fromUserId != null) {
  107 + stmt.bindString(2, fromUserId);
  108 + }
  109 +
  110 + String fromUserNick = entity.getFromUserNick();
  111 + if (fromUserNick != null) {
  112 + stmt.bindString(3, fromUserNick);
  113 + }
  114 +
  115 + String filePath = entity.getFilePath();
  116 + if (filePath != null) {
  117 + stmt.bindString(4, filePath);
  118 + }
  119 +
  120 + String fileName = entity.getFileName();
  121 + if (fileName != null) {
  122 + stmt.bindString(5, fileName);
  123 + }
  124 +
  125 + Long fileSize = entity.getFileSize();
  126 + if (fileSize != null) {
  127 + stmt.bindLong(6, fileSize);
  128 + }
  129 +
  130 + Long msgTime = entity.getMsgTime();
  131 + if (msgTime != null) {
  132 + stmt.bindLong(7, msgTime);
  133 + }
  134 + }
  135 +
  136 + @Override
  137 + public Long readKey(Cursor cursor, int offset) {
  138 + return cursor.getLong(offset + 0);
  139 + }
  140 +
  141 + @Override
  142 + public ChatFileMsg readEntity(Cursor cursor, int offset) {
  143 + ChatFileMsg entity = new ChatFileMsg( //
  144 + cursor.getLong(offset + 0), // msgUniqueId
  145 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // fromUserId
  146 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // fromUserNick
  147 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // filePath
  148 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // fileName
  149 + cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // fileSize
  150 + cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6) // msgTime
  151 + );
  152 + return entity;
  153 + }
  154 +
  155 + @Override
  156 + public void readEntity(Cursor cursor, ChatFileMsg entity, int offset) {
  157 + entity.setMsgUniqueId(cursor.getLong(offset + 0));
  158 + entity.setFromUserId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  159 + entity.setFromUserNick(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  160 + entity.setFilePath(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  161 + entity.setFileName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  162 + entity.setFileSize(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));
  163 + entity.setMsgTime(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));
  164 + }
  165 +
  166 + @Override
  167 + protected final Long updateKeyAfterInsert(ChatFileMsg entity, long rowId) {
  168 + entity.setMsgUniqueId(rowId);
  169 + return rowId;
  170 + }
  171 +
  172 + @Override
  173 + public Long getKey(ChatFileMsg entity) {
  174 + if(entity != null) {
  175 + return entity.getMsgUniqueId();
  176 + } else {
  177 + return null;
  178 + }
  179 + }
  180 +
  181 + @Override
  182 + public boolean hasKey(ChatFileMsg entity) {
  183 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  184 + }
  185 +
  186 + @Override
  187 + protected final boolean isEntityUpdateable() {
  188 + return true;
  189 + }
  190 +
  191 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ChatImageAndVideoMsgDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ChatImageAndVideoMsg;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CHAT_IMAGE_AND_VIDEO_MSG".
  17 +*/
  18 +public class ChatImageAndVideoMsgDao extends AbstractDao<ChatImageAndVideoMsg, String> {
  19 +
  20 + public static final String TABLENAME = "CHAT_IMAGE_AND_VIDEO_MSG";
  21 +
  22 + /**
  23 + * Properties of entity ChatImageAndVideoMsg.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", false, "SID");
  28 + public final static Property ConversationType = new Property(1, String.class, "conversationType", false, "CONVERSATION_TYPE");
  29 + public final static Property TargetId = new Property(2, String.class, "targetId", false, "TARGET_ID");
  30 + public final static Property SendState = new Property(3, String.class, "sendState", false, "SEND_STATE");
  31 + public final static Property SendTime = new Property(4, Long.class, "sendTime", false, "SEND_TIME");
  32 + public final static Property MsgUniqueId = new Property(5, String.class, "msgUniqueId", true, "MSG_UNIQUE_ID");
  33 + public final static Property MessageLocator = new Property(6, String.class, "messageLocator", false, "MESSAGE_LOCATOR");
  34 + public final static Property MsgType = new Property(7, String.class, "msgType", false, "MSG_TYPE");
  35 + public final static Property ServerTime = new Property(8, Long.class, "serverTime", false, "SERVER_TIME");
  36 + public final static Property IsNewMessage = new Property(9, Boolean.class, "isNewMessage", false, "IS_NEW_MESSAGE");
  37 + }
  38 +
  39 +
  40 + public ChatImageAndVideoMsgDao(DaoConfig config) {
  41 + super(config);
  42 + }
  43 +
  44 + public ChatImageAndVideoMsgDao(DaoConfig config, DaoSession daoSession) {
  45 + super(config, daoSession);
  46 + }
  47 +
  48 + /** Creates the underlying database table. */
  49 + public static void createTable(Database db, boolean ifNotExists) {
  50 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  51 + db.execSQL("CREATE TABLE " + constraint + "\"CHAT_IMAGE_AND_VIDEO_MSG\" (" + //
  52 + "\"SID\" TEXT NOT NULL ," + // 0: sid
  53 + "\"CONVERSATION_TYPE\" TEXT," + // 1: conversationType
  54 + "\"TARGET_ID\" TEXT NOT NULL ," + // 2: targetId
  55 + "\"SEND_STATE\" TEXT," + // 3: sendState
  56 + "\"SEND_TIME\" INTEGER," + // 4: sendTime
  57 + "\"MSG_UNIQUE_ID\" TEXT PRIMARY KEY NOT NULL ," + // 5: msgUniqueId
  58 + "\"MESSAGE_LOCATOR\" TEXT," + // 6: messageLocator
  59 + "\"MSG_TYPE\" TEXT," + // 7: msgType
  60 + "\"SERVER_TIME\" INTEGER," + // 8: serverTime
  61 + "\"IS_NEW_MESSAGE\" INTEGER);"); // 9: isNewMessage
  62 + }
  63 +
  64 + /** Drops the underlying database table. */
  65 + public static void dropTable(Database db, boolean ifExists) {
  66 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CHAT_IMAGE_AND_VIDEO_MSG\"";
  67 + db.execSQL(sql);
  68 + }
  69 +
  70 + @Override
  71 + protected final void bindValues(DatabaseStatement stmt, ChatImageAndVideoMsg entity) {
  72 + stmt.clearBindings();
  73 + stmt.bindString(1, entity.getSid());
  74 +
  75 + String conversationType = entity.getConversationType();
  76 + if (conversationType != null) {
  77 + stmt.bindString(2, conversationType);
  78 + }
  79 + stmt.bindString(3, entity.getTargetId());
  80 +
  81 + String sendState = entity.getSendState();
  82 + if (sendState != null) {
  83 + stmt.bindString(4, sendState);
  84 + }
  85 +
  86 + Long sendTime = entity.getSendTime();
  87 + if (sendTime != null) {
  88 + stmt.bindLong(5, sendTime);
  89 + }
  90 + stmt.bindString(6, entity.getMsgUniqueId());
  91 +
  92 + String messageLocator = entity.getMessageLocator();
  93 + if (messageLocator != null) {
  94 + stmt.bindString(7, messageLocator);
  95 + }
  96 +
  97 + String msgType = entity.getMsgType();
  98 + if (msgType != null) {
  99 + stmt.bindString(8, msgType);
  100 + }
  101 +
  102 + Long serverTime = entity.getServerTime();
  103 + if (serverTime != null) {
  104 + stmt.bindLong(9, serverTime);
  105 + }
  106 +
  107 + Boolean isNewMessage = entity.getIsNewMessage();
  108 + if (isNewMessage != null) {
  109 + stmt.bindLong(10, isNewMessage ? 1L: 0L);
  110 + }
  111 + }
  112 +
  113 + @Override
  114 + protected final void bindValues(SQLiteStatement stmt, ChatImageAndVideoMsg entity) {
  115 + stmt.clearBindings();
  116 + stmt.bindString(1, entity.getSid());
  117 +
  118 + String conversationType = entity.getConversationType();
  119 + if (conversationType != null) {
  120 + stmt.bindString(2, conversationType);
  121 + }
  122 + stmt.bindString(3, entity.getTargetId());
  123 +
  124 + String sendState = entity.getSendState();
  125 + if (sendState != null) {
  126 + stmt.bindString(4, sendState);
  127 + }
  128 +
  129 + Long sendTime = entity.getSendTime();
  130 + if (sendTime != null) {
  131 + stmt.bindLong(5, sendTime);
  132 + }
  133 + stmt.bindString(6, entity.getMsgUniqueId());
  134 +
  135 + String messageLocator = entity.getMessageLocator();
  136 + if (messageLocator != null) {
  137 + stmt.bindString(7, messageLocator);
  138 + }
  139 +
  140 + String msgType = entity.getMsgType();
  141 + if (msgType != null) {
  142 + stmt.bindString(8, msgType);
  143 + }
  144 +
  145 + Long serverTime = entity.getServerTime();
  146 + if (serverTime != null) {
  147 + stmt.bindLong(9, serverTime);
  148 + }
  149 +
  150 + Boolean isNewMessage = entity.getIsNewMessage();
  151 + if (isNewMessage != null) {
  152 + stmt.bindLong(10, isNewMessage ? 1L: 0L);
  153 + }
  154 + }
  155 +
  156 + @Override
  157 + public String readKey(Cursor cursor, int offset) {
  158 + return cursor.getString(offset + 5);
  159 + }
  160 +
  161 + @Override
  162 + public ChatImageAndVideoMsg readEntity(Cursor cursor, int offset) {
  163 + ChatImageAndVideoMsg entity = new ChatImageAndVideoMsg( //
  164 + cursor.getString(offset + 0), // sid
  165 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // conversationType
  166 + cursor.getString(offset + 2), // targetId
  167 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // sendState
  168 + cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4), // sendTime
  169 + cursor.getString(offset + 5), // msgUniqueId
  170 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // messageLocator
  171 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // msgType
  172 + cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8), // serverTime
  173 + cursor.isNull(offset + 9) ? null : cursor.getShort(offset + 9) != 0 // isNewMessage
  174 + );
  175 + return entity;
  176 + }
  177 +
  178 + @Override
  179 + public void readEntity(Cursor cursor, ChatImageAndVideoMsg entity, int offset) {
  180 + entity.setSid(cursor.getString(offset + 0));
  181 + entity.setConversationType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  182 + entity.setTargetId(cursor.getString(offset + 2));
  183 + entity.setSendState(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  184 + entity.setSendTime(cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4));
  185 + entity.setMsgUniqueId(cursor.getString(offset + 5));
  186 + entity.setMessageLocator(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  187 + entity.setMsgType(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  188 + entity.setServerTime(cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8));
  189 + entity.setIsNewMessage(cursor.isNull(offset + 9) ? null : cursor.getShort(offset + 9) != 0);
  190 + }
  191 +
  192 + @Override
  193 + protected final String updateKeyAfterInsert(ChatImageAndVideoMsg entity, long rowId) {
  194 + return entity.getMsgUniqueId();
  195 + }
  196 +
  197 + @Override
  198 + public String getKey(ChatImageAndVideoMsg entity) {
  199 + if(entity != null) {
  200 + return entity.getMsgUniqueId();
  201 + } else {
  202 + return null;
  203 + }
  204 + }
  205 +
  206 + @Override
  207 + public boolean hasKey(ChatImageAndVideoMsg entity) {
  208 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  209 + }
  210 +
  211 + @Override
  212 + protected final boolean isEntityUpdateable() {
  213 + return true;
  214 + }
  215 +
  216 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ChatMediaDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ChatMedia;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CHAT_MEDIA".
  17 +*/
  18 +public class ChatMediaDao extends AbstractDao<ChatMedia, String> {
  19 +
  20 + public static final String TABLENAME = "CHAT_MEDIA";
  21 +
  22 + /**
  23 + * Properties of entity ChatMedia.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property CachePath = new Property(0, String.class, "cachePath", true, "CACHE_PATH");
  28 + public final static Property ConversationId = new Property(1, String.class, "conversationId", false, "CONVERSATION_ID");
  29 + public final static Property MediaType = new Property(2, String.class, "mediaType", false, "MEDIA_TYPE");
  30 + public final static Property ThumbPath = new Property(3, String.class, "thumbPath", false, "THUMB_PATH");
  31 + public final static Property VideoDur = new Property(4, String.class, "videoDur", false, "VIDEO_DUR");
  32 + public final static Property CacheTime = new Property(5, Long.class, "cacheTime", false, "CACHE_TIME");
  33 + }
  34 +
  35 +
  36 + public ChatMediaDao(DaoConfig config) {
  37 + super(config);
  38 + }
  39 +
  40 + public ChatMediaDao(DaoConfig config, DaoSession daoSession) {
  41 + super(config, daoSession);
  42 + }
  43 +
  44 + /** Creates the underlying database table. */
  45 + public static void createTable(Database db, boolean ifNotExists) {
  46 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  47 + db.execSQL("CREATE TABLE " + constraint + "\"CHAT_MEDIA\" (" + //
  48 + "\"CACHE_PATH\" TEXT PRIMARY KEY NOT NULL ," + // 0: cachePath
  49 + "\"CONVERSATION_ID\" TEXT," + // 1: conversationId
  50 + "\"MEDIA_TYPE\" TEXT," + // 2: mediaType
  51 + "\"THUMB_PATH\" TEXT," + // 3: thumbPath
  52 + "\"VIDEO_DUR\" TEXT," + // 4: videoDur
  53 + "\"CACHE_TIME\" INTEGER);"); // 5: cacheTime
  54 + }
  55 +
  56 + /** Drops the underlying database table. */
  57 + public static void dropTable(Database db, boolean ifExists) {
  58 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CHAT_MEDIA\"";
  59 + db.execSQL(sql);
  60 + }
  61 +
  62 + @Override
  63 + protected final void bindValues(DatabaseStatement stmt, ChatMedia entity) {
  64 + stmt.clearBindings();
  65 + stmt.bindString(1, entity.getCachePath());
  66 +
  67 + String conversationId = entity.getConversationId();
  68 + if (conversationId != null) {
  69 + stmt.bindString(2, conversationId);
  70 + }
  71 +
  72 + String mediaType = entity.getMediaType();
  73 + if (mediaType != null) {
  74 + stmt.bindString(3, mediaType);
  75 + }
  76 +
  77 + String thumbPath = entity.getThumbPath();
  78 + if (thumbPath != null) {
  79 + stmt.bindString(4, thumbPath);
  80 + }
  81 +
  82 + String videoDur = entity.getVideoDur();
  83 + if (videoDur != null) {
  84 + stmt.bindString(5, videoDur);
  85 + }
  86 +
  87 + Long cacheTime = entity.getCacheTime();
  88 + if (cacheTime != null) {
  89 + stmt.bindLong(6, cacheTime);
  90 + }
  91 + }
  92 +
  93 + @Override
  94 + protected final void bindValues(SQLiteStatement stmt, ChatMedia entity) {
  95 + stmt.clearBindings();
  96 + stmt.bindString(1, entity.getCachePath());
  97 +
  98 + String conversationId = entity.getConversationId();
  99 + if (conversationId != null) {
  100 + stmt.bindString(2, conversationId);
  101 + }
  102 +
  103 + String mediaType = entity.getMediaType();
  104 + if (mediaType != null) {
  105 + stmt.bindString(3, mediaType);
  106 + }
  107 +
  108 + String thumbPath = entity.getThumbPath();
  109 + if (thumbPath != null) {
  110 + stmt.bindString(4, thumbPath);
  111 + }
  112 +
  113 + String videoDur = entity.getVideoDur();
  114 + if (videoDur != null) {
  115 + stmt.bindString(5, videoDur);
  116 + }
  117 +
  118 + Long cacheTime = entity.getCacheTime();
  119 + if (cacheTime != null) {
  120 + stmt.bindLong(6, cacheTime);
  121 + }
  122 + }
  123 +
  124 + @Override
  125 + public String readKey(Cursor cursor, int offset) {
  126 + return cursor.getString(offset + 0);
  127 + }
  128 +
  129 + @Override
  130 + public ChatMedia readEntity(Cursor cursor, int offset) {
  131 + ChatMedia entity = new ChatMedia( //
  132 + cursor.getString(offset + 0), // cachePath
  133 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // conversationId
  134 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // mediaType
  135 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // thumbPath
  136 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // videoDur
  137 + cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5) // cacheTime
  138 + );
  139 + return entity;
  140 + }
  141 +
  142 + @Override
  143 + public void readEntity(Cursor cursor, ChatMedia entity, int offset) {
  144 + entity.setCachePath(cursor.getString(offset + 0));
  145 + entity.setConversationId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  146 + entity.setMediaType(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  147 + entity.setThumbPath(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  148 + entity.setVideoDur(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  149 + entity.setCacheTime(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));
  150 + }
  151 +
  152 + @Override
  153 + protected final String updateKeyAfterInsert(ChatMedia entity, long rowId) {
  154 + return entity.getCachePath();
  155 + }
  156 +
  157 + @Override
  158 + public String getKey(ChatMedia entity) {
  159 + if(entity != null) {
  160 + return entity.getCachePath();
  161 + } else {
  162 + return null;
  163 + }
  164 + }
  165 +
  166 + @Override
  167 + public boolean hasKey(ChatMedia entity) {
  168 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  169 + }
  170 +
  171 + @Override
  172 + protected final boolean isEntityUpdateable() {
  173 + return true;
  174 + }
  175 +
  176 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ContactListDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ContactList;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CONTACT_LIST".
  17 +*/
  18 +public class ContactListDao extends AbstractDao<ContactList, String> {
  19 +
  20 + public static final String TABLENAME = "CONTACT_LIST";
  21 +
  22 + /**
  23 + * Properties of entity ContactList.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property FriendId = new Property(0, String.class, "friendId", true, "FRIEND_ID");
  28 + public final static Property FriendFaceUrl = new Property(1, String.class, "friendFaceUrl", false, "FRIEND_FACE_URL");
  29 + public final static Property FriendNickName = new Property(2, String.class, "friendNickName", false, "FRIEND_NICK_NAME");
  30 + public final static Property FriendRemark = new Property(3, String.class, "friendRemark", false, "FRIEND_REMARK");
  31 + public final static Property FriendCustomInfoJson = new Property(4, String.class, "friendCustomInfoJson", false, "FRIEND_CUSTOM_INFO_JSON");
  32 + }
  33 +
  34 +
  35 + public ContactListDao(DaoConfig config) {
  36 + super(config);
  37 + }
  38 +
  39 + public ContactListDao(DaoConfig config, DaoSession daoSession) {
  40 + super(config, daoSession);
  41 + }
  42 +
  43 + /** Creates the underlying database table. */
  44 + public static void createTable(Database db, boolean ifNotExists) {
  45 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  46 + db.execSQL("CREATE TABLE " + constraint + "\"CONTACT_LIST\" (" + //
  47 + "\"FRIEND_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: friendId
  48 + "\"FRIEND_FACE_URL\" TEXT," + // 1: friendFaceUrl
  49 + "\"FRIEND_NICK_NAME\" TEXT," + // 2: friendNickName
  50 + "\"FRIEND_REMARK\" TEXT," + // 3: friendRemark
  51 + "\"FRIEND_CUSTOM_INFO_JSON\" TEXT);"); // 4: friendCustomInfoJson
  52 + }
  53 +
  54 + /** Drops the underlying database table. */
  55 + public static void dropTable(Database db, boolean ifExists) {
  56 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CONTACT_LIST\"";
  57 + db.execSQL(sql);
  58 + }
  59 +
  60 + @Override
  61 + protected final void bindValues(DatabaseStatement stmt, ContactList entity) {
  62 + stmt.clearBindings();
  63 + stmt.bindString(1, entity.getFriendId());
  64 +
  65 + String friendFaceUrl = entity.getFriendFaceUrl();
  66 + if (friendFaceUrl != null) {
  67 + stmt.bindString(2, friendFaceUrl);
  68 + }
  69 +
  70 + String friendNickName = entity.getFriendNickName();
  71 + if (friendNickName != null) {
  72 + stmt.bindString(3, friendNickName);
  73 + }
  74 +
  75 + String friendRemark = entity.getFriendRemark();
  76 + if (friendRemark != null) {
  77 + stmt.bindString(4, friendRemark);
  78 + }
  79 +
  80 + String friendCustomInfoJson = entity.getFriendCustomInfoJson();
  81 + if (friendCustomInfoJson != null) {
  82 + stmt.bindString(5, friendCustomInfoJson);
  83 + }
  84 + }
  85 +
  86 + @Override
  87 + protected final void bindValues(SQLiteStatement stmt, ContactList entity) {
  88 + stmt.clearBindings();
  89 + stmt.bindString(1, entity.getFriendId());
  90 +
  91 + String friendFaceUrl = entity.getFriendFaceUrl();
  92 + if (friendFaceUrl != null) {
  93 + stmt.bindString(2, friendFaceUrl);
  94 + }
  95 +
  96 + String friendNickName = entity.getFriendNickName();
  97 + if (friendNickName != null) {
  98 + stmt.bindString(3, friendNickName);
  99 + }
  100 +
  101 + String friendRemark = entity.getFriendRemark();
  102 + if (friendRemark != null) {
  103 + stmt.bindString(4, friendRemark);
  104 + }
  105 +
  106 + String friendCustomInfoJson = entity.getFriendCustomInfoJson();
  107 + if (friendCustomInfoJson != null) {
  108 + stmt.bindString(5, friendCustomInfoJson);
  109 + }
  110 + }
  111 +
  112 + @Override
  113 + public String readKey(Cursor cursor, int offset) {
  114 + return cursor.getString(offset + 0);
  115 + }
  116 +
  117 + @Override
  118 + public ContactList readEntity(Cursor cursor, int offset) {
  119 + ContactList entity = new ContactList( //
  120 + cursor.getString(offset + 0), // friendId
  121 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // friendFaceUrl
  122 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // friendNickName
  123 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // friendRemark
  124 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4) // friendCustomInfoJson
  125 + );
  126 + return entity;
  127 + }
  128 +
  129 + @Override
  130 + public void readEntity(Cursor cursor, ContactList entity, int offset) {
  131 + entity.setFriendId(cursor.getString(offset + 0));
  132 + entity.setFriendFaceUrl(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  133 + entity.setFriendNickName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  134 + entity.setFriendRemark(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  135 + entity.setFriendCustomInfoJson(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  136 + }
  137 +
  138 + @Override
  139 + protected final String updateKeyAfterInsert(ContactList entity, long rowId) {
  140 + return entity.getFriendId();
  141 + }
  142 +
  143 + @Override
  144 + public String getKey(ContactList entity) {
  145 + if(entity != null) {
  146 + return entity.getFriendId();
  147 + } else {
  148 + return null;
  149 + }
  150 + }
  151 +
  152 + @Override
  153 + public boolean hasKey(ContactList entity) {
  154 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  155 + }
  156 +
  157 + @Override
  158 + protected final boolean isEntityUpdateable() {
  159 + return true;
  160 + }
  161 +
  162 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ContanctDaRenEntityDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ContanctDaRenEntity;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CONTANCT_DA_REN_ENTITY".
  17 +*/
  18 +public class ContanctDaRenEntityDao extends AbstractDao<ContanctDaRenEntity, String> {
  19 +
  20 + public static final String TABLENAME = "CONTANCT_DA_REN_ENTITY";
  21 +
  22 + /**
  23 + * Properties of entity ContanctDaRenEntity.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Uid = new Property(0, String.class, "uid", true, "UID");
  28 + public final static Property CacheData = new Property(1, String.class, "cacheData", false, "CACHE_DATA");
  29 + }
  30 +
  31 +
  32 + public ContanctDaRenEntityDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public ContanctDaRenEntityDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"CONTANCT_DA_REN_ENTITY\" (" + //
  44 + "\"UID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uid
  45 + "\"CACHE_DATA\" TEXT);"); // 1: cacheData
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CONTANCT_DA_REN_ENTITY\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, ContanctDaRenEntity entity) {
  56 + stmt.clearBindings();
  57 +
  58 + String uid = entity.getUid();
  59 + if (uid != null) {
  60 + stmt.bindString(1, uid);
  61 + }
  62 +
  63 + String cacheData = entity.getCacheData();
  64 + if (cacheData != null) {
  65 + stmt.bindString(2, cacheData);
  66 + }
  67 + }
  68 +
  69 + @Override
  70 + protected final void bindValues(SQLiteStatement stmt, ContanctDaRenEntity entity) {
  71 + stmt.clearBindings();
  72 +
  73 + String uid = entity.getUid();
  74 + if (uid != null) {
  75 + stmt.bindString(1, uid);
  76 + }
  77 +
  78 + String cacheData = entity.getCacheData();
  79 + if (cacheData != null) {
  80 + stmt.bindString(2, cacheData);
  81 + }
  82 + }
  83 +
  84 + @Override
  85 + public String readKey(Cursor cursor, int offset) {
  86 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  87 + }
  88 +
  89 + @Override
  90 + public ContanctDaRenEntity readEntity(Cursor cursor, int offset) {
  91 + ContanctDaRenEntity entity = new ContanctDaRenEntity( //
  92 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uid
  93 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // cacheData
  94 + );
  95 + return entity;
  96 + }
  97 +
  98 + @Override
  99 + public void readEntity(Cursor cursor, ContanctDaRenEntity entity, int offset) {
  100 + entity.setUid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  101 + entity.setCacheData(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  102 + }
  103 +
  104 + @Override
  105 + protected final String updateKeyAfterInsert(ContanctDaRenEntity entity, long rowId) {
  106 + return entity.getUid();
  107 + }
  108 +
  109 + @Override
  110 + public String getKey(ContanctDaRenEntity entity) {
  111 + if(entity != null) {
  112 + return entity.getUid();
  113 + } else {
  114 + return null;
  115 + }
  116 + }
  117 +
  118 + @Override
  119 + public boolean hasKey(ContanctDaRenEntity entity) {
  120 + return entity.getUid() != null;
  121 + }
  122 +
  123 + @Override
  124 + protected final boolean isEntityUpdateable() {
  125 + return true;
  126 + }
  127 +
  128 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ContanctGroupChatEntityDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ContanctGroupChatEntity;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "CONTANCT_GROUP_CHAT_ENTITY".
  17 +*/
  18 +public class ContanctGroupChatEntityDao extends AbstractDao<ContanctGroupChatEntity, String> {
  19 +
  20 + public static final String TABLENAME = "CONTANCT_GROUP_CHAT_ENTITY";
  21 +
  22 + /**
  23 + * Properties of entity ContanctGroupChatEntity.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Uid = new Property(0, String.class, "uid", true, "UID");
  28 + public final static Property CacheGroupListData = new Property(1, String.class, "cacheGroupListData", false, "CACHE_GROUP_LIST_DATA");
  29 + public final static Property CacheRequestNetData = new Property(2, String.class, "cacheRequestNetData", false, "CACHE_REQUEST_NET_DATA");
  30 + }
  31 +
  32 +
  33 + public ContanctGroupChatEntityDao(DaoConfig config) {
  34 + super(config);
  35 + }
  36 +
  37 + public ContanctGroupChatEntityDao(DaoConfig config, DaoSession daoSession) {
  38 + super(config, daoSession);
  39 + }
  40 +
  41 + /** Creates the underlying database table. */
  42 + public static void createTable(Database db, boolean ifNotExists) {
  43 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  44 + db.execSQL("CREATE TABLE " + constraint + "\"CONTANCT_GROUP_CHAT_ENTITY\" (" + //
  45 + "\"UID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uid
  46 + "\"CACHE_GROUP_LIST_DATA\" TEXT," + // 1: cacheGroupListData
  47 + "\"CACHE_REQUEST_NET_DATA\" TEXT);"); // 2: cacheRequestNetData
  48 + }
  49 +
  50 + /** Drops the underlying database table. */
  51 + public static void dropTable(Database db, boolean ifExists) {
  52 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"CONTANCT_GROUP_CHAT_ENTITY\"";
  53 + db.execSQL(sql);
  54 + }
  55 +
  56 + @Override
  57 + protected final void bindValues(DatabaseStatement stmt, ContanctGroupChatEntity entity) {
  58 + stmt.clearBindings();
  59 +
  60 + String uid = entity.getUid();
  61 + if (uid != null) {
  62 + stmt.bindString(1, uid);
  63 + }
  64 +
  65 + String cacheGroupListData = entity.getCacheGroupListData();
  66 + if (cacheGroupListData != null) {
  67 + stmt.bindString(2, cacheGroupListData);
  68 + }
  69 +
  70 + String cacheRequestNetData = entity.getCacheRequestNetData();
  71 + if (cacheRequestNetData != null) {
  72 + stmt.bindString(3, cacheRequestNetData);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + protected final void bindValues(SQLiteStatement stmt, ContanctGroupChatEntity entity) {
  78 + stmt.clearBindings();
  79 +
  80 + String uid = entity.getUid();
  81 + if (uid != null) {
  82 + stmt.bindString(1, uid);
  83 + }
  84 +
  85 + String cacheGroupListData = entity.getCacheGroupListData();
  86 + if (cacheGroupListData != null) {
  87 + stmt.bindString(2, cacheGroupListData);
  88 + }
  89 +
  90 + String cacheRequestNetData = entity.getCacheRequestNetData();
  91 + if (cacheRequestNetData != null) {
  92 + stmt.bindString(3, cacheRequestNetData);
  93 + }
  94 + }
  95 +
  96 + @Override
  97 + public String readKey(Cursor cursor, int offset) {
  98 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  99 + }
  100 +
  101 + @Override
  102 + public ContanctGroupChatEntity readEntity(Cursor cursor, int offset) {
  103 + ContanctGroupChatEntity entity = new ContanctGroupChatEntity( //
  104 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uid
  105 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // cacheGroupListData
  106 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2) // cacheRequestNetData
  107 + );
  108 + return entity;
  109 + }
  110 +
  111 + @Override
  112 + public void readEntity(Cursor cursor, ContanctGroupChatEntity entity, int offset) {
  113 + entity.setUid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  114 + entity.setCacheGroupListData(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  115 + entity.setCacheRequestNetData(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  116 + }
  117 +
  118 + @Override
  119 + protected final String updateKeyAfterInsert(ContanctGroupChatEntity entity, long rowId) {
  120 + return entity.getUid();
  121 + }
  122 +
  123 + @Override
  124 + public String getKey(ContanctGroupChatEntity entity) {
  125 + if(entity != null) {
  126 + return entity.getUid();
  127 + } else {
  128 + return null;
  129 + }
  130 + }
  131 +
  132 + @Override
  133 + public boolean hasKey(ContanctGroupChatEntity entity) {
  134 + return entity.getUid() != null;
  135 + }
  136 +
  137 + @Override
  138 + protected final boolean isEntityUpdateable() {
  139 + return true;
  140 + }
  141 +
  142 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DBFriendCircleMessageDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.DBFriendCircleMessage;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "DBFRIEND_CIRCLE_MESSAGE".
  17 +*/
  18 +public class DBFriendCircleMessageDao extends AbstractDao<DBFriendCircleMessage, String> {
  19 +
  20 + public static final String TABLENAME = "DBFRIEND_CIRCLE_MESSAGE";
  21 +
  22 + /**
  23 + * Properties of entity DBFriendCircleMessage.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Time = new Property(0, String.class, "time", true, "TIME");
  28 + public final static Property Sid = new Property(1, String.class, "sid", false, "SID");
  29 + public final static Property MomentId = new Property(2, String.class, "momentId", false, "MOMENT_ID");
  30 + public final static Property UserIcon = new Property(3, String.class, "userIcon", false, "USER_ICON");
  31 + public final static Property UserName = new Property(4, String.class, "userName", false, "USER_NAME");
  32 + public final static Property Message = new Property(5, String.class, "message", false, "MESSAGE");
  33 + public final static Property ContentImage = new Property(6, String.class, "contentImage", false, "CONTENT_IMAGE");
  34 + public final static Property ContentType = new Property(7, String.class, "contentType", false, "CONTENT_TYPE");
  35 + public final static Property ContentTitle = new Property(8, String.class, "contentTitle", false, "CONTENT_TITLE");
  36 + }
  37 +
  38 +
  39 + public DBFriendCircleMessageDao(DaoConfig config) {
  40 + super(config);
  41 + }
  42 +
  43 + public DBFriendCircleMessageDao(DaoConfig config, DaoSession daoSession) {
  44 + super(config, daoSession);
  45 + }
  46 +
  47 + /** Creates the underlying database table. */
  48 + public static void createTable(Database db, boolean ifNotExists) {
  49 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  50 + db.execSQL("CREATE TABLE " + constraint + "\"DBFRIEND_CIRCLE_MESSAGE\" (" + //
  51 + "\"TIME\" TEXT PRIMARY KEY NOT NULL ," + // 0: time
  52 + "\"SID\" TEXT," + // 1: sid
  53 + "\"MOMENT_ID\" TEXT," + // 2: momentId
  54 + "\"USER_ICON\" TEXT," + // 3: userIcon
  55 + "\"USER_NAME\" TEXT," + // 4: userName
  56 + "\"MESSAGE\" TEXT," + // 5: message
  57 + "\"CONTENT_IMAGE\" TEXT," + // 6: contentImage
  58 + "\"CONTENT_TYPE\" TEXT," + // 7: contentType
  59 + "\"CONTENT_TITLE\" TEXT);"); // 8: contentTitle
  60 + }
  61 +
  62 + /** Drops the underlying database table. */
  63 + public static void dropTable(Database db, boolean ifExists) {
  64 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DBFRIEND_CIRCLE_MESSAGE\"";
  65 + db.execSQL(sql);
  66 + }
  67 +
  68 + @Override
  69 + protected final void bindValues(DatabaseStatement stmt, DBFriendCircleMessage entity) {
  70 + stmt.clearBindings();
  71 + stmt.bindString(1, entity.getTime());
  72 +
  73 + String sid = entity.getSid();
  74 + if (sid != null) {
  75 + stmt.bindString(2, sid);
  76 + }
  77 +
  78 + String momentId = entity.getMomentId();
  79 + if (momentId != null) {
  80 + stmt.bindString(3, momentId);
  81 + }
  82 +
  83 + String userIcon = entity.getUserIcon();
  84 + if (userIcon != null) {
  85 + stmt.bindString(4, userIcon);
  86 + }
  87 +
  88 + String userName = entity.getUserName();
  89 + if (userName != null) {
  90 + stmt.bindString(5, userName);
  91 + }
  92 +
  93 + String message = entity.getMessage();
  94 + if (message != null) {
  95 + stmt.bindString(6, message);
  96 + }
  97 +
  98 + String contentImage = entity.getContentImage();
  99 + if (contentImage != null) {
  100 + stmt.bindString(7, contentImage);
  101 + }
  102 +
  103 + String contentType = entity.getContentType();
  104 + if (contentType != null) {
  105 + stmt.bindString(8, contentType);
  106 + }
  107 +
  108 + String contentTitle = entity.getContentTitle();
  109 + if (contentTitle != null) {
  110 + stmt.bindString(9, contentTitle);
  111 + }
  112 + }
  113 +
  114 + @Override
  115 + protected final void bindValues(SQLiteStatement stmt, DBFriendCircleMessage entity) {
  116 + stmt.clearBindings();
  117 + stmt.bindString(1, entity.getTime());
  118 +
  119 + String sid = entity.getSid();
  120 + if (sid != null) {
  121 + stmt.bindString(2, sid);
  122 + }
  123 +
  124 + String momentId = entity.getMomentId();
  125 + if (momentId != null) {
  126 + stmt.bindString(3, momentId);
  127 + }
  128 +
  129 + String userIcon = entity.getUserIcon();
  130 + if (userIcon != null) {
  131 + stmt.bindString(4, userIcon);
  132 + }
  133 +
  134 + String userName = entity.getUserName();
  135 + if (userName != null) {
  136 + stmt.bindString(5, userName);
  137 + }
  138 +
  139 + String message = entity.getMessage();
  140 + if (message != null) {
  141 + stmt.bindString(6, message);
  142 + }
  143 +
  144 + String contentImage = entity.getContentImage();
  145 + if (contentImage != null) {
  146 + stmt.bindString(7, contentImage);
  147 + }
  148 +
  149 + String contentType = entity.getContentType();
  150 + if (contentType != null) {
  151 + stmt.bindString(8, contentType);
  152 + }
  153 +
  154 + String contentTitle = entity.getContentTitle();
  155 + if (contentTitle != null) {
  156 + stmt.bindString(9, contentTitle);
  157 + }
  158 + }
  159 +
  160 + @Override
  161 + public String readKey(Cursor cursor, int offset) {
  162 + return cursor.getString(offset + 0);
  163 + }
  164 +
  165 + @Override
  166 + public DBFriendCircleMessage readEntity(Cursor cursor, int offset) {
  167 + DBFriendCircleMessage entity = new DBFriendCircleMessage( //
  168 + cursor.getString(offset + 0), // time
  169 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // sid
  170 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // momentId
  171 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // userIcon
  172 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // userName
  173 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // message
  174 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // contentImage
  175 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // contentType
  176 + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8) // contentTitle
  177 + );
  178 + return entity;
  179 + }
  180 +
  181 + @Override
  182 + public void readEntity(Cursor cursor, DBFriendCircleMessage entity, int offset) {
  183 + entity.setTime(cursor.getString(offset + 0));
  184 + entity.setSid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  185 + entity.setMomentId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  186 + entity.setUserIcon(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  187 + entity.setUserName(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  188 + entity.setMessage(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  189 + entity.setContentImage(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  190 + entity.setContentType(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  191 + entity.setContentTitle(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
  192 + }
  193 +
  194 + @Override
  195 + protected final String updateKeyAfterInsert(DBFriendCircleMessage entity, long rowId) {
  196 + return entity.getTime();
  197 + }
  198 +
  199 + @Override
  200 + public String getKey(DBFriendCircleMessage entity) {
  201 + if(entity != null) {
  202 + return entity.getTime();
  203 + } else {
  204 + return null;
  205 + }
  206 + }
  207 +
  208 + @Override
  209 + public boolean hasKey(DBFriendCircleMessage entity) {
  210 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  211 + }
  212 +
  213 + @Override
  214 + protected final boolean isEntityUpdateable() {
  215 + return true;
  216 + }
  217 +
  218 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DBMomentDetailDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.DBMomentDetail;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "DBMOMENT_DETAIL".
  17 +*/
  18 +public class DBMomentDetailDao extends AbstractDao<DBMomentDetail, String> {
  19 +
  20 + public static final String TABLENAME = "DBMOMENT_DETAIL";
  21 +
  22 + /**
  23 + * Properties of entity DBMomentDetail.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", true, "SID");
  28 + public final static Property Type = new Property(1, int.class, "type", false, "TYPE");
  29 + public final static Property UserIcon = new Property(2, String.class, "userIcon", false, "USER_ICON");
  30 + public final static Property UserName = new Property(3, String.class, "userName", false, "USER_NAME");
  31 + public final static Property Signature = new Property(4, String.class, "signature", false, "SIGNATURE");
  32 + }
  33 +
  34 + private DaoSession daoSession;
  35 +
  36 +
  37 + public DBMomentDetailDao(DaoConfig config) {
  38 + super(config);
  39 + }
  40 +
  41 + public DBMomentDetailDao(DaoConfig config, DaoSession daoSession) {
  42 + super(config, daoSession);
  43 + this.daoSession = daoSession;
  44 + }
  45 +
  46 + /** Creates the underlying database table. */
  47 + public static void createTable(Database db, boolean ifNotExists) {
  48 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  49 + db.execSQL("CREATE TABLE " + constraint + "\"DBMOMENT_DETAIL\" (" + //
  50 + "\"SID\" TEXT PRIMARY KEY NOT NULL ," + // 0: sid
  51 + "\"TYPE\" INTEGER NOT NULL ," + // 1: type
  52 + "\"USER_ICON\" TEXT NOT NULL ," + // 2: userIcon
  53 + "\"USER_NAME\" TEXT NOT NULL ," + // 3: userName
  54 + "\"SIGNATURE\" TEXT NOT NULL );"); // 4: signature
  55 + }
  56 +
  57 + /** Drops the underlying database table. */
  58 + public static void dropTable(Database db, boolean ifExists) {
  59 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DBMOMENT_DETAIL\"";
  60 + db.execSQL(sql);
  61 + }
  62 +
  63 + @Override
  64 + protected final void bindValues(DatabaseStatement stmt, DBMomentDetail entity) {
  65 + stmt.clearBindings();
  66 +
  67 + String sid = entity.getSid();
  68 + if (sid != null) {
  69 + stmt.bindString(1, sid);
  70 + }
  71 + stmt.bindLong(2, entity.getType());
  72 + stmt.bindString(3, entity.getUserIcon());
  73 + stmt.bindString(4, entity.getUserName());
  74 + stmt.bindString(5, entity.getSignature());
  75 + }
  76 +
  77 + @Override
  78 + protected final void bindValues(SQLiteStatement stmt, DBMomentDetail entity) {
  79 + stmt.clearBindings();
  80 +
  81 + String sid = entity.getSid();
  82 + if (sid != null) {
  83 + stmt.bindString(1, sid);
  84 + }
  85 + stmt.bindLong(2, entity.getType());
  86 + stmt.bindString(3, entity.getUserIcon());
  87 + stmt.bindString(4, entity.getUserName());
  88 + stmt.bindString(5, entity.getSignature());
  89 + }
  90 +
  91 + @Override
  92 + protected final void attachEntity(DBMomentDetail entity) {
  93 + super.attachEntity(entity);
  94 + entity.__setDaoSession(daoSession);
  95 + }
  96 +
  97 + @Override
  98 + public String readKey(Cursor cursor, int offset) {
  99 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  100 + }
  101 +
  102 + @Override
  103 + public DBMomentDetail readEntity(Cursor cursor, int offset) {
  104 + DBMomentDetail entity = new DBMomentDetail( //
  105 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // sid
  106 + cursor.getInt(offset + 1), // type
  107 + cursor.getString(offset + 2), // userIcon
  108 + cursor.getString(offset + 3), // userName
  109 + cursor.getString(offset + 4) // signature
  110 + );
  111 + return entity;
  112 + }
  113 +
  114 + @Override
  115 + public void readEntity(Cursor cursor, DBMomentDetail entity, int offset) {
  116 + entity.setSid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  117 + entity.setType(cursor.getInt(offset + 1));
  118 + entity.setUserIcon(cursor.getString(offset + 2));
  119 + entity.setUserName(cursor.getString(offset + 3));
  120 + entity.setSignature(cursor.getString(offset + 4));
  121 + }
  122 +
  123 + @Override
  124 + protected final String updateKeyAfterInsert(DBMomentDetail entity, long rowId) {
  125 + return entity.getSid();
  126 + }
  127 +
  128 + @Override
  129 + public String getKey(DBMomentDetail entity) {
  130 + if(entity != null) {
  131 + return entity.getSid();
  132 + } else {
  133 + return null;
  134 + }
  135 + }
  136 +
  137 + @Override
  138 + public boolean hasKey(DBMomentDetail entity) {
  139 + return entity.getSid() != null;
  140 + }
  141 +
  142 + @Override
  143 + protected final boolean isEntityUpdateable() {
  144 + return true;
  145 + }
  146 +
  147 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DBMomentItemDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import java.util.List;
  4 +import java.util.ArrayList;
  5 +import android.database.Cursor;
  6 +import android.database.sqlite.SQLiteStatement;
  7 +
  8 +import org.greenrobot.greendao.AbstractDao;
  9 +import org.greenrobot.greendao.Property;
  10 +import org.greenrobot.greendao.internal.SqlUtils;
  11 +import org.greenrobot.greendao.internal.DaoConfig;
  12 +import org.greenrobot.greendao.database.Database;
  13 +import org.greenrobot.greendao.database.DatabaseStatement;
  14 +import org.greenrobot.greendao.query.Query;
  15 +import org.greenrobot.greendao.query.QueryBuilder;
  16 +
  17 +import com.cnlive.database.bean.DBMomentDetail;
  18 +
  19 +import com.cnlive.database.bean.DBMomentItem;
  20 +
  21 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  22 +/**
  23 + * DAO for table "DBMOMENT_ITEM".
  24 +*/
  25 +public class DBMomentItemDao extends AbstractDao<DBMomentItem, String> {
  26 +
  27 + public static final String TABLENAME = "DBMOMENT_ITEM";
  28 +
  29 + /**
  30 + * Properties of entity DBMomentItem.<br/>
  31 + * Can be used for QueryBuilder and for referencing column names.
  32 + */
  33 + public static class Properties {
  34 + public final static Property Id = new Property(0, String.class, "id", true, "ID");
  35 + public final static Property ItemId = new Property(1, String.class, "itemId", false, "ITEM_ID");
  36 + public final static Property MomentItemDetail = new Property(2, String.class, "momentItemDetail", false, "MOMENT_ITEM_DETAIL");
  37 + public final static Property Sid = new Property(3, String.class, "sid", false, "SID");
  38 + }
  39 +
  40 + private DaoSession daoSession;
  41 +
  42 + private Query<DBMomentItem> dBMomentDetail_MomentItemsQuery;
  43 +
  44 + public DBMomentItemDao(DaoConfig config) {
  45 + super(config);
  46 + }
  47 +
  48 + public DBMomentItemDao(DaoConfig config, DaoSession daoSession) {
  49 + super(config, daoSession);
  50 + this.daoSession = daoSession;
  51 + }
  52 +
  53 + /** Creates the underlying database table. */
  54 + public static void createTable(Database db, boolean ifNotExists) {
  55 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  56 + db.execSQL("CREATE TABLE " + constraint + "\"DBMOMENT_ITEM\" (" + //
  57 + "\"ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: id
  58 + "\"ITEM_ID\" TEXT," + // 1: itemId
  59 + "\"MOMENT_ITEM_DETAIL\" TEXT NOT NULL ," + // 2: momentItemDetail
  60 + "\"SID\" TEXT);"); // 3: sid
  61 + }
  62 +
  63 + /** Drops the underlying database table. */
  64 + public static void dropTable(Database db, boolean ifExists) {
  65 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DBMOMENT_ITEM\"";
  66 + db.execSQL(sql);
  67 + }
  68 +
  69 + @Override
  70 + protected final void bindValues(DatabaseStatement stmt, DBMomentItem entity) {
  71 + stmt.clearBindings();
  72 +
  73 + String id = entity.getId();
  74 + if (id != null) {
  75 + stmt.bindString(1, id);
  76 + }
  77 +
  78 + String itemId = entity.getItemId();
  79 + if (itemId != null) {
  80 + stmt.bindString(2, itemId);
  81 + }
  82 + stmt.bindString(3, entity.getMomentItemDetail());
  83 +
  84 + String sid = entity.getSid();
  85 + if (sid != null) {
  86 + stmt.bindString(4, sid);
  87 + }
  88 + }
  89 +
  90 + @Override
  91 + protected final void bindValues(SQLiteStatement stmt, DBMomentItem entity) {
  92 + stmt.clearBindings();
  93 +
  94 + String id = entity.getId();
  95 + if (id != null) {
  96 + stmt.bindString(1, id);
  97 + }
  98 +
  99 + String itemId = entity.getItemId();
  100 + if (itemId != null) {
  101 + stmt.bindString(2, itemId);
  102 + }
  103 + stmt.bindString(3, entity.getMomentItemDetail());
  104 +
  105 + String sid = entity.getSid();
  106 + if (sid != null) {
  107 + stmt.bindString(4, sid);
  108 + }
  109 + }
  110 +
  111 + @Override
  112 + protected final void attachEntity(DBMomentItem entity) {
  113 + super.attachEntity(entity);
  114 + entity.__setDaoSession(daoSession);
  115 + }
  116 +
  117 + @Override
  118 + public String readKey(Cursor cursor, int offset) {
  119 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  120 + }
  121 +
  122 + @Override
  123 + public DBMomentItem readEntity(Cursor cursor, int offset) {
  124 + DBMomentItem entity = new DBMomentItem( //
  125 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // id
  126 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // itemId
  127 + cursor.getString(offset + 2), // momentItemDetail
  128 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // sid
  129 + );
  130 + return entity;
  131 + }
  132 +
  133 + @Override
  134 + public void readEntity(Cursor cursor, DBMomentItem entity, int offset) {
  135 + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  136 + entity.setItemId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  137 + entity.setMomentItemDetail(cursor.getString(offset + 2));
  138 + entity.setSid(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  139 + }
  140 +
  141 + @Override
  142 + protected final String updateKeyAfterInsert(DBMomentItem entity, long rowId) {
  143 + return entity.getId();
  144 + }
  145 +
  146 + @Override
  147 + public String getKey(DBMomentItem entity) {
  148 + if(entity != null) {
  149 + return entity.getId();
  150 + } else {
  151 + return null;
  152 + }
  153 + }
  154 +
  155 + @Override
  156 + public boolean hasKey(DBMomentItem entity) {
  157 + return entity.getId() != null;
  158 + }
  159 +
  160 + @Override
  161 + protected final boolean isEntityUpdateable() {
  162 + return true;
  163 + }
  164 +
  165 + /** Internal query to resolve the "momentItems" to-many relationship of DBMomentDetail. */
  166 + public List<DBMomentItem> _queryDBMomentDetail_MomentItems(String sid) {
  167 + synchronized (this) {
  168 + if (dBMomentDetail_MomentItemsQuery == null) {
  169 + QueryBuilder<DBMomentItem> queryBuilder = queryBuilder();
  170 + queryBuilder.where(Properties.Sid.eq(null));
  171 + dBMomentDetail_MomentItemsQuery = queryBuilder.build();
  172 + }
  173 + }
  174 + Query<DBMomentItem> query = dBMomentDetail_MomentItemsQuery.forCurrentThread();
  175 + query.setParameter(0, sid);
  176 + return query.list();
  177 + }
  178 +
  179 + private String selectDeep;
  180 +
  181 + protected String getSelectDeep() {
  182 + if (selectDeep == null) {
  183 + StringBuilder builder = new StringBuilder("SELECT ");
  184 + SqlUtils.appendColumns(builder, "T", getAllColumns());
  185 + builder.append(',');
  186 + SqlUtils.appendColumns(builder, "T0", daoSession.getDBMomentDetailDao().getAllColumns());
  187 + builder.append(" FROM DBMOMENT_ITEM T");
  188 + builder.append(" LEFT JOIN DBMOMENT_DETAIL T0 ON T.\"SID\"=T0.\"SID\"");
  189 + builder.append(' ');
  190 + selectDeep = builder.toString();
  191 + }
  192 + return selectDeep;
  193 + }
  194 +
  195 + protected DBMomentItem loadCurrentDeep(Cursor cursor, boolean lock) {
  196 + DBMomentItem entity = loadCurrent(cursor, 0, lock);
  197 + int offset = getAllColumns().length;
  198 +
  199 + DBMomentDetail dBMomentDetail = loadCurrentOther(daoSession.getDBMomentDetailDao(), cursor, offset);
  200 + entity.setDBMomentDetail(dBMomentDetail);
  201 +
  202 + return entity;
  203 + }
  204 +
  205 + public DBMomentItem loadDeep(Long key) {
  206 + assertSinglePk();
  207 + if (key == null) {
  208 + return null;
  209 + }
  210 +
  211 + StringBuilder builder = new StringBuilder(getSelectDeep());
  212 + builder.append("WHERE ");
  213 + SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
  214 + String sql = builder.toString();
  215 +
  216 + String[] keyArray = new String[] { key.toString() };
  217 + Cursor cursor = db.rawQuery(sql, keyArray);
  218 +
  219 + try {
  220 + boolean available = cursor.moveToFirst();
  221 + if (!available) {
  222 + return null;
  223 + } else if (!cursor.isLast()) {
  224 + throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
  225 + }
  226 + return loadCurrentDeep(cursor, true);
  227 + } finally {
  228 + cursor.close();
  229 + }
  230 + }
  231 +
  232 + /** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
  233 + public List<DBMomentItem> loadAllDeepFromCursor(Cursor cursor) {
  234 + int count = cursor.getCount();
  235 + List<DBMomentItem> list = new ArrayList<DBMomentItem>(count);
  236 +
  237 + if (cursor.moveToFirst()) {
  238 + if (identityScope != null) {
  239 + identityScope.lock();
  240 + identityScope.reserveRoom(count);
  241 + }
  242 + try {
  243 + do {
  244 + list.add(loadCurrentDeep(cursor, false));
  245 + } while (cursor.moveToNext());
  246 + } finally {
  247 + if (identityScope != null) {
  248 + identityScope.unlock();
  249 + }
  250 + }
  251 + }
  252 + return list;
  253 + }
  254 +
  255 + protected List<DBMomentItem> loadDeepAllAndCloseCursor(Cursor cursor) {
  256 + try {
  257 + return loadAllDeepFromCursor(cursor);
  258 + } finally {
  259 + cursor.close();
  260 + }
  261 + }
  262 +
  263 +
  264 + /** A raw-style query where you can pass any WHERE clause and arguments. */
  265 + public List<DBMomentItem> queryDeep(String where, String... selectionArg) {
  266 + Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
  267 + return loadDeepAllAndCloseCursor(cursor);
  268 + }
  269 +
  270 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DaoMaster.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.content.Context;
  4 +import android.database.sqlite.SQLiteDatabase;
  5 +import android.database.sqlite.SQLiteDatabase.CursorFactory;
  6 +import android.util.Log;
  7 +
  8 +import org.greenrobot.greendao.AbstractDaoMaster;
  9 +import org.greenrobot.greendao.database.StandardDatabase;
  10 +import org.greenrobot.greendao.database.Database;
  11 +import org.greenrobot.greendao.database.DatabaseOpenHelper;
  12 +import org.greenrobot.greendao.identityscope.IdentityScopeType;
  13 +
  14 +
  15 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  16 +/**
  17 + * Master of DAO (schema version 1): knows all DAOs.
  18 + */
  19 +public class DaoMaster extends AbstractDaoMaster {
  20 + public static final int SCHEMA_VERSION = 1;
  21 +
  22 + /** Creates underlying database table using DAOs. */
  23 + public static void createAllTables(Database db, boolean ifNotExists) {
  24 + AudioPlayHistoricalRecordDao.createTable(db, ifNotExists);
  25 + AudioPlayLastInfoDao.createTable(db, ifNotExists);
  26 + ChatFileMsgDao.createTable(db, ifNotExists);
  27 + ChatImageAndVideoMsgDao.createTable(db, ifNotExists);
  28 + ChatMediaDao.createTable(db, ifNotExists);
  29 + ContactListDao.createTable(db, ifNotExists);
  30 + ContanctDaRenEntityDao.createTable(db, ifNotExists);
  31 + ContanctGroupChatEntityDao.createTable(db, ifNotExists);
  32 + DBFriendCircleMessageDao.createTable(db, ifNotExists);
  33 + DarenDetailMsgDao.createTable(db, ifNotExists);
  34 + DarenListMsgDao.createTable(db, ifNotExists);
  35 + DownloadInfoDao.createTable(db, ifNotExists);
  36 + ExceptionInfoDao.createTable(db, ifNotExists);
  37 + HolidayThemeInfoDao.createTable(db, ifNotExists);
  38 + IMConversationInfoDao.createTable(db, ifNotExists);
  39 + IMGroupFaceMemberIdsDao.createTable(db, ifNotExists);
  40 + IMGroupMembersDao.createTable(db, ifNotExists);
  41 + IMGroupMembersListDao.createTable(db, ifNotExists);
  42 + IMGroupMembersManagerListDao.createTable(db, ifNotExists);
  43 + IMUserInfoDao.createTable(db, ifNotExists);
  44 + LaunchAdInfoDao.createTable(db, ifNotExists);
  45 + NewContactFriendEntityDao.createTable(db, ifNotExists);
  46 + NewPhoneContactEntityDao.createTable(db, ifNotExists);
  47 + NewsNumberDao.createTable(db, ifNotExists);
  48 + SearchContentDao.createTable(db, ifNotExists);
  49 + SearchHistoryDao.createTable(db, ifNotExists);
  50 + SysNumReadableDao.createTable(db, ifNotExists);
  51 + WitnessDao.createTable(db, ifNotExists);
  52 + DBMomentDetailDao.createTable(db, ifNotExists);
  53 + DBMomentItemDao.createTable(db, ifNotExists);
  54 + TestInfoDao.createTable(db, ifNotExists);
  55 + }
  56 +
  57 + /** Drops underlying database table using DAOs. */
  58 + public static void dropAllTables(Database db, boolean ifExists) {
  59 + AudioPlayHistoricalRecordDao.dropTable(db, ifExists);
  60 + AudioPlayLastInfoDao.dropTable(db, ifExists);
  61 + ChatFileMsgDao.dropTable(db, ifExists);
  62 + ChatImageAndVideoMsgDao.dropTable(db, ifExists);
  63 + ChatMediaDao.dropTable(db, ifExists);
  64 + ContactListDao.dropTable(db, ifExists);
  65 + ContanctDaRenEntityDao.dropTable(db, ifExists);
  66 + ContanctGroupChatEntityDao.dropTable(db, ifExists);
  67 + DBFriendCircleMessageDao.dropTable(db, ifExists);
  68 + DarenDetailMsgDao.dropTable(db, ifExists);
  69 + DarenListMsgDao.dropTable(db, ifExists);
  70 + DownloadInfoDao.dropTable(db, ifExists);
  71 + ExceptionInfoDao.dropTable(db, ifExists);
  72 + HolidayThemeInfoDao.dropTable(db, ifExists);
  73 + IMConversationInfoDao.dropTable(db, ifExists);
  74 + IMGroupFaceMemberIdsDao.dropTable(db, ifExists);
  75 + IMGroupMembersDao.dropTable(db, ifExists);
  76 + IMGroupMembersListDao.dropTable(db, ifExists);
  77 + IMGroupMembersManagerListDao.dropTable(db, ifExists);
  78 + IMUserInfoDao.dropTable(db, ifExists);
  79 + LaunchAdInfoDao.dropTable(db, ifExists);
  80 + NewContactFriendEntityDao.dropTable(db, ifExists);
  81 + NewPhoneContactEntityDao.dropTable(db, ifExists);
  82 + NewsNumberDao.dropTable(db, ifExists);
  83 + SearchContentDao.dropTable(db, ifExists);
  84 + SearchHistoryDao.dropTable(db, ifExists);
  85 + SysNumReadableDao.dropTable(db, ifExists);
  86 + WitnessDao.dropTable(db, ifExists);
  87 + DBMomentDetailDao.dropTable(db, ifExists);
  88 + DBMomentItemDao.dropTable(db, ifExists);
  89 + TestInfoDao.dropTable(db, ifExists);
  90 + }
  91 +
  92 + /**
  93 + * WARNING: Drops all table on Upgrade! Use only during development.
  94 + * Convenience method using a {@link DevOpenHelper}.
  95 + */
  96 + public static DaoSession newDevSession(Context context, String name) {
  97 + Database db = new DevOpenHelper(context, name).getWritableDb();
  98 + DaoMaster daoMaster = new DaoMaster(db);
  99 + return daoMaster.newSession();
  100 + }
  101 +
  102 + public DaoMaster(SQLiteDatabase db) {
  103 + this(new StandardDatabase(db));
  104 + }
  105 +
  106 + public DaoMaster(Database db) {
  107 + super(db, SCHEMA_VERSION);
  108 + registerDaoClass(AudioPlayHistoricalRecordDao.class);
  109 + registerDaoClass(AudioPlayLastInfoDao.class);
  110 + registerDaoClass(ChatFileMsgDao.class);
  111 + registerDaoClass(ChatImageAndVideoMsgDao.class);
  112 + registerDaoClass(ChatMediaDao.class);
  113 + registerDaoClass(ContactListDao.class);
  114 + registerDaoClass(ContanctDaRenEntityDao.class);
  115 + registerDaoClass(ContanctGroupChatEntityDao.class);
  116 + registerDaoClass(DBFriendCircleMessageDao.class);
  117 + registerDaoClass(DarenDetailMsgDao.class);
  118 + registerDaoClass(DarenListMsgDao.class);
  119 + registerDaoClass(DownloadInfoDao.class);
  120 + registerDaoClass(ExceptionInfoDao.class);
  121 + registerDaoClass(HolidayThemeInfoDao.class);
  122 + registerDaoClass(IMConversationInfoDao.class);
  123 + registerDaoClass(IMGroupFaceMemberIdsDao.class);
  124 + registerDaoClass(IMGroupMembersDao.class);
  125 + registerDaoClass(IMGroupMembersListDao.class);
  126 + registerDaoClass(IMGroupMembersManagerListDao.class);
  127 + registerDaoClass(IMUserInfoDao.class);
  128 + registerDaoClass(LaunchAdInfoDao.class);
  129 + registerDaoClass(NewContactFriendEntityDao.class);
  130 + registerDaoClass(NewPhoneContactEntityDao.class);
  131 + registerDaoClass(NewsNumberDao.class);
  132 + registerDaoClass(SearchContentDao.class);
  133 + registerDaoClass(SearchHistoryDao.class);
  134 + registerDaoClass(SysNumReadableDao.class);
  135 + registerDaoClass(WitnessDao.class);
  136 + registerDaoClass(DBMomentDetailDao.class);
  137 + registerDaoClass(DBMomentItemDao.class);
  138 + registerDaoClass(TestInfoDao.class);
  139 + }
  140 +
  141 + public DaoSession newSession() {
  142 + return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
  143 + }
  144 +
  145 + public DaoSession newSession(IdentityScopeType type) {
  146 + return new DaoSession(db, type, daoConfigMap);
  147 + }
  148 +
  149 + /**
  150 + * Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} -
  151 + */
  152 + public static abstract class OpenHelper extends DatabaseOpenHelper {
  153 + public OpenHelper(Context context, String name) {
  154 + super(context, name, SCHEMA_VERSION);
  155 + }
  156 +
  157 + public OpenHelper(Context context, String name, CursorFactory factory) {
  158 + super(context, name, factory, SCHEMA_VERSION);
  159 + }
  160 +
  161 + @Override
  162 + public void onCreate(Database db) {
  163 + Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
  164 + createAllTables(db, false);
  165 + }
  166 + }
  167 +
  168 + /** WARNING: Drops all table on Upgrade! Use only during development. */
  169 + public static class DevOpenHelper extends OpenHelper {
  170 + public DevOpenHelper(Context context, String name) {
  171 + super(context, name);
  172 + }
  173 +
  174 + public DevOpenHelper(Context context, String name, CursorFactory factory) {
  175 + super(context, name, factory);
  176 + }
  177 +
  178 + @Override
  179 + public void onUpgrade(Database db, int oldVersion, int newVersion) {
  180 + Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
  181 + dropAllTables(db, true);
  182 + onCreate(db);
  183 + }
  184 + }
  185 +
  186 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DaoSession.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.greenrobot.greendao.AbstractDao;
  6 +import org.greenrobot.greendao.AbstractDaoSession;
  7 +import org.greenrobot.greendao.database.Database;
  8 +import org.greenrobot.greendao.identityscope.IdentityScopeType;
  9 +import org.greenrobot.greendao.internal.DaoConfig;
  10 +
  11 +import com.cnlive.database.bean.AudioPlayHistoricalRecord;
  12 +import com.cnlive.database.bean.AudioPlayLastInfo;
  13 +import com.cnlive.database.bean.ChatFileMsg;
  14 +import com.cnlive.database.bean.ChatImageAndVideoMsg;
  15 +import com.cnlive.database.bean.ChatMedia;
  16 +import com.cnlive.database.bean.ContactList;
  17 +import com.cnlive.database.bean.ContanctDaRenEntity;
  18 +import com.cnlive.database.bean.ContanctGroupChatEntity;
  19 +import com.cnlive.database.bean.DBFriendCircleMessage;
  20 +import com.cnlive.database.bean.DarenDetailMsg;
  21 +import com.cnlive.database.bean.DarenListMsg;
  22 +import com.cnlive.database.bean.DownloadInfo;
  23 +import com.cnlive.database.bean.ExceptionInfo;
  24 +import com.cnlive.database.bean.HolidayThemeInfo;
  25 +import com.cnlive.database.bean.IMConversationInfo;
  26 +import com.cnlive.database.bean.IMGroupFaceMemberIds;
  27 +import com.cnlive.database.bean.IMGroupMembers;
  28 +import com.cnlive.database.bean.IMGroupMembersList;
  29 +import com.cnlive.database.bean.IMGroupMembersManagerList;
  30 +import com.cnlive.database.bean.IMUserInfo;
  31 +import com.cnlive.database.bean.LaunchAdInfo;
  32 +import com.cnlive.database.bean.NewContactFriendEntity;
  33 +import com.cnlive.database.bean.NewPhoneContactEntity;
  34 +import com.cnlive.database.bean.NewsNumber;
  35 +import com.cnlive.database.bean.SearchContent;
  36 +import com.cnlive.database.bean.SearchHistory;
  37 +import com.cnlive.database.bean.SysNumReadable;
  38 +import com.cnlive.database.bean.Witness;
  39 +import com.cnlive.database.bean.DBMomentDetail;
  40 +import com.cnlive.database.bean.DBMomentItem;
  41 +
  42 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  43 +
  44 +/**
  45 + * {@inheritDoc}
  46 + *
  47 + * @see org.greenrobot.greendao.AbstractDaoSession
  48 + */
  49 +public class DaoSession extends AbstractDaoSession {
  50 +
  51 + private final DaoConfig audioPlayHistoricalRecordDaoConfig;
  52 + private final DaoConfig audioPlayLastInfoDaoConfig;
  53 + private final DaoConfig chatFileMsgDaoConfig;
  54 + private final DaoConfig chatImageAndVideoMsgDaoConfig;
  55 + private final DaoConfig chatMediaDaoConfig;
  56 + private final DaoConfig contactListDaoConfig;
  57 + private final DaoConfig contanctDaRenEntityDaoConfig;
  58 + private final DaoConfig contanctGroupChatEntityDaoConfig;
  59 + private final DaoConfig dBFriendCircleMessageDaoConfig;
  60 + private final DaoConfig darenDetailMsgDaoConfig;
  61 + private final DaoConfig darenListMsgDaoConfig;
  62 + private final DaoConfig downloadInfoDaoConfig;
  63 + private final DaoConfig exceptionInfoDaoConfig;
  64 + private final DaoConfig holidayThemeInfoDaoConfig;
  65 + private final DaoConfig iMConversationInfoDaoConfig;
  66 + private final DaoConfig iMGroupFaceMemberIdsDaoConfig;
  67 + private final DaoConfig iMGroupMembersDaoConfig;
  68 + private final DaoConfig iMGroupMembersListDaoConfig;
  69 + private final DaoConfig iMGroupMembersManagerListDaoConfig;
  70 + private final DaoConfig iMUserInfoDaoConfig;
  71 + private final DaoConfig launchAdInfoDaoConfig;
  72 + private final DaoConfig newContactFriendEntityDaoConfig;
  73 + private final DaoConfig newPhoneContactEntityDaoConfig;
  74 + private final DaoConfig newsNumberDaoConfig;
  75 + private final DaoConfig searchContentDaoConfig;
  76 + private final DaoConfig searchHistoryDaoConfig;
  77 + private final DaoConfig sysNumReadableDaoConfig;
  78 + private final DaoConfig witnessDaoConfig;
  79 + private final DaoConfig dBMomentDetailDaoConfig;
  80 + private final DaoConfig dBMomentItemDaoConfig;
  81 + private final DaoConfig testInfoDaoConfig;
  82 +
  83 + private final AudioPlayHistoricalRecordDao audioPlayHistoricalRecordDao;
  84 + private final AudioPlayLastInfoDao audioPlayLastInfoDao;
  85 + private final ChatFileMsgDao chatFileMsgDao;
  86 + private final ChatImageAndVideoMsgDao chatImageAndVideoMsgDao;
  87 + private final ChatMediaDao chatMediaDao;
  88 + private final ContactListDao contactListDao;
  89 + private final ContanctDaRenEntityDao contanctDaRenEntityDao;
  90 + private final ContanctGroupChatEntityDao contanctGroupChatEntityDao;
  91 + private final DBFriendCircleMessageDao dBFriendCircleMessageDao;
  92 + private final DarenDetailMsgDao darenDetailMsgDao;
  93 + private final DarenListMsgDao darenListMsgDao;
  94 + private final DownloadInfoDao downloadInfoDao;
  95 + private final ExceptionInfoDao exceptionInfoDao;
  96 + private final HolidayThemeInfoDao holidayThemeInfoDao;
  97 + private final IMConversationInfoDao iMConversationInfoDao;
  98 + private final IMGroupFaceMemberIdsDao iMGroupFaceMemberIdsDao;
  99 + private final IMGroupMembersDao iMGroupMembersDao;
  100 + private final IMGroupMembersListDao iMGroupMembersListDao;
  101 + private final IMGroupMembersManagerListDao iMGroupMembersManagerListDao;
  102 + private final IMUserInfoDao iMUserInfoDao;
  103 + private final LaunchAdInfoDao launchAdInfoDao;
  104 + private final NewContactFriendEntityDao newContactFriendEntityDao;
  105 + private final NewPhoneContactEntityDao newPhoneContactEntityDao;
  106 + private final NewsNumberDao newsNumberDao;
  107 + private final SearchContentDao searchContentDao;
  108 + private final SearchHistoryDao searchHistoryDao;
  109 + private final SysNumReadableDao sysNumReadableDao;
  110 + private final WitnessDao witnessDao;
  111 + private final DBMomentDetailDao dBMomentDetailDao;
  112 + private final DBMomentItemDao dBMomentItemDao;
  113 + private final TestInfoDao testInfoDao;
  114 +
  115 + public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
  116 + daoConfigMap) {
  117 + super(db);
  118 +
  119 + audioPlayHistoricalRecordDaoConfig = daoConfigMap.get(AudioPlayHistoricalRecordDao.class).clone();
  120 + audioPlayHistoricalRecordDaoConfig.initIdentityScope(type);
  121 +
  122 + audioPlayLastInfoDaoConfig = daoConfigMap.get(AudioPlayLastInfoDao.class).clone();
  123 + audioPlayLastInfoDaoConfig.initIdentityScope(type);
  124 +
  125 + chatFileMsgDaoConfig = daoConfigMap.get(ChatFileMsgDao.class).clone();
  126 + chatFileMsgDaoConfig.initIdentityScope(type);
  127 +
  128 + chatImageAndVideoMsgDaoConfig = daoConfigMap.get(ChatImageAndVideoMsgDao.class).clone();
  129 + chatImageAndVideoMsgDaoConfig.initIdentityScope(type);
  130 +
  131 + chatMediaDaoConfig = daoConfigMap.get(ChatMediaDao.class).clone();
  132 + chatMediaDaoConfig.initIdentityScope(type);
  133 +
  134 + contactListDaoConfig = daoConfigMap.get(ContactListDao.class).clone();
  135 + contactListDaoConfig.initIdentityScope(type);
  136 +
  137 + contanctDaRenEntityDaoConfig = daoConfigMap.get(ContanctDaRenEntityDao.class).clone();
  138 + contanctDaRenEntityDaoConfig.initIdentityScope(type);
  139 +
  140 + contanctGroupChatEntityDaoConfig = daoConfigMap.get(ContanctGroupChatEntityDao.class).clone();
  141 + contanctGroupChatEntityDaoConfig.initIdentityScope(type);
  142 +
  143 + dBFriendCircleMessageDaoConfig = daoConfigMap.get(DBFriendCircleMessageDao.class).clone();
  144 + dBFriendCircleMessageDaoConfig.initIdentityScope(type);
  145 +
  146 + darenDetailMsgDaoConfig = daoConfigMap.get(DarenDetailMsgDao.class).clone();
  147 + darenDetailMsgDaoConfig.initIdentityScope(type);
  148 +
  149 + darenListMsgDaoConfig = daoConfigMap.get(DarenListMsgDao.class).clone();
  150 + darenListMsgDaoConfig.initIdentityScope(type);
  151 +
  152 + downloadInfoDaoConfig = daoConfigMap.get(DownloadInfoDao.class).clone();
  153 + downloadInfoDaoConfig.initIdentityScope(type);
  154 +
  155 + exceptionInfoDaoConfig = daoConfigMap.get(ExceptionInfoDao.class).clone();
  156 + exceptionInfoDaoConfig.initIdentityScope(type);
  157 +
  158 + holidayThemeInfoDaoConfig = daoConfigMap.get(HolidayThemeInfoDao.class).clone();
  159 + holidayThemeInfoDaoConfig.initIdentityScope(type);
  160 +
  161 + iMConversationInfoDaoConfig = daoConfigMap.get(IMConversationInfoDao.class).clone();
  162 + iMConversationInfoDaoConfig.initIdentityScope(type);
  163 +
  164 + iMGroupFaceMemberIdsDaoConfig = daoConfigMap.get(IMGroupFaceMemberIdsDao.class).clone();
  165 + iMGroupFaceMemberIdsDaoConfig.initIdentityScope(type);
  166 +
  167 + iMGroupMembersDaoConfig = daoConfigMap.get(IMGroupMembersDao.class).clone();
  168 + iMGroupMembersDaoConfig.initIdentityScope(type);
  169 +
  170 + iMGroupMembersListDaoConfig = daoConfigMap.get(IMGroupMembersListDao.class).clone();
  171 + iMGroupMembersListDaoConfig.initIdentityScope(type);
  172 +
  173 + iMGroupMembersManagerListDaoConfig = daoConfigMap.get(IMGroupMembersManagerListDao.class).clone();
  174 + iMGroupMembersManagerListDaoConfig.initIdentityScope(type);
  175 +
  176 + iMUserInfoDaoConfig = daoConfigMap.get(IMUserInfoDao.class).clone();
  177 + iMUserInfoDaoConfig.initIdentityScope(type);
  178 +
  179 + launchAdInfoDaoConfig = daoConfigMap.get(LaunchAdInfoDao.class).clone();
  180 + launchAdInfoDaoConfig.initIdentityScope(type);
  181 +
  182 + newContactFriendEntityDaoConfig = daoConfigMap.get(NewContactFriendEntityDao.class).clone();
  183 + newContactFriendEntityDaoConfig.initIdentityScope(type);
  184 +
  185 + newPhoneContactEntityDaoConfig = daoConfigMap.get(NewPhoneContactEntityDao.class).clone();
  186 + newPhoneContactEntityDaoConfig.initIdentityScope(type);
  187 +
  188 + newsNumberDaoConfig = daoConfigMap.get(NewsNumberDao.class).clone();
  189 + newsNumberDaoConfig.initIdentityScope(type);
  190 +
  191 + searchContentDaoConfig = daoConfigMap.get(SearchContentDao.class).clone();
  192 + searchContentDaoConfig.initIdentityScope(type);
  193 +
  194 + searchHistoryDaoConfig = daoConfigMap.get(SearchHistoryDao.class).clone();
  195 + searchHistoryDaoConfig.initIdentityScope(type);
  196 +
  197 + sysNumReadableDaoConfig = daoConfigMap.get(SysNumReadableDao.class).clone();
  198 + sysNumReadableDaoConfig.initIdentityScope(type);
  199 +
  200 + witnessDaoConfig = daoConfigMap.get(WitnessDao.class).clone();
  201 + witnessDaoConfig.initIdentityScope(type);
  202 +
  203 + dBMomentDetailDaoConfig = daoConfigMap.get(DBMomentDetailDao.class).clone();
  204 + dBMomentDetailDaoConfig.initIdentityScope(type);
  205 +
  206 + dBMomentItemDaoConfig = daoConfigMap.get(DBMomentItemDao.class).clone();
  207 + dBMomentItemDaoConfig.initIdentityScope(type);
  208 +
  209 + testInfoDaoConfig = daoConfigMap.get(TestInfoDao.class).clone();
  210 + testInfoDaoConfig.initIdentityScope(type);
  211 +
  212 + audioPlayHistoricalRecordDao = new AudioPlayHistoricalRecordDao(audioPlayHistoricalRecordDaoConfig, this);
  213 + audioPlayLastInfoDao = new AudioPlayLastInfoDao(audioPlayLastInfoDaoConfig, this);
  214 + chatFileMsgDao = new ChatFileMsgDao(chatFileMsgDaoConfig, this);
  215 + chatImageAndVideoMsgDao = new ChatImageAndVideoMsgDao(chatImageAndVideoMsgDaoConfig, this);
  216 + chatMediaDao = new ChatMediaDao(chatMediaDaoConfig, this);
  217 + contactListDao = new ContactListDao(contactListDaoConfig, this);
  218 + contanctDaRenEntityDao = new ContanctDaRenEntityDao(contanctDaRenEntityDaoConfig, this);
  219 + contanctGroupChatEntityDao = new ContanctGroupChatEntityDao(contanctGroupChatEntityDaoConfig, this);
  220 + dBFriendCircleMessageDao = new DBFriendCircleMessageDao(dBFriendCircleMessageDaoConfig, this);
  221 + darenDetailMsgDao = new DarenDetailMsgDao(darenDetailMsgDaoConfig, this);
  222 + darenListMsgDao = new DarenListMsgDao(darenListMsgDaoConfig, this);
  223 + downloadInfoDao = new DownloadInfoDao(downloadInfoDaoConfig, this);
  224 + exceptionInfoDao = new ExceptionInfoDao(exceptionInfoDaoConfig, this);
  225 + holidayThemeInfoDao = new HolidayThemeInfoDao(holidayThemeInfoDaoConfig, this);
  226 + iMConversationInfoDao = new IMConversationInfoDao(iMConversationInfoDaoConfig, this);
  227 + iMGroupFaceMemberIdsDao = new IMGroupFaceMemberIdsDao(iMGroupFaceMemberIdsDaoConfig, this);
  228 + iMGroupMembersDao = new IMGroupMembersDao(iMGroupMembersDaoConfig, this);
  229 + iMGroupMembersListDao = new IMGroupMembersListDao(iMGroupMembersListDaoConfig, this);
  230 + iMGroupMembersManagerListDao = new IMGroupMembersManagerListDao(iMGroupMembersManagerListDaoConfig, this);
  231 + iMUserInfoDao = new IMUserInfoDao(iMUserInfoDaoConfig, this);
  232 + launchAdInfoDao = new LaunchAdInfoDao(launchAdInfoDaoConfig, this);
  233 + newContactFriendEntityDao = new NewContactFriendEntityDao(newContactFriendEntityDaoConfig, this);
  234 + newPhoneContactEntityDao = new NewPhoneContactEntityDao(newPhoneContactEntityDaoConfig, this);
  235 + newsNumberDao = new NewsNumberDao(newsNumberDaoConfig, this);
  236 + searchContentDao = new SearchContentDao(searchContentDaoConfig, this);
  237 + searchHistoryDao = new SearchHistoryDao(searchHistoryDaoConfig, this);
  238 + sysNumReadableDao = new SysNumReadableDao(sysNumReadableDaoConfig, this);
  239 + witnessDao = new WitnessDao(witnessDaoConfig, this);
  240 + dBMomentDetailDao = new DBMomentDetailDao(dBMomentDetailDaoConfig, this);
  241 + dBMomentItemDao = new DBMomentItemDao(dBMomentItemDaoConfig, this);
  242 + testInfoDao = new TestInfoDao(testInfoDaoConfig, this);
  243 +
  244 + registerDao(AudioPlayHistoricalRecord.class, audioPlayHistoricalRecordDao);
  245 + registerDao(AudioPlayLastInfo.class, audioPlayLastInfoDao);
  246 + registerDao(ChatFileMsg.class, chatFileMsgDao);
  247 + registerDao(ChatImageAndVideoMsg.class, chatImageAndVideoMsgDao);
  248 + registerDao(ChatMedia.class, chatMediaDao);
  249 + registerDao(ContactList.class, contactListDao);
  250 + registerDao(ContanctDaRenEntity.class, contanctDaRenEntityDao);
  251 + registerDao(ContanctGroupChatEntity.class, contanctGroupChatEntityDao);
  252 + registerDao(DBFriendCircleMessage.class, dBFriendCircleMessageDao);
  253 + registerDao(DarenDetailMsg.class, darenDetailMsgDao);
  254 + registerDao(DarenListMsg.class, darenListMsgDao);
  255 + registerDao(DownloadInfo.class, downloadInfoDao);
  256 + registerDao(ExceptionInfo.class, exceptionInfoDao);
  257 + registerDao(HolidayThemeInfo.class, holidayThemeInfoDao);
  258 + registerDao(IMConversationInfo.class, iMConversationInfoDao);
  259 + registerDao(IMGroupFaceMemberIds.class, iMGroupFaceMemberIdsDao);
  260 + registerDao(IMGroupMembers.class, iMGroupMembersDao);
  261 + registerDao(IMGroupMembersList.class, iMGroupMembersListDao);
  262 + registerDao(IMGroupMembersManagerList.class, iMGroupMembersManagerListDao);
  263 + registerDao(IMUserInfo.class, iMUserInfoDao);
  264 + registerDao(LaunchAdInfo.class, launchAdInfoDao);
  265 + registerDao(NewContactFriendEntity.class, newContactFriendEntityDao);
  266 + registerDao(NewPhoneContactEntity.class, newPhoneContactEntityDao);
  267 + registerDao(NewsNumber.class, newsNumberDao);
  268 + registerDao(SearchContent.class, searchContentDao);
  269 + registerDao(SearchHistory.class, searchHistoryDao);
  270 + registerDao(SysNumReadable.class, sysNumReadableDao);
  271 + registerDao(Witness.class, witnessDao);
  272 + registerDao(DBMomentDetail.class, dBMomentDetailDao);
  273 + registerDao(DBMomentItem.class, dBMomentItemDao);
  274 + registerDao(TestInfo.class, testInfoDao);
  275 + }
  276 +
  277 + public void clear() {
  278 + audioPlayHistoricalRecordDaoConfig.clearIdentityScope();
  279 + audioPlayLastInfoDaoConfig.clearIdentityScope();
  280 + chatFileMsgDaoConfig.clearIdentityScope();
  281 + chatImageAndVideoMsgDaoConfig.clearIdentityScope();
  282 + chatMediaDaoConfig.clearIdentityScope();
  283 + contactListDaoConfig.clearIdentityScope();
  284 + contanctDaRenEntityDaoConfig.clearIdentityScope();
  285 + contanctGroupChatEntityDaoConfig.clearIdentityScope();
  286 + dBFriendCircleMessageDaoConfig.clearIdentityScope();
  287 + darenDetailMsgDaoConfig.clearIdentityScope();
  288 + darenListMsgDaoConfig.clearIdentityScope();
  289 + downloadInfoDaoConfig.clearIdentityScope();
  290 + exceptionInfoDaoConfig.clearIdentityScope();
  291 + holidayThemeInfoDaoConfig.clearIdentityScope();
  292 + iMConversationInfoDaoConfig.clearIdentityScope();
  293 + iMGroupFaceMemberIdsDaoConfig.clearIdentityScope();
  294 + iMGroupMembersDaoConfig.clearIdentityScope();
  295 + iMGroupMembersListDaoConfig.clearIdentityScope();
  296 + iMGroupMembersManagerListDaoConfig.clearIdentityScope();
  297 + iMUserInfoDaoConfig.clearIdentityScope();
  298 + launchAdInfoDaoConfig.clearIdentityScope();
  299 + newContactFriendEntityDaoConfig.clearIdentityScope();
  300 + newPhoneContactEntityDaoConfig.clearIdentityScope();
  301 + newsNumberDaoConfig.clearIdentityScope();
  302 + searchContentDaoConfig.clearIdentityScope();
  303 + searchHistoryDaoConfig.clearIdentityScope();
  304 + sysNumReadableDaoConfig.clearIdentityScope();
  305 + witnessDaoConfig.clearIdentityScope();
  306 + dBMomentDetailDaoConfig.clearIdentityScope();
  307 + dBMomentItemDaoConfig.clearIdentityScope();
  308 + testInfoDaoConfig.clearIdentityScope();
  309 + }
  310 +
  311 + public AudioPlayHistoricalRecordDao getAudioPlayHistoricalRecordDao() {
  312 + return audioPlayHistoricalRecordDao;
  313 + }
  314 +
  315 + public AudioPlayLastInfoDao getAudioPlayLastInfoDao() {
  316 + return audioPlayLastInfoDao;
  317 + }
  318 +
  319 + public ChatFileMsgDao getChatFileMsgDao() {
  320 + return chatFileMsgDao;
  321 + }
  322 +
  323 + public ChatImageAndVideoMsgDao getChatImageAndVideoMsgDao() {
  324 + return chatImageAndVideoMsgDao;
  325 + }
  326 +
  327 + public ChatMediaDao getChatMediaDao() {
  328 + return chatMediaDao;
  329 + }
  330 +
  331 + public ContactListDao getContactListDao() {
  332 + return contactListDao;
  333 + }
  334 +
  335 + public ContanctDaRenEntityDao getContanctDaRenEntityDao() {
  336 + return contanctDaRenEntityDao;
  337 + }
  338 +
  339 + public ContanctGroupChatEntityDao getContanctGroupChatEntityDao() {
  340 + return contanctGroupChatEntityDao;
  341 + }
  342 +
  343 + public DBFriendCircleMessageDao getDBFriendCircleMessageDao() {
  344 + return dBFriendCircleMessageDao;
  345 + }
  346 +
  347 + public DarenDetailMsgDao getDarenDetailMsgDao() {
  348 + return darenDetailMsgDao;
  349 + }
  350 +
  351 + public DarenListMsgDao getDarenListMsgDao() {
  352 + return darenListMsgDao;
  353 + }
  354 +
  355 + public DownloadInfoDao getDownloadInfoDao() {
  356 + return downloadInfoDao;
  357 + }
  358 +
  359 + public ExceptionInfoDao getExceptionInfoDao() {
  360 + return exceptionInfoDao;
  361 + }
  362 +
  363 + public HolidayThemeInfoDao getHolidayThemeInfoDao() {
  364 + return holidayThemeInfoDao;
  365 + }
  366 +
  367 + public IMConversationInfoDao getIMConversationInfoDao() {
  368 + return iMConversationInfoDao;
  369 + }
  370 +
  371 + public IMGroupFaceMemberIdsDao getIMGroupFaceMemberIdsDao() {
  372 + return iMGroupFaceMemberIdsDao;
  373 + }
  374 +
  375 + public IMGroupMembersDao getIMGroupMembersDao() {
  376 + return iMGroupMembersDao;
  377 + }
  378 +
  379 + public IMGroupMembersListDao getIMGroupMembersListDao() {
  380 + return iMGroupMembersListDao;
  381 + }
  382 +
  383 + public IMGroupMembersManagerListDao getIMGroupMembersManagerListDao() {
  384 + return iMGroupMembersManagerListDao;
  385 + }
  386 +
  387 + public IMUserInfoDao getIMUserInfoDao() {
  388 + return iMUserInfoDao;
  389 + }
  390 +
  391 + public LaunchAdInfoDao getLaunchAdInfoDao() {
  392 + return launchAdInfoDao;
  393 + }
  394 +
  395 + public NewContactFriendEntityDao getNewContactFriendEntityDao() {
  396 + return newContactFriendEntityDao;
  397 + }
  398 +
  399 + public NewPhoneContactEntityDao getNewPhoneContactEntityDao() {
  400 + return newPhoneContactEntityDao;
  401 + }
  402 +
  403 + public NewsNumberDao getNewsNumberDao() {
  404 + return newsNumberDao;
  405 + }
  406 +
  407 + public SearchContentDao getSearchContentDao() {
  408 + return searchContentDao;
  409 + }
  410 +
  411 + public SearchHistoryDao getSearchHistoryDao() {
  412 + return searchHistoryDao;
  413 + }
  414 +
  415 + public SysNumReadableDao getSysNumReadableDao() {
  416 + return sysNumReadableDao;
  417 + }
  418 +
  419 + public WitnessDao getWitnessDao() {
  420 + return witnessDao;
  421 + }
  422 +
  423 + public DBMomentDetailDao getDBMomentDetailDao() {
  424 + return dBMomentDetailDao;
  425 + }
  426 +
  427 + public DBMomentItemDao getDBMomentItemDao() {
  428 + return dBMomentItemDao;
  429 + }
  430 +
  431 + public TestInfoDao getTestInfoDao() {
  432 + return testInfoDao;
  433 + }
  434 +
  435 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DarenDetailMsgDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.DarenDetailMsg;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "DAREN_DETAIL_MSG".
  17 +*/
  18 +public class DarenDetailMsgDao extends AbstractDao<DarenDetailMsg, String> {
  19 +
  20 + public static final String TABLENAME = "DAREN_DETAIL_MSG";
  21 +
  22 + /**
  23 + * Properties of entity DarenDetailMsg.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property DarenId = new Property(0, String.class, "darenId", true, "DAREN_ID");
  28 + public final static Property Image = new Property(1, String.class, "image", false, "IMAGE");
  29 + public final static Property CustSign = new Property(2, String.class, "custSign", false, "CUST_SIGN");
  30 + public final static Property FansNum = new Property(3, String.class, "fansNum", false, "FANS_NUM");
  31 + public final static Property Fan = new Property(4, Boolean.class, "fan", false, "FAN");
  32 + public final static Property Sid = new Property(5, String.class, "sid", false, "SID");
  33 + public final static Property Address = new Property(6, String.class, "address", false, "ADDRESS");
  34 + public final static Property ShopName = new Property(7, String.class, "shopName", false, "SHOP_NAME");
  35 + public final static Property Grade = new Property(8, Float.class, "grade", false, "GRADE");
  36 + public final static Property Online = new Property(9, Boolean.class, "online", false, "ONLINE");
  37 + public final static Property OrderCount = new Property(10, String.class, "orderCount", false, "ORDER_COUNT");
  38 + public final static Property CommentCount = new Property(11, String.class, "commentCount", false, "COMMENT_COUNT");
  39 + public final static Property Propagandas = new Property(12, String.class, "propagandas", false, "PROPAGANDAS");
  40 + public final static Property Content = new Property(13, String.class, "content", false, "CONTENT");
  41 + public final static Property Category = new Property(14, String.class, "category", false, "CATEGORY");
  42 + }
  43 +
  44 +
  45 + public DarenDetailMsgDao(DaoConfig config) {
  46 + super(config);
  47 + }
  48 +
  49 + public DarenDetailMsgDao(DaoConfig config, DaoSession daoSession) {
  50 + super(config, daoSession);
  51 + }
  52 +
  53 + /** Creates the underlying database table. */
  54 + public static void createTable(Database db, boolean ifNotExists) {
  55 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  56 + db.execSQL("CREATE TABLE " + constraint + "\"DAREN_DETAIL_MSG\" (" + //
  57 + "\"DAREN_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: darenId
  58 + "\"IMAGE\" TEXT," + // 1: image
  59 + "\"CUST_SIGN\" TEXT," + // 2: custSign
  60 + "\"FANS_NUM\" TEXT," + // 3: fansNum
  61 + "\"FAN\" INTEGER," + // 4: fan
  62 + "\"SID\" TEXT," + // 5: sid
  63 + "\"ADDRESS\" TEXT," + // 6: address
  64 + "\"SHOP_NAME\" TEXT," + // 7: shopName
  65 + "\"GRADE\" REAL," + // 8: grade
  66 + "\"ONLINE\" INTEGER," + // 9: online
  67 + "\"ORDER_COUNT\" TEXT," + // 10: orderCount
  68 + "\"COMMENT_COUNT\" TEXT," + // 11: commentCount
  69 + "\"PROPAGANDAS\" TEXT," + // 12: propagandas
  70 + "\"CONTENT\" TEXT," + // 13: content
  71 + "\"CATEGORY\" TEXT);"); // 14: category
  72 + }
  73 +
  74 + /** Drops the underlying database table. */
  75 + public static void dropTable(Database db, boolean ifExists) {
  76 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DAREN_DETAIL_MSG\"";
  77 + db.execSQL(sql);
  78 + }
  79 +
  80 + @Override
  81 + protected final void bindValues(DatabaseStatement stmt, DarenDetailMsg entity) {
  82 + stmt.clearBindings();
  83 +
  84 + String darenId = entity.getDarenId();
  85 + if (darenId != null) {
  86 + stmt.bindString(1, darenId);
  87 + }
  88 +
  89 + String image = entity.getImage();
  90 + if (image != null) {
  91 + stmt.bindString(2, image);
  92 + }
  93 +
  94 + String custSign = entity.getCustSign();
  95 + if (custSign != null) {
  96 + stmt.bindString(3, custSign);
  97 + }
  98 +
  99 + String fansNum = entity.getFansNum();
  100 + if (fansNum != null) {
  101 + stmt.bindString(4, fansNum);
  102 + }
  103 +
  104 + Boolean fan = entity.getFan();
  105 + if (fan != null) {
  106 + stmt.bindLong(5, fan ? 1L: 0L);
  107 + }
  108 +
  109 + String sid = entity.getSid();
  110 + if (sid != null) {
  111 + stmt.bindString(6, sid);
  112 + }
  113 +
  114 + String address = entity.getAddress();
  115 + if (address != null) {
  116 + stmt.bindString(7, address);
  117 + }
  118 +
  119 + String shopName = entity.getShopName();
  120 + if (shopName != null) {
  121 + stmt.bindString(8, shopName);
  122 + }
  123 +
  124 + Float grade = entity.getGrade();
  125 + if (grade != null) {
  126 + stmt.bindDouble(9, grade);
  127 + }
  128 +
  129 + Boolean online = entity.getOnline();
  130 + if (online != null) {
  131 + stmt.bindLong(10, online ? 1L: 0L);
  132 + }
  133 +
  134 + String orderCount = entity.getOrderCount();
  135 + if (orderCount != null) {
  136 + stmt.bindString(11, orderCount);
  137 + }
  138 +
  139 + String commentCount = entity.getCommentCount();
  140 + if (commentCount != null) {
  141 + stmt.bindString(12, commentCount);
  142 + }
  143 +
  144 + String propagandas = entity.getPropagandas();
  145 + if (propagandas != null) {
  146 + stmt.bindString(13, propagandas);
  147 + }
  148 +
  149 + String content = entity.getContent();
  150 + if (content != null) {
  151 + stmt.bindString(14, content);
  152 + }
  153 +
  154 + String category = entity.getCategory();
  155 + if (category != null) {
  156 + stmt.bindString(15, category);
  157 + }
  158 + }
  159 +
  160 + @Override
  161 + protected final void bindValues(SQLiteStatement stmt, DarenDetailMsg entity) {
  162 + stmt.clearBindings();
  163 +
  164 + String darenId = entity.getDarenId();
  165 + if (darenId != null) {
  166 + stmt.bindString(1, darenId);
  167 + }
  168 +
  169 + String image = entity.getImage();
  170 + if (image != null) {
  171 + stmt.bindString(2, image);
  172 + }
  173 +
  174 + String custSign = entity.getCustSign();
  175 + if (custSign != null) {
  176 + stmt.bindString(3, custSign);
  177 + }
  178 +
  179 + String fansNum = entity.getFansNum();
  180 + if (fansNum != null) {
  181 + stmt.bindString(4, fansNum);
  182 + }
  183 +
  184 + Boolean fan = entity.getFan();
  185 + if (fan != null) {
  186 + stmt.bindLong(5, fan ? 1L: 0L);
  187 + }
  188 +
  189 + String sid = entity.getSid();
  190 + if (sid != null) {
  191 + stmt.bindString(6, sid);
  192 + }
  193 +
  194 + String address = entity.getAddress();
  195 + if (address != null) {
  196 + stmt.bindString(7, address);
  197 + }
  198 +
  199 + String shopName = entity.getShopName();
  200 + if (shopName != null) {
  201 + stmt.bindString(8, shopName);
  202 + }
  203 +
  204 + Float grade = entity.getGrade();
  205 + if (grade != null) {
  206 + stmt.bindDouble(9, grade);
  207 + }
  208 +
  209 + Boolean online = entity.getOnline();
  210 + if (online != null) {
  211 + stmt.bindLong(10, online ? 1L: 0L);
  212 + }
  213 +
  214 + String orderCount = entity.getOrderCount();
  215 + if (orderCount != null) {
  216 + stmt.bindString(11, orderCount);
  217 + }
  218 +
  219 + String commentCount = entity.getCommentCount();
  220 + if (commentCount != null) {
  221 + stmt.bindString(12, commentCount);
  222 + }
  223 +
  224 + String propagandas = entity.getPropagandas();
  225 + if (propagandas != null) {
  226 + stmt.bindString(13, propagandas);
  227 + }
  228 +
  229 + String content = entity.getContent();
  230 + if (content != null) {
  231 + stmt.bindString(14, content);
  232 + }
  233 +
  234 + String category = entity.getCategory();
  235 + if (category != null) {
  236 + stmt.bindString(15, category);
  237 + }
  238 + }
  239 +
  240 + @Override
  241 + public String readKey(Cursor cursor, int offset) {
  242 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  243 + }
  244 +
  245 + @Override
  246 + public DarenDetailMsg readEntity(Cursor cursor, int offset) {
  247 + DarenDetailMsg entity = new DarenDetailMsg( //
  248 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // darenId
  249 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // image
  250 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // custSign
  251 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // fansNum
  252 + cursor.isNull(offset + 4) ? null : cursor.getShort(offset + 4) != 0, // fan
  253 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // sid
  254 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // address
  255 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // shopName
  256 + cursor.isNull(offset + 8) ? null : cursor.getFloat(offset + 8), // grade
  257 + cursor.isNull(offset + 9) ? null : cursor.getShort(offset + 9) != 0, // online
  258 + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // orderCount
  259 + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // commentCount
  260 + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // propagandas
  261 + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // content
  262 + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14) // category
  263 + );
  264 + return entity;
  265 + }
  266 +
  267 + @Override
  268 + public void readEntity(Cursor cursor, DarenDetailMsg entity, int offset) {
  269 + entity.setDarenId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  270 + entity.setImage(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  271 + entity.setCustSign(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  272 + entity.setFansNum(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  273 + entity.setFan(cursor.isNull(offset + 4) ? null : cursor.getShort(offset + 4) != 0);
  274 + entity.setSid(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  275 + entity.setAddress(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  276 + entity.setShopName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  277 + entity.setGrade(cursor.isNull(offset + 8) ? null : cursor.getFloat(offset + 8));
  278 + entity.setOnline(cursor.isNull(offset + 9) ? null : cursor.getShort(offset + 9) != 0);
  279 + entity.setOrderCount(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
  280 + entity.setCommentCount(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
  281 + entity.setPropagandas(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
  282 + entity.setContent(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
  283 + entity.setCategory(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
  284 + }
  285 +
  286 + @Override
  287 + protected final String updateKeyAfterInsert(DarenDetailMsg entity, long rowId) {
  288 + return entity.getDarenId();
  289 + }
  290 +
  291 + @Override
  292 + public String getKey(DarenDetailMsg entity) {
  293 + if(entity != null) {
  294 + return entity.getDarenId();
  295 + } else {
  296 + return null;
  297 + }
  298 + }
  299 +
  300 + @Override
  301 + public boolean hasKey(DarenDetailMsg entity) {
  302 + return entity.getDarenId() != null;
  303 + }
  304 +
  305 + @Override
  306 + protected final boolean isEntityUpdateable() {
  307 + return true;
  308 + }
  309 +
  310 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DarenListMsgDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.DarenListMsg;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "DAREN_LIST_MSG".
  17 +*/
  18 +public class DarenListMsgDao extends AbstractDao<DarenListMsg, String> {
  19 +
  20 + public static final String TABLENAME = "DAREN_LIST_MSG";
  21 +
  22 + /**
  23 + * Properties of entity DarenListMsg.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", true, "SID");
  28 + public final static Property DarenList = new Property(1, String.class, "darenList", false, "DAREN_LIST");
  29 + }
  30 +
  31 +
  32 + public DarenListMsgDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public DarenListMsgDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"DAREN_LIST_MSG\" (" + //
  44 + "\"SID\" TEXT PRIMARY KEY NOT NULL ," + // 0: sid
  45 + "\"DAREN_LIST\" TEXT);"); // 1: darenList
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DAREN_LIST_MSG\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, DarenListMsg entity) {
  56 + stmt.clearBindings();
  57 + stmt.bindString(1, entity.getSid());
  58 +
  59 + String darenList = entity.getDarenList();
  60 + if (darenList != null) {
  61 + stmt.bindString(2, darenList);
  62 + }
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, DarenListMsg entity) {
  67 + stmt.clearBindings();
  68 + stmt.bindString(1, entity.getSid());
  69 +
  70 + String darenList = entity.getDarenList();
  71 + if (darenList != null) {
  72 + stmt.bindString(2, darenList);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 0);
  79 + }
  80 +
  81 + @Override
  82 + public DarenListMsg readEntity(Cursor cursor, int offset) {
  83 + DarenListMsg entity = new DarenListMsg( //
  84 + cursor.getString(offset + 0), // sid
  85 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // darenList
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, DarenListMsg entity, int offset) {
  92 + entity.setSid(cursor.getString(offset + 0));
  93 + entity.setDarenList(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(DarenListMsg entity, long rowId) {
  98 + return entity.getSid();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(DarenListMsg entity) {
  103 + if(entity != null) {
  104 + return entity.getSid();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(DarenListMsg entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/DownloadInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.DownloadInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "DOWNLOAD_INFO".
  17 +*/
  18 +public class DownloadInfoDao extends AbstractDao<DownloadInfo, String> {
  19 +
  20 + public static final String TABLENAME = "DOWNLOAD_INFO";
  21 +
  22 + /**
  23 + * Properties of entity DownloadInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property UrlId = new Property(0, String.class, "urlId", true, "URL_ID");
  28 + public final static Property Url = new Property(1, String.class, "url", false, "URL");
  29 + public final static Property DownloadStatus = new Property(2, String.class, "downloadStatus", false, "DOWNLOAD_STATUS");
  30 + public final static Property FileName = new Property(3, String.class, "fileName", false, "FILE_NAME");
  31 + public final static Property Total = new Property(4, Long.class, "total", false, "TOTAL");
  32 + public final static Property Progress = new Property(5, Long.class, "progress", false, "PROGRESS");
  33 + public final static Property AlbumId = new Property(6, String.class, "albumId", false, "ALBUM_ID");
  34 + public final static Property ContentId = new Property(7, String.class, "contentId", false, "CONTENT_ID");
  35 + public final static Property CmccId = new Property(8, String.class, "cmccId", false, "CMCC_ID");
  36 + public final static Property ShareUrl = new Property(9, String.class, "shareUrl", false, "SHARE_URL");
  37 + public final static Property AlbumImg = new Property(10, String.class, "albumImg", false, "ALBUM_IMG");
  38 + public final static Property Actor = new Property(11, String.class, "actor", false, "ACTOR");
  39 + public final static Property AlbumName = new Property(12, String.class, "albumName", false, "ALBUM_NAME");
  40 + public final static Property Schedule = new Property(13, Double.class, "schedule", false, "SCHEDULE");
  41 + public final static Property ChannelName = new Property(14, String.class, "channelName", false, "CHANNEL_NAME");
  42 + public final static Property FileSize = new Property(15, String.class, "fileSize", false, "FILE_SIZE");
  43 + public final static Property Counts = new Property(16, Integer.class, "counts", false, "COUNTS");
  44 + }
  45 +
  46 +
  47 + public DownloadInfoDao(DaoConfig config) {
  48 + super(config);
  49 + }
  50 +
  51 + public DownloadInfoDao(DaoConfig config, DaoSession daoSession) {
  52 + super(config, daoSession);
  53 + }
  54 +
  55 + /** Creates the underlying database table. */
  56 + public static void createTable(Database db, boolean ifNotExists) {
  57 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  58 + db.execSQL("CREATE TABLE " + constraint + "\"DOWNLOAD_INFO\" (" + //
  59 + "\"URL_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: urlId
  60 + "\"URL\" TEXT," + // 1: url
  61 + "\"DOWNLOAD_STATUS\" TEXT," + // 2: downloadStatus
  62 + "\"FILE_NAME\" TEXT," + // 3: fileName
  63 + "\"TOTAL\" INTEGER," + // 4: total
  64 + "\"PROGRESS\" INTEGER," + // 5: progress
  65 + "\"ALBUM_ID\" TEXT," + // 6: albumId
  66 + "\"CONTENT_ID\" TEXT," + // 7: contentId
  67 + "\"CMCC_ID\" TEXT," + // 8: cmccId
  68 + "\"SHARE_URL\" TEXT," + // 9: shareUrl
  69 + "\"ALBUM_IMG\" TEXT," + // 10: albumImg
  70 + "\"ACTOR\" TEXT," + // 11: actor
  71 + "\"ALBUM_NAME\" TEXT," + // 12: albumName
  72 + "\"SCHEDULE\" REAL," + // 13: schedule
  73 + "\"CHANNEL_NAME\" TEXT," + // 14: channelName
  74 + "\"FILE_SIZE\" TEXT," + // 15: fileSize
  75 + "\"COUNTS\" INTEGER);"); // 16: counts
  76 + }
  77 +
  78 + /** Drops the underlying database table. */
  79 + public static void dropTable(Database db, boolean ifExists) {
  80 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DOWNLOAD_INFO\"";
  81 + db.execSQL(sql);
  82 + }
  83 +
  84 + @Override
  85 + protected final void bindValues(DatabaseStatement stmt, DownloadInfo entity) {
  86 + stmt.clearBindings();
  87 + stmt.bindString(1, entity.getUrlId());
  88 +
  89 + String url = entity.getUrl();
  90 + if (url != null) {
  91 + stmt.bindString(2, url);
  92 + }
  93 +
  94 + String downloadStatus = entity.getDownloadStatus();
  95 + if (downloadStatus != null) {
  96 + stmt.bindString(3, downloadStatus);
  97 + }
  98 +
  99 + String fileName = entity.getFileName();
  100 + if (fileName != null) {
  101 + stmt.bindString(4, fileName);
  102 + }
  103 +
  104 + Long total = entity.getTotal();
  105 + if (total != null) {
  106 + stmt.bindLong(5, total);
  107 + }
  108 +
  109 + Long progress = entity.getProgress();
  110 + if (progress != null) {
  111 + stmt.bindLong(6, progress);
  112 + }
  113 +
  114 + String albumId = entity.getAlbumId();
  115 + if (albumId != null) {
  116 + stmt.bindString(7, albumId);
  117 + }
  118 +
  119 + String contentId = entity.getContentId();
  120 + if (contentId != null) {
  121 + stmt.bindString(8, contentId);
  122 + }
  123 +
  124 + String cmccId = entity.getCmccId();
  125 + if (cmccId != null) {
  126 + stmt.bindString(9, cmccId);
  127 + }
  128 +
  129 + String shareUrl = entity.getShareUrl();
  130 + if (shareUrl != null) {
  131 + stmt.bindString(10, shareUrl);
  132 + }
  133 +
  134 + String albumImg = entity.getAlbumImg();
  135 + if (albumImg != null) {
  136 + stmt.bindString(11, albumImg);
  137 + }
  138 +
  139 + String actor = entity.getActor();
  140 + if (actor != null) {
  141 + stmt.bindString(12, actor);
  142 + }
  143 +
  144 + String albumName = entity.getAlbumName();
  145 + if (albumName != null) {
  146 + stmt.bindString(13, albumName);
  147 + }
  148 +
  149 + Double schedule = entity.getSchedule();
  150 + if (schedule != null) {
  151 + stmt.bindDouble(14, schedule);
  152 + }
  153 +
  154 + String channelName = entity.getChannelName();
  155 + if (channelName != null) {
  156 + stmt.bindString(15, channelName);
  157 + }
  158 +
  159 + String fileSize = entity.getFileSize();
  160 + if (fileSize != null) {
  161 + stmt.bindString(16, fileSize);
  162 + }
  163 +
  164 + Integer counts = entity.getCounts();
  165 + if (counts != null) {
  166 + stmt.bindLong(17, counts);
  167 + }
  168 + }
  169 +
  170 + @Override
  171 + protected final void bindValues(SQLiteStatement stmt, DownloadInfo entity) {
  172 + stmt.clearBindings();
  173 + stmt.bindString(1, entity.getUrlId());
  174 +
  175 + String url = entity.getUrl();
  176 + if (url != null) {
  177 + stmt.bindString(2, url);
  178 + }
  179 +
  180 + String downloadStatus = entity.getDownloadStatus();
  181 + if (downloadStatus != null) {
  182 + stmt.bindString(3, downloadStatus);
  183 + }
  184 +
  185 + String fileName = entity.getFileName();
  186 + if (fileName != null) {
  187 + stmt.bindString(4, fileName);
  188 + }
  189 +
  190 + Long total = entity.getTotal();
  191 + if (total != null) {
  192 + stmt.bindLong(5, total);
  193 + }
  194 +
  195 + Long progress = entity.getProgress();
  196 + if (progress != null) {
  197 + stmt.bindLong(6, progress);
  198 + }
  199 +
  200 + String albumId = entity.getAlbumId();
  201 + if (albumId != null) {
  202 + stmt.bindString(7, albumId);
  203 + }
  204 +
  205 + String contentId = entity.getContentId();
  206 + if (contentId != null) {
  207 + stmt.bindString(8, contentId);
  208 + }
  209 +
  210 + String cmccId = entity.getCmccId();
  211 + if (cmccId != null) {
  212 + stmt.bindString(9, cmccId);
  213 + }
  214 +
  215 + String shareUrl = entity.getShareUrl();
  216 + if (shareUrl != null) {
  217 + stmt.bindString(10, shareUrl);
  218 + }
  219 +
  220 + String albumImg = entity.getAlbumImg();
  221 + if (albumImg != null) {
  222 + stmt.bindString(11, albumImg);
  223 + }
  224 +
  225 + String actor = entity.getActor();
  226 + if (actor != null) {
  227 + stmt.bindString(12, actor);
  228 + }
  229 +
  230 + String albumName = entity.getAlbumName();
  231 + if (albumName != null) {
  232 + stmt.bindString(13, albumName);
  233 + }
  234 +
  235 + Double schedule = entity.getSchedule();
  236 + if (schedule != null) {
  237 + stmt.bindDouble(14, schedule);
  238 + }
  239 +
  240 + String channelName = entity.getChannelName();
  241 + if (channelName != null) {
  242 + stmt.bindString(15, channelName);
  243 + }
  244 +
  245 + String fileSize = entity.getFileSize();
  246 + if (fileSize != null) {
  247 + stmt.bindString(16, fileSize);
  248 + }
  249 +
  250 + Integer counts = entity.getCounts();
  251 + if (counts != null) {
  252 + stmt.bindLong(17, counts);
  253 + }
  254 + }
  255 +
  256 + @Override
  257 + public String readKey(Cursor cursor, int offset) {
  258 + return cursor.getString(offset + 0);
  259 + }
  260 +
  261 + @Override
  262 + public DownloadInfo readEntity(Cursor cursor, int offset) {
  263 + DownloadInfo entity = new DownloadInfo( //
  264 + cursor.getString(offset + 0), // urlId
  265 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // url
  266 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // downloadStatus
  267 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // fileName
  268 + cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4), // total
  269 + cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // progress
  270 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // albumId
  271 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // contentId
  272 + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // cmccId
  273 + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // shareUrl
  274 + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // albumImg
  275 + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // actor
  276 + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // albumName
  277 + cursor.isNull(offset + 13) ? null : cursor.getDouble(offset + 13), // schedule
  278 + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // channelName
  279 + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // fileSize
  280 + cursor.isNull(offset + 16) ? null : cursor.getInt(offset + 16) // counts
  281 + );
  282 + return entity;
  283 + }
  284 +
  285 + @Override
  286 + public void readEntity(Cursor cursor, DownloadInfo entity, int offset) {
  287 + entity.setUrlId(cursor.getString(offset + 0));
  288 + entity.setUrl(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  289 + entity.setDownloadStatus(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  290 + entity.setFileName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  291 + entity.setTotal(cursor.isNull(offset + 4) ? null : cursor.getLong(offset + 4));
  292 + entity.setProgress(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));
  293 + entity.setAlbumId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  294 + entity.setContentId(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  295 + entity.setCmccId(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
  296 + entity.setShareUrl(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
  297 + entity.setAlbumImg(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
  298 + entity.setActor(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
  299 + entity.setAlbumName(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
  300 + entity.setSchedule(cursor.isNull(offset + 13) ? null : cursor.getDouble(offset + 13));
  301 + entity.setChannelName(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14));
  302 + entity.setFileSize(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15));
  303 + entity.setCounts(cursor.isNull(offset + 16) ? null : cursor.getInt(offset + 16));
  304 + }
  305 +
  306 + @Override
  307 + protected final String updateKeyAfterInsert(DownloadInfo entity, long rowId) {
  308 + return entity.getUrlId();
  309 + }
  310 +
  311 + @Override
  312 + public String getKey(DownloadInfo entity) {
  313 + if(entity != null) {
  314 + return entity.getUrlId();
  315 + } else {
  316 + return null;
  317 + }
  318 + }
  319 +
  320 + @Override
  321 + public boolean hasKey(DownloadInfo entity) {
  322 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  323 + }
  324 +
  325 + @Override
  326 + protected final boolean isEntityUpdateable() {
  327 + return true;
  328 + }
  329 +
  330 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/ExceptionInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.ExceptionInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "EXCEPTION_INFO".
  17 +*/
  18 +public class ExceptionInfoDao extends AbstractDao<ExceptionInfo, Long> {
  19 +
  20 + public static final String TABLENAME = "EXCEPTION_INFO";
  21 +
  22 + /**
  23 + * Properties of entity ExceptionInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Id = new Property(0, Long.class, "id", true, "_id");
  28 + public final static Property ErrorTag = new Property(1, String.class, "ErrorTag", false, "ERROR_TAG");
  29 + public final static Property ErrorMessage = new Property(2, String.class, "ErrorMessage", false, "ERROR_MESSAGE");
  30 + }
  31 +
  32 +
  33 + public ExceptionInfoDao(DaoConfig config) {
  34 + super(config);
  35 + }
  36 +
  37 + public ExceptionInfoDao(DaoConfig config, DaoSession daoSession) {
  38 + super(config, daoSession);
  39 + }
  40 +
  41 + /** Creates the underlying database table. */
  42 + public static void createTable(Database db, boolean ifNotExists) {
  43 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  44 + db.execSQL("CREATE TABLE " + constraint + "\"EXCEPTION_INFO\" (" + //
  45 + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
  46 + "\"ERROR_TAG\" TEXT NOT NULL ," + // 1: ErrorTag
  47 + "\"ERROR_MESSAGE\" TEXT NOT NULL );"); // 2: ErrorMessage
  48 + }
  49 +
  50 + /** Drops the underlying database table. */
  51 + public static void dropTable(Database db, boolean ifExists) {
  52 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"EXCEPTION_INFO\"";
  53 + db.execSQL(sql);
  54 + }
  55 +
  56 + @Override
  57 + protected final void bindValues(DatabaseStatement stmt, ExceptionInfo entity) {
  58 + stmt.clearBindings();
  59 +
  60 + Long id = entity.getId();
  61 + if (id != null) {
  62 + stmt.bindLong(1, id);
  63 + }
  64 + stmt.bindString(2, entity.getErrorTag());
  65 + stmt.bindString(3, entity.getErrorMessage());
  66 + }
  67 +
  68 + @Override
  69 + protected final void bindValues(SQLiteStatement stmt, ExceptionInfo entity) {
  70 + stmt.clearBindings();
  71 +
  72 + Long id = entity.getId();
  73 + if (id != null) {
  74 + stmt.bindLong(1, id);
  75 + }
  76 + stmt.bindString(2, entity.getErrorTag());
  77 + stmt.bindString(3, entity.getErrorMessage());
  78 + }
  79 +
  80 + @Override
  81 + public Long readKey(Cursor cursor, int offset) {
  82 + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  83 + }
  84 +
  85 + @Override
  86 + public ExceptionInfo readEntity(Cursor cursor, int offset) {
  87 + ExceptionInfo entity = new ExceptionInfo( //
  88 + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  89 + cursor.getString(offset + 1), // ErrorTag
  90 + cursor.getString(offset + 2) // ErrorMessage
  91 + );
  92 + return entity;
  93 + }
  94 +
  95 + @Override
  96 + public void readEntity(Cursor cursor, ExceptionInfo entity, int offset) {
  97 + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  98 + entity.setErrorTag(cursor.getString(offset + 1));
  99 + entity.setErrorMessage(cursor.getString(offset + 2));
  100 + }
  101 +
  102 + @Override
  103 + protected final Long updateKeyAfterInsert(ExceptionInfo entity, long rowId) {
  104 + entity.setId(rowId);
  105 + return rowId;
  106 + }
  107 +
  108 + @Override
  109 + public Long getKey(ExceptionInfo entity) {
  110 + if(entity != null) {
  111 + return entity.getId();
  112 + } else {
  113 + return null;
  114 + }
  115 + }
  116 +
  117 + @Override
  118 + public boolean hasKey(ExceptionInfo entity) {
  119 + return entity.getId() != null;
  120 + }
  121 +
  122 + @Override
  123 + protected final boolean isEntityUpdateable() {
  124 + return true;
  125 + }
  126 +
  127 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/HolidayThemeInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.HolidayThemeInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "HOLIDAY_THEME_INFO".
  17 +*/
  18 +public class HolidayThemeInfoDao extends AbstractDao<HolidayThemeInfo, String> {
  19 +
  20 + public static final String TABLENAME = "HOLIDAY_THEME_INFO";
  21 +
  22 + /**
  23 + * Properties of entity HolidayThemeInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Appid = new Property(0, String.class, "appid", true, "APPID");
  28 + public final static Property ClickAfter = new Property(1, String.class, "clickAfter", false, "CLICK_AFTER");
  29 + public final static Property ClickBefore = new Property(2, String.class, "clickBefore", false, "CLICK_BEFORE");
  30 + public final static Property HolidayThemeId = new Property(3, String.class, "holidayThemeId", false, "HOLIDAY_THEME_ID");
  31 + public final static Property ImagePackage = new Property(4, String.class, "imagePackage", false, "IMAGE_PACKAGE");
  32 + public final static Property ShowSource = new Property(5, String.class, "showSource", false, "SHOW_SOURCE");
  33 + public final static Property IsShow = new Property(6, String.class, "isShow", false, "IS_SHOW");
  34 + public final static Property UpdateType = new Property(7, Integer.class, "updateType", false, "UPDATE_TYPE");
  35 + public final static Property IsDonwLoadSucess = new Property(8, Boolean.class, "isDonwLoadSucess", false, "IS_DONW_LOAD_SUCESS");
  36 + public final static Property SkinType = new Property(9, String.class, "skinType", false, "SKIN_TYPE");
  37 + }
  38 +
  39 +
  40 + public HolidayThemeInfoDao(DaoConfig config) {
  41 + super(config);
  42 + }
  43 +
  44 + public HolidayThemeInfoDao(DaoConfig config, DaoSession daoSession) {
  45 + super(config, daoSession);
  46 + }
  47 +
  48 + /** Creates the underlying database table. */
  49 + public static void createTable(Database db, boolean ifNotExists) {
  50 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  51 + db.execSQL("CREATE TABLE " + constraint + "\"HOLIDAY_THEME_INFO\" (" + //
  52 + "\"APPID\" TEXT PRIMARY KEY NOT NULL ," + // 0: appid
  53 + "\"CLICK_AFTER\" TEXT," + // 1: clickAfter
  54 + "\"CLICK_BEFORE\" TEXT," + // 2: clickBefore
  55 + "\"HOLIDAY_THEME_ID\" TEXT," + // 3: holidayThemeId
  56 + "\"IMAGE_PACKAGE\" TEXT," + // 4: imagePackage
  57 + "\"SHOW_SOURCE\" TEXT," + // 5: showSource
  58 + "\"IS_SHOW\" TEXT," + // 6: isShow
  59 + "\"UPDATE_TYPE\" INTEGER," + // 7: updateType
  60 + "\"IS_DONW_LOAD_SUCESS\" INTEGER," + // 8: isDonwLoadSucess
  61 + "\"SKIN_TYPE\" TEXT);"); // 9: skinType
  62 + }
  63 +
  64 + /** Drops the underlying database table. */
  65 + public static void dropTable(Database db, boolean ifExists) {
  66 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"HOLIDAY_THEME_INFO\"";
  67 + db.execSQL(sql);
  68 + }
  69 +
  70 + @Override
  71 + protected final void bindValues(DatabaseStatement stmt, HolidayThemeInfo entity) {
  72 + stmt.clearBindings();
  73 + stmt.bindString(1, entity.getAppid());
  74 +
  75 + String clickAfter = entity.getClickAfter();
  76 + if (clickAfter != null) {
  77 + stmt.bindString(2, clickAfter);
  78 + }
  79 +
  80 + String clickBefore = entity.getClickBefore();
  81 + if (clickBefore != null) {
  82 + stmt.bindString(3, clickBefore);
  83 + }
  84 +
  85 + String holidayThemeId = entity.getHolidayThemeId();
  86 + if (holidayThemeId != null) {
  87 + stmt.bindString(4, holidayThemeId);
  88 + }
  89 +
  90 + String imagePackage = entity.getImagePackage();
  91 + if (imagePackage != null) {
  92 + stmt.bindString(5, imagePackage);
  93 + }
  94 +
  95 + String showSource = entity.getShowSource();
  96 + if (showSource != null) {
  97 + stmt.bindString(6, showSource);
  98 + }
  99 +
  100 + String isShow = entity.getIsShow();
  101 + if (isShow != null) {
  102 + stmt.bindString(7, isShow);
  103 + }
  104 +
  105 + Integer updateType = entity.getUpdateType();
  106 + if (updateType != null) {
  107 + stmt.bindLong(8, updateType);
  108 + }
  109 +
  110 + Boolean isDonwLoadSucess = entity.getIsDonwLoadSucess();
  111 + if (isDonwLoadSucess != null) {
  112 + stmt.bindLong(9, isDonwLoadSucess ? 1L: 0L);
  113 + }
  114 +
  115 + String skinType = entity.getSkinType();
  116 + if (skinType != null) {
  117 + stmt.bindString(10, skinType);
  118 + }
  119 + }
  120 +
  121 + @Override
  122 + protected final void bindValues(SQLiteStatement stmt, HolidayThemeInfo entity) {
  123 + stmt.clearBindings();
  124 + stmt.bindString(1, entity.getAppid());
  125 +
  126 + String clickAfter = entity.getClickAfter();
  127 + if (clickAfter != null) {
  128 + stmt.bindString(2, clickAfter);
  129 + }
  130 +
  131 + String clickBefore = entity.getClickBefore();
  132 + if (clickBefore != null) {
  133 + stmt.bindString(3, clickBefore);
  134 + }
  135 +
  136 + String holidayThemeId = entity.getHolidayThemeId();
  137 + if (holidayThemeId != null) {
  138 + stmt.bindString(4, holidayThemeId);
  139 + }
  140 +
  141 + String imagePackage = entity.getImagePackage();
  142 + if (imagePackage != null) {
  143 + stmt.bindString(5, imagePackage);
  144 + }
  145 +
  146 + String showSource = entity.getShowSource();
  147 + if (showSource != null) {
  148 + stmt.bindString(6, showSource);
  149 + }
  150 +
  151 + String isShow = entity.getIsShow();
  152 + if (isShow != null) {
  153 + stmt.bindString(7, isShow);
  154 + }
  155 +
  156 + Integer updateType = entity.getUpdateType();
  157 + if (updateType != null) {
  158 + stmt.bindLong(8, updateType);
  159 + }
  160 +
  161 + Boolean isDonwLoadSucess = entity.getIsDonwLoadSucess();
  162 + if (isDonwLoadSucess != null) {
  163 + stmt.bindLong(9, isDonwLoadSucess ? 1L: 0L);
  164 + }
  165 +
  166 + String skinType = entity.getSkinType();
  167 + if (skinType != null) {
  168 + stmt.bindString(10, skinType);
  169 + }
  170 + }
  171 +
  172 + @Override
  173 + public String readKey(Cursor cursor, int offset) {
  174 + return cursor.getString(offset + 0);
  175 + }
  176 +
  177 + @Override
  178 + public HolidayThemeInfo readEntity(Cursor cursor, int offset) {
  179 + HolidayThemeInfo entity = new HolidayThemeInfo( //
  180 + cursor.getString(offset + 0), // appid
  181 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // clickAfter
  182 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // clickBefore
  183 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // holidayThemeId
  184 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // imagePackage
  185 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // showSource
  186 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // isShow
  187 + cursor.isNull(offset + 7) ? null : cursor.getInt(offset + 7), // updateType
  188 + cursor.isNull(offset + 8) ? null : cursor.getShort(offset + 8) != 0, // isDonwLoadSucess
  189 + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // skinType
  190 + );
  191 + return entity;
  192 + }
  193 +
  194 + @Override
  195 + public void readEntity(Cursor cursor, HolidayThemeInfo entity, int offset) {
  196 + entity.setAppid(cursor.getString(offset + 0));
  197 + entity.setClickAfter(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  198 + entity.setClickBefore(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  199 + entity.setHolidayThemeId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  200 + entity.setImagePackage(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  201 + entity.setShowSource(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  202 + entity.setIsShow(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  203 + entity.setUpdateType(cursor.isNull(offset + 7) ? null : cursor.getInt(offset + 7));
  204 + entity.setIsDonwLoadSucess(cursor.isNull(offset + 8) ? null : cursor.getShort(offset + 8) != 0);
  205 + entity.setSkinType(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
  206 + }
  207 +
  208 + @Override
  209 + protected final String updateKeyAfterInsert(HolidayThemeInfo entity, long rowId) {
  210 + return entity.getAppid();
  211 + }
  212 +
  213 + @Override
  214 + public String getKey(HolidayThemeInfo entity) {
  215 + if(entity != null) {
  216 + return entity.getAppid();
  217 + } else {
  218 + return null;
  219 + }
  220 + }
  221 +
  222 + @Override
  223 + public boolean hasKey(HolidayThemeInfo entity) {
  224 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  225 + }
  226 +
  227 + @Override
  228 + protected final boolean isEntityUpdateable() {
  229 + return true;
  230 + }
  231 +
  232 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMConversationInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMConversationInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMCONVERSATION_INFO".
  17 +*/
  18 +public class IMConversationInfoDao extends AbstractDao<IMConversationInfo, String> {
  19 +
  20 + public static final String TABLENAME = "IMCONVERSATION_INFO";
  21 +
  22 + /**
  23 + * Properties of entity IMConversationInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property ConversationId = new Property(0, String.class, "conversationId", true, "CONVERSATION_ID");
  28 + public final static Property ConversationType = new Property(1, String.class, "conversationType", false, "CONVERSATION_TYPE");
  29 + public final static Property Title = new Property(2, String.class, "title", false, "TITLE");
  30 + public final static Property Des = new Property(3, String.class, "des", false, "DES");
  31 + public final static Property FaceUrl = new Property(4, String.class, "faceUrl", false, "FACE_URL");
  32 + public final static Property ConversationFaceUrl = new Property(5, String.class, "conversationFaceUrl", false, "CONVERSATION_FACE_URL");
  33 + public final static Property TimeStep = new Property(6, Long.class, "timeStep", false, "TIME_STEP");
  34 + public final static Property UnreadCount = new Property(7, Long.class, "unreadCount", false, "UNREAD_COUNT");
  35 + }
  36 +
  37 +
  38 + public IMConversationInfoDao(DaoConfig config) {
  39 + super(config);
  40 + }
  41 +
  42 + public IMConversationInfoDao(DaoConfig config, DaoSession daoSession) {
  43 + super(config, daoSession);
  44 + }
  45 +
  46 + /** Creates the underlying database table. */
  47 + public static void createTable(Database db, boolean ifNotExists) {
  48 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  49 + db.execSQL("CREATE TABLE " + constraint + "\"IMCONVERSATION_INFO\" (" + //
  50 + "\"CONVERSATION_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: conversationId
  51 + "\"CONVERSATION_TYPE\" TEXT," + // 1: conversationType
  52 + "\"TITLE\" TEXT," + // 2: title
  53 + "\"DES\" TEXT," + // 3: des
  54 + "\"FACE_URL\" TEXT," + // 4: faceUrl
  55 + "\"CONVERSATION_FACE_URL\" TEXT," + // 5: conversationFaceUrl
  56 + "\"TIME_STEP\" INTEGER," + // 6: timeStep
  57 + "\"UNREAD_COUNT\" INTEGER);"); // 7: unreadCount
  58 + }
  59 +
  60 + /** Drops the underlying database table. */
  61 + public static void dropTable(Database db, boolean ifExists) {
  62 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMCONVERSATION_INFO\"";
  63 + db.execSQL(sql);
  64 + }
  65 +
  66 + @Override
  67 + protected final void bindValues(DatabaseStatement stmt, IMConversationInfo entity) {
  68 + stmt.clearBindings();
  69 + stmt.bindString(1, entity.getConversationId());
  70 +
  71 + String conversationType = entity.getConversationType();
  72 + if (conversationType != null) {
  73 + stmt.bindString(2, conversationType);
  74 + }
  75 +
  76 + String title = entity.getTitle();
  77 + if (title != null) {
  78 + stmt.bindString(3, title);
  79 + }
  80 +
  81 + String des = entity.getDes();
  82 + if (des != null) {
  83 + stmt.bindString(4, des);
  84 + }
  85 +
  86 + String faceUrl = entity.getFaceUrl();
  87 + if (faceUrl != null) {
  88 + stmt.bindString(5, faceUrl);
  89 + }
  90 +
  91 + String conversationFaceUrl = entity.getConversationFaceUrl();
  92 + if (conversationFaceUrl != null) {
  93 + stmt.bindString(6, conversationFaceUrl);
  94 + }
  95 +
  96 + Long timeStep = entity.getTimeStep();
  97 + if (timeStep != null) {
  98 + stmt.bindLong(7, timeStep);
  99 + }
  100 +
  101 + Long unreadCount = entity.getUnreadCount();
  102 + if (unreadCount != null) {
  103 + stmt.bindLong(8, unreadCount);
  104 + }
  105 + }
  106 +
  107 + @Override
  108 + protected final void bindValues(SQLiteStatement stmt, IMConversationInfo entity) {
  109 + stmt.clearBindings();
  110 + stmt.bindString(1, entity.getConversationId());
  111 +
  112 + String conversationType = entity.getConversationType();
  113 + if (conversationType != null) {
  114 + stmt.bindString(2, conversationType);
  115 + }
  116 +
  117 + String title = entity.getTitle();
  118 + if (title != null) {
  119 + stmt.bindString(3, title);
  120 + }
  121 +
  122 + String des = entity.getDes();
  123 + if (des != null) {
  124 + stmt.bindString(4, des);
  125 + }
  126 +
  127 + String faceUrl = entity.getFaceUrl();
  128 + if (faceUrl != null) {
  129 + stmt.bindString(5, faceUrl);
  130 + }
  131 +
  132 + String conversationFaceUrl = entity.getConversationFaceUrl();
  133 + if (conversationFaceUrl != null) {
  134 + stmt.bindString(6, conversationFaceUrl);
  135 + }
  136 +
  137 + Long timeStep = entity.getTimeStep();
  138 + if (timeStep != null) {
  139 + stmt.bindLong(7, timeStep);
  140 + }
  141 +
  142 + Long unreadCount = entity.getUnreadCount();
  143 + if (unreadCount != null) {
  144 + stmt.bindLong(8, unreadCount);
  145 + }
  146 + }
  147 +
  148 + @Override
  149 + public String readKey(Cursor cursor, int offset) {
  150 + return cursor.getString(offset + 0);
  151 + }
  152 +
  153 + @Override
  154 + public IMConversationInfo readEntity(Cursor cursor, int offset) {
  155 + IMConversationInfo entity = new IMConversationInfo( //
  156 + cursor.getString(offset + 0), // conversationId
  157 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // conversationType
  158 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // title
  159 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // des
  160 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // faceUrl
  161 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // conversationFaceUrl
  162 + cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6), // timeStep
  163 + cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7) // unreadCount
  164 + );
  165 + return entity;
  166 + }
  167 +
  168 + @Override
  169 + public void readEntity(Cursor cursor, IMConversationInfo entity, int offset) {
  170 + entity.setConversationId(cursor.getString(offset + 0));
  171 + entity.setConversationType(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  172 + entity.setTitle(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  173 + entity.setDes(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  174 + entity.setFaceUrl(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  175 + entity.setConversationFaceUrl(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  176 + entity.setTimeStep(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));
  177 + entity.setUnreadCount(cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7));
  178 + }
  179 +
  180 + @Override
  181 + protected final String updateKeyAfterInsert(IMConversationInfo entity, long rowId) {
  182 + return entity.getConversationId();
  183 + }
  184 +
  185 + @Override
  186 + public String getKey(IMConversationInfo entity) {
  187 + if(entity != null) {
  188 + return entity.getConversationId();
  189 + } else {
  190 + return null;
  191 + }
  192 + }
  193 +
  194 + @Override
  195 + public boolean hasKey(IMConversationInfo entity) {
  196 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  197 + }
  198 +
  199 + @Override
  200 + protected final boolean isEntityUpdateable() {
  201 + return true;
  202 + }
  203 +
  204 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMGroupFaceMemberIdsDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMGroupFaceMemberIds;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMGROUP_FACE_MEMBER_IDS".
  17 +*/
  18 +public class IMGroupFaceMemberIdsDao extends AbstractDao<IMGroupFaceMemberIds, String> {
  19 +
  20 + public static final String TABLENAME = "IMGROUP_FACE_MEMBER_IDS";
  21 +
  22 + /**
  23 + * Properties of entity IMGroupFaceMemberIds.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property GroupId = new Property(0, String.class, "GroupId", true, "GROUP_ID");
  28 + public final static Property GroupFaceUrlIds = new Property(1, String.class, "GroupFaceUrlIds", false, "GROUP_FACE_URL_IDS");
  29 + }
  30 +
  31 +
  32 + public IMGroupFaceMemberIdsDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public IMGroupFaceMemberIdsDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"IMGROUP_FACE_MEMBER_IDS\" (" + //
  44 + "\"GROUP_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: GroupId
  45 + "\"GROUP_FACE_URL_IDS\" TEXT);"); // 1: GroupFaceUrlIds
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMGROUP_FACE_MEMBER_IDS\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, IMGroupFaceMemberIds entity) {
  56 + stmt.clearBindings();
  57 + stmt.bindString(1, entity.getGroupId());
  58 +
  59 + String GroupFaceUrlIds = entity.getGroupFaceUrlIds();
  60 + if (GroupFaceUrlIds != null) {
  61 + stmt.bindString(2, GroupFaceUrlIds);
  62 + }
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, IMGroupFaceMemberIds entity) {
  67 + stmt.clearBindings();
  68 + stmt.bindString(1, entity.getGroupId());
  69 +
  70 + String GroupFaceUrlIds = entity.getGroupFaceUrlIds();
  71 + if (GroupFaceUrlIds != null) {
  72 + stmt.bindString(2, GroupFaceUrlIds);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 0);
  79 + }
  80 +
  81 + @Override
  82 + public IMGroupFaceMemberIds readEntity(Cursor cursor, int offset) {
  83 + IMGroupFaceMemberIds entity = new IMGroupFaceMemberIds( //
  84 + cursor.getString(offset + 0), // GroupId
  85 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // GroupFaceUrlIds
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, IMGroupFaceMemberIds entity, int offset) {
  92 + entity.setGroupId(cursor.getString(offset + 0));
  93 + entity.setGroupFaceUrlIds(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(IMGroupFaceMemberIds entity, long rowId) {
  98 + return entity.getGroupId();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(IMGroupFaceMemberIds entity) {
  103 + if(entity != null) {
  104 + return entity.getGroupId();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(IMGroupFaceMemberIds entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMGroupMembersDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMGroupMembers;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMGROUP_MEMBERS".
  17 +*/
  18 +public class IMGroupMembersDao extends AbstractDao<IMGroupMembers, String> {
  19 +
  20 + public static final String TABLENAME = "IMGROUP_MEMBERS";
  21 +
  22 + /**
  23 + * Properties of entity IMGroupMembers.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property GroupId = new Property(0, String.class, "GroupId", true, "GROUP_ID");
  28 + public final static Property GroupName = new Property(1, String.class, "GroupName", false, "GROUP_NAME");
  29 + public final static Property GroupFaceUrl = new Property(2, String.class, "GroupFaceUrl", false, "GROUP_FACE_URL");
  30 + public final static Property CombineGroupFaceUrl = new Property(3, String.class, "CombineGroupFaceUrl", false, "COMBINE_GROUP_FACE_URL");
  31 + }
  32 +
  33 +
  34 + public IMGroupMembersDao(DaoConfig config) {
  35 + super(config);
  36 + }
  37 +
  38 + public IMGroupMembersDao(DaoConfig config, DaoSession daoSession) {
  39 + super(config, daoSession);
  40 + }
  41 +
  42 + /** Creates the underlying database table. */
  43 + public static void createTable(Database db, boolean ifNotExists) {
  44 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  45 + db.execSQL("CREATE TABLE " + constraint + "\"IMGROUP_MEMBERS\" (" + //
  46 + "\"GROUP_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: GroupId
  47 + "\"GROUP_NAME\" TEXT," + // 1: GroupName
  48 + "\"GROUP_FACE_URL\" TEXT," + // 2: GroupFaceUrl
  49 + "\"COMBINE_GROUP_FACE_URL\" TEXT);"); // 3: CombineGroupFaceUrl
  50 + }
  51 +
  52 + /** Drops the underlying database table. */
  53 + public static void dropTable(Database db, boolean ifExists) {
  54 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMGROUP_MEMBERS\"";
  55 + db.execSQL(sql);
  56 + }
  57 +
  58 + @Override
  59 + protected final void bindValues(DatabaseStatement stmt, IMGroupMembers entity) {
  60 + stmt.clearBindings();
  61 + stmt.bindString(1, entity.getGroupId());
  62 +
  63 + String GroupName = entity.getGroupName();
  64 + if (GroupName != null) {
  65 + stmt.bindString(2, GroupName);
  66 + }
  67 +
  68 + String GroupFaceUrl = entity.getGroupFaceUrl();
  69 + if (GroupFaceUrl != null) {
  70 + stmt.bindString(3, GroupFaceUrl);
  71 + }
  72 +
  73 + String CombineGroupFaceUrl = entity.getCombineGroupFaceUrl();
  74 + if (CombineGroupFaceUrl != null) {
  75 + stmt.bindString(4, CombineGroupFaceUrl);
  76 + }
  77 + }
  78 +
  79 + @Override
  80 + protected final void bindValues(SQLiteStatement stmt, IMGroupMembers entity) {
  81 + stmt.clearBindings();
  82 + stmt.bindString(1, entity.getGroupId());
  83 +
  84 + String GroupName = entity.getGroupName();
  85 + if (GroupName != null) {
  86 + stmt.bindString(2, GroupName);
  87 + }
  88 +
  89 + String GroupFaceUrl = entity.getGroupFaceUrl();
  90 + if (GroupFaceUrl != null) {
  91 + stmt.bindString(3, GroupFaceUrl);
  92 + }
  93 +
  94 + String CombineGroupFaceUrl = entity.getCombineGroupFaceUrl();
  95 + if (CombineGroupFaceUrl != null) {
  96 + stmt.bindString(4, CombineGroupFaceUrl);
  97 + }
  98 + }
  99 +
  100 + @Override
  101 + public String readKey(Cursor cursor, int offset) {
  102 + return cursor.getString(offset + 0);
  103 + }
  104 +
  105 + @Override
  106 + public IMGroupMembers readEntity(Cursor cursor, int offset) {
  107 + IMGroupMembers entity = new IMGroupMembers( //
  108 + cursor.getString(offset + 0), // GroupId
  109 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // GroupName
  110 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // GroupFaceUrl
  111 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // CombineGroupFaceUrl
  112 + );
  113 + return entity;
  114 + }
  115 +
  116 + @Override
  117 + public void readEntity(Cursor cursor, IMGroupMembers entity, int offset) {
  118 + entity.setGroupId(cursor.getString(offset + 0));
  119 + entity.setGroupName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  120 + entity.setGroupFaceUrl(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  121 + entity.setCombineGroupFaceUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  122 + }
  123 +
  124 + @Override
  125 + protected final String updateKeyAfterInsert(IMGroupMembers entity, long rowId) {
  126 + return entity.getGroupId();
  127 + }
  128 +
  129 + @Override
  130 + public String getKey(IMGroupMembers entity) {
  131 + if(entity != null) {
  132 + return entity.getGroupId();
  133 + } else {
  134 + return null;
  135 + }
  136 + }
  137 +
  138 + @Override
  139 + public boolean hasKey(IMGroupMembers entity) {
  140 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  141 + }
  142 +
  143 + @Override
  144 + protected final boolean isEntityUpdateable() {
  145 + return true;
  146 + }
  147 +
  148 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMGroupMembersListDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMGroupMembersList;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMGROUP_MEMBERS_LIST".
  17 +*/
  18 +public class IMGroupMembersListDao extends AbstractDao<IMGroupMembersList, Long> {
  19 +
  20 + public static final String TABLENAME = "IMGROUP_MEMBERS_LIST";
  21 +
  22 + /**
  23 + * Properties of entity IMGroupMembersList.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Id = new Property(0, Long.class, "id", true, "_id");
  28 + public final static Property GroupId = new Property(1, String.class, "GroupId", false, "GROUP_ID");
  29 + public final static Property MemberId = new Property(2, String.class, "memberId", false, "MEMBER_ID");
  30 + public final static Property MemberRemark = new Property(3, String.class, "memberRemark", false, "MEMBER_REMARK");
  31 + public final static Property MemberFaceUrl = new Property(4, String.class, "memberFaceUrl", false, "MEMBER_FACE_URL");
  32 + public final static Property MemberNick = new Property(5, String.class, "memberNick", false, "MEMBER_NICK");
  33 + public final static Property MemberRoleType = new Property(6, String.class, "memberRoleType", false, "MEMBER_ROLE_TYPE");
  34 + public final static Property MemberNameCard = new Property(7, String.class, "memberNameCard", false, "MEMBER_NAME_CARD");
  35 + }
  36 +
  37 +
  38 + public IMGroupMembersListDao(DaoConfig config) {
  39 + super(config);
  40 + }
  41 +
  42 + public IMGroupMembersListDao(DaoConfig config, DaoSession daoSession) {
  43 + super(config, daoSession);
  44 + }
  45 +
  46 + /** Creates the underlying database table. */
  47 + public static void createTable(Database db, boolean ifNotExists) {
  48 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  49 + db.execSQL("CREATE TABLE " + constraint + "\"IMGROUP_MEMBERS_LIST\" (" + //
  50 + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
  51 + "\"GROUP_ID\" TEXT," + // 1: GroupId
  52 + "\"MEMBER_ID\" TEXT," + // 2: memberId
  53 + "\"MEMBER_REMARK\" TEXT," + // 3: memberRemark
  54 + "\"MEMBER_FACE_URL\" TEXT," + // 4: memberFaceUrl
  55 + "\"MEMBER_NICK\" TEXT," + // 5: memberNick
  56 + "\"MEMBER_ROLE_TYPE\" TEXT," + // 6: memberRoleType
  57 + "\"MEMBER_NAME_CARD\" TEXT);"); // 7: memberNameCard
  58 + }
  59 +
  60 + /** Drops the underlying database table. */
  61 + public static void dropTable(Database db, boolean ifExists) {
  62 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMGROUP_MEMBERS_LIST\"";
  63 + db.execSQL(sql);
  64 + }
  65 +
  66 + @Override
  67 + protected final void bindValues(DatabaseStatement stmt, IMGroupMembersList entity) {
  68 + stmt.clearBindings();
  69 +
  70 + Long id = entity.getId();
  71 + if (id != null) {
  72 + stmt.bindLong(1, id);
  73 + }
  74 +
  75 + String GroupId = entity.getGroupId();
  76 + if (GroupId != null) {
  77 + stmt.bindString(2, GroupId);
  78 + }
  79 +
  80 + String memberId = entity.getMemberId();
  81 + if (memberId != null) {
  82 + stmt.bindString(3, memberId);
  83 + }
  84 +
  85 + String memberRemark = entity.getMemberRemark();
  86 + if (memberRemark != null) {
  87 + stmt.bindString(4, memberRemark);
  88 + }
  89 +
  90 + String memberFaceUrl = entity.getMemberFaceUrl();
  91 + if (memberFaceUrl != null) {
  92 + stmt.bindString(5, memberFaceUrl);
  93 + }
  94 +
  95 + String memberNick = entity.getMemberNick();
  96 + if (memberNick != null) {
  97 + stmt.bindString(6, memberNick);
  98 + }
  99 +
  100 + String memberRoleType = entity.getMemberRoleType();
  101 + if (memberRoleType != null) {
  102 + stmt.bindString(7, memberRoleType);
  103 + }
  104 +
  105 + String memberNameCard = entity.getMemberNameCard();
  106 + if (memberNameCard != null) {
  107 + stmt.bindString(8, memberNameCard);
  108 + }
  109 + }
  110 +
  111 + @Override
  112 + protected final void bindValues(SQLiteStatement stmt, IMGroupMembersList entity) {
  113 + stmt.clearBindings();
  114 +
  115 + Long id = entity.getId();
  116 + if (id != null) {
  117 + stmt.bindLong(1, id);
  118 + }
  119 +
  120 + String GroupId = entity.getGroupId();
  121 + if (GroupId != null) {
  122 + stmt.bindString(2, GroupId);
  123 + }
  124 +
  125 + String memberId = entity.getMemberId();
  126 + if (memberId != null) {
  127 + stmt.bindString(3, memberId);
  128 + }
  129 +
  130 + String memberRemark = entity.getMemberRemark();
  131 + if (memberRemark != null) {
  132 + stmt.bindString(4, memberRemark);
  133 + }
  134 +
  135 + String memberFaceUrl = entity.getMemberFaceUrl();
  136 + if (memberFaceUrl != null) {
  137 + stmt.bindString(5, memberFaceUrl);
  138 + }
  139 +
  140 + String memberNick = entity.getMemberNick();
  141 + if (memberNick != null) {
  142 + stmt.bindString(6, memberNick);
  143 + }
  144 +
  145 + String memberRoleType = entity.getMemberRoleType();
  146 + if (memberRoleType != null) {
  147 + stmt.bindString(7, memberRoleType);
  148 + }
  149 +
  150 + String memberNameCard = entity.getMemberNameCard();
  151 + if (memberNameCard != null) {
  152 + stmt.bindString(8, memberNameCard);
  153 + }
  154 + }
  155 +
  156 + @Override
  157 + public Long readKey(Cursor cursor, int offset) {
  158 + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  159 + }
  160 +
  161 + @Override
  162 + public IMGroupMembersList readEntity(Cursor cursor, int offset) {
  163 + IMGroupMembersList entity = new IMGroupMembersList( //
  164 + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  165 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // GroupId
  166 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // memberId
  167 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // memberRemark
  168 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // memberFaceUrl
  169 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // memberNick
  170 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // memberRoleType
  171 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // memberNameCard
  172 + );
  173 + return entity;
  174 + }
  175 +
  176 + @Override
  177 + public void readEntity(Cursor cursor, IMGroupMembersList entity, int offset) {
  178 + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  179 + entity.setGroupId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  180 + entity.setMemberId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  181 + entity.setMemberRemark(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  182 + entity.setMemberFaceUrl(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  183 + entity.setMemberNick(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  184 + entity.setMemberRoleType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  185 + entity.setMemberNameCard(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  186 + }
  187 +
  188 + @Override
  189 + protected final Long updateKeyAfterInsert(IMGroupMembersList entity, long rowId) {
  190 + entity.setId(rowId);
  191 + return rowId;
  192 + }
  193 +
  194 + @Override
  195 + public Long getKey(IMGroupMembersList entity) {
  196 + if(entity != null) {
  197 + return entity.getId();
  198 + } else {
  199 + return null;
  200 + }
  201 + }
  202 +
  203 + @Override
  204 + public boolean hasKey(IMGroupMembersList entity) {
  205 + return entity.getId() != null;
  206 + }
  207 +
  208 + @Override
  209 + protected final boolean isEntityUpdateable() {
  210 + return true;
  211 + }
  212 +
  213 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMGroupMembersManagerListDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMGroupMembersManagerList;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMGROUP_MEMBERS_MANAGER_LIST".
  17 +*/
  18 +public class IMGroupMembersManagerListDao extends AbstractDao<IMGroupMembersManagerList, Long> {
  19 +
  20 + public static final String TABLENAME = "IMGROUP_MEMBERS_MANAGER_LIST";
  21 +
  22 + /**
  23 + * Properties of entity IMGroupMembersManagerList.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Id = new Property(0, Long.class, "id", true, "_id");
  28 + public final static Property GroupId = new Property(1, String.class, "GroupId", false, "GROUP_ID");
  29 + public final static Property MemberId = new Property(2, String.class, "memberId", false, "MEMBER_ID");
  30 + }
  31 +
  32 +
  33 + public IMGroupMembersManagerListDao(DaoConfig config) {
  34 + super(config);
  35 + }
  36 +
  37 + public IMGroupMembersManagerListDao(DaoConfig config, DaoSession daoSession) {
  38 + super(config, daoSession);
  39 + }
  40 +
  41 + /** Creates the underlying database table. */
  42 + public static void createTable(Database db, boolean ifNotExists) {
  43 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  44 + db.execSQL("CREATE TABLE " + constraint + "\"IMGROUP_MEMBERS_MANAGER_LIST\" (" + //
  45 + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
  46 + "\"GROUP_ID\" TEXT," + // 1: GroupId
  47 + "\"MEMBER_ID\" TEXT);"); // 2: memberId
  48 + }
  49 +
  50 + /** Drops the underlying database table. */
  51 + public static void dropTable(Database db, boolean ifExists) {
  52 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMGROUP_MEMBERS_MANAGER_LIST\"";
  53 + db.execSQL(sql);
  54 + }
  55 +
  56 + @Override
  57 + protected final void bindValues(DatabaseStatement stmt, IMGroupMembersManagerList entity) {
  58 + stmt.clearBindings();
  59 +
  60 + Long id = entity.getId();
  61 + if (id != null) {
  62 + stmt.bindLong(1, id);
  63 + }
  64 +
  65 + String GroupId = entity.getGroupId();
  66 + if (GroupId != null) {
  67 + stmt.bindString(2, GroupId);
  68 + }
  69 +
  70 + String memberId = entity.getMemberId();
  71 + if (memberId != null) {
  72 + stmt.bindString(3, memberId);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + protected final void bindValues(SQLiteStatement stmt, IMGroupMembersManagerList entity) {
  78 + stmt.clearBindings();
  79 +
  80 + Long id = entity.getId();
  81 + if (id != null) {
  82 + stmt.bindLong(1, id);
  83 + }
  84 +
  85 + String GroupId = entity.getGroupId();
  86 + if (GroupId != null) {
  87 + stmt.bindString(2, GroupId);
  88 + }
  89 +
  90 + String memberId = entity.getMemberId();
  91 + if (memberId != null) {
  92 + stmt.bindString(3, memberId);
  93 + }
  94 + }
  95 +
  96 + @Override
  97 + public Long readKey(Cursor cursor, int offset) {
  98 + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
  99 + }
  100 +
  101 + @Override
  102 + public IMGroupMembersManagerList readEntity(Cursor cursor, int offset) {
  103 + IMGroupMembersManagerList entity = new IMGroupMembersManagerList( //
  104 + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
  105 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // GroupId
  106 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2) // memberId
  107 + );
  108 + return entity;
  109 + }
  110 +
  111 + @Override
  112 + public void readEntity(Cursor cursor, IMGroupMembersManagerList entity, int offset) {
  113 + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
  114 + entity.setGroupId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  115 + entity.setMemberId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  116 + }
  117 +
  118 + @Override
  119 + protected final Long updateKeyAfterInsert(IMGroupMembersManagerList entity, long rowId) {
  120 + entity.setId(rowId);
  121 + return rowId;
  122 + }
  123 +
  124 + @Override
  125 + public Long getKey(IMGroupMembersManagerList entity) {
  126 + if(entity != null) {
  127 + return entity.getId();
  128 + } else {
  129 + return null;
  130 + }
  131 + }
  132 +
  133 + @Override
  134 + public boolean hasKey(IMGroupMembersManagerList entity) {
  135 + return entity.getId() != null;
  136 + }
  137 +
  138 + @Override
  139 + protected final boolean isEntityUpdateable() {
  140 + return true;
  141 + }
  142 +
  143 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/IMUserInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.IMUserInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "IMUSER_INFO".
  17 +*/
  18 +public class IMUserInfoDao extends AbstractDao<IMUserInfo, String> {
  19 +
  20 + public static final String TABLENAME = "IMUSER_INFO";
  21 +
  22 + /**
  23 + * Properties of entity IMUserInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property UserId = new Property(0, String.class, "UserId", true, "USER_ID");
  28 + public final static Property NickName = new Property(1, String.class, "NickName", false, "NICK_NAME");
  29 + public final static Property Remark = new Property(2, String.class, "Remark", false, "REMARK");
  30 + public final static Property FaceUrl = new Property(3, String.class, "FaceUrl", false, "FACE_URL");
  31 + }
  32 +
  33 +
  34 + public IMUserInfoDao(DaoConfig config) {
  35 + super(config);
  36 + }
  37 +
  38 + public IMUserInfoDao(DaoConfig config, DaoSession daoSession) {
  39 + super(config, daoSession);
  40 + }
  41 +
  42 + /** Creates the underlying database table. */
  43 + public static void createTable(Database db, boolean ifNotExists) {
  44 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  45 + db.execSQL("CREATE TABLE " + constraint + "\"IMUSER_INFO\" (" + //
  46 + "\"USER_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: UserId
  47 + "\"NICK_NAME\" TEXT," + // 1: NickName
  48 + "\"REMARK\" TEXT," + // 2: Remark
  49 + "\"FACE_URL\" TEXT);"); // 3: FaceUrl
  50 + }
  51 +
  52 + /** Drops the underlying database table. */
  53 + public static void dropTable(Database db, boolean ifExists) {
  54 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"IMUSER_INFO\"";
  55 + db.execSQL(sql);
  56 + }
  57 +
  58 + @Override
  59 + protected final void bindValues(DatabaseStatement stmt, IMUserInfo entity) {
  60 + stmt.clearBindings();
  61 + stmt.bindString(1, entity.getUserId());
  62 +
  63 + String NickName = entity.getNickName();
  64 + if (NickName != null) {
  65 + stmt.bindString(2, NickName);
  66 + }
  67 +
  68 + String Remark = entity.getRemark();
  69 + if (Remark != null) {
  70 + stmt.bindString(3, Remark);
  71 + }
  72 +
  73 + String FaceUrl = entity.getFaceUrl();
  74 + if (FaceUrl != null) {
  75 + stmt.bindString(4, FaceUrl);
  76 + }
  77 + }
  78 +
  79 + @Override
  80 + protected final void bindValues(SQLiteStatement stmt, IMUserInfo entity) {
  81 + stmt.clearBindings();
  82 + stmt.bindString(1, entity.getUserId());
  83 +
  84 + String NickName = entity.getNickName();
  85 + if (NickName != null) {
  86 + stmt.bindString(2, NickName);
  87 + }
  88 +
  89 + String Remark = entity.getRemark();
  90 + if (Remark != null) {
  91 + stmt.bindString(3, Remark);
  92 + }
  93 +
  94 + String FaceUrl = entity.getFaceUrl();
  95 + if (FaceUrl != null) {
  96 + stmt.bindString(4, FaceUrl);
  97 + }
  98 + }
  99 +
  100 + @Override
  101 + public String readKey(Cursor cursor, int offset) {
  102 + return cursor.getString(offset + 0);
  103 + }
  104 +
  105 + @Override
  106 + public IMUserInfo readEntity(Cursor cursor, int offset) {
  107 + IMUserInfo entity = new IMUserInfo( //
  108 + cursor.getString(offset + 0), // UserId
  109 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // NickName
  110 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // Remark
  111 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // FaceUrl
  112 + );
  113 + return entity;
  114 + }
  115 +
  116 + @Override
  117 + public void readEntity(Cursor cursor, IMUserInfo entity, int offset) {
  118 + entity.setUserId(cursor.getString(offset + 0));
  119 + entity.setNickName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  120 + entity.setRemark(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  121 + entity.setFaceUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  122 + }
  123 +
  124 + @Override
  125 + protected final String updateKeyAfterInsert(IMUserInfo entity, long rowId) {
  126 + return entity.getUserId();
  127 + }
  128 +
  129 + @Override
  130 + public String getKey(IMUserInfo entity) {
  131 + if(entity != null) {
  132 + return entity.getUserId();
  133 + } else {
  134 + return null;
  135 + }
  136 + }
  137 +
  138 + @Override
  139 + public boolean hasKey(IMUserInfo entity) {
  140 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  141 + }
  142 +
  143 + @Override
  144 + protected final boolean isEntityUpdateable() {
  145 + return true;
  146 + }
  147 +
  148 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/LaunchAdInfoDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.LaunchAdInfo;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "LAUNCH_AD_INFO".
  17 +*/
  18 +public class LaunchAdInfoDao extends AbstractDao<LaunchAdInfo, String> {
  19 +
  20 + public static final String TABLENAME = "LAUNCH_AD_INFO";
  21 +
  22 + /**
  23 + * Properties of entity LaunchAdInfo.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Appid = new Property(0, String.class, "appid", true, "APPID");
  28 + public final static Property Id = new Property(1, String.class, "id", false, "ID");
  29 + public final static Property WjjAdUrl = new Property(2, String.class, "wjjAdUrl", false, "WJJ_AD_URL");
  30 + public final static Property WjjAdImgUrl = new Property(3, String.class, "wjjAdImgUrl", false, "WJJ_AD_IMG_URL");
  31 + public final static Property WjjAdv = new Property(4, Boolean.class, "wjjAdv", false, "WJJ_ADV");
  32 + public final static Property WjjAdImgPath = new Property(5, String.class, "wjjAdImgPath", false, "WJJ_AD_IMG_PATH");
  33 + public final static Property Duration = new Property(6, Integer.class, "duration", false, "DURATION");
  34 + public final static Property ModifyStatus = new Property(7, Integer.class, "modifyStatus", false, "MODIFY_STATUS");
  35 + }
  36 +
  37 +
  38 + public LaunchAdInfoDao(DaoConfig config) {
  39 + super(config);
  40 + }
  41 +
  42 + public LaunchAdInfoDao(DaoConfig config, DaoSession daoSession) {
  43 + super(config, daoSession);
  44 + }
  45 +
  46 + /** Creates the underlying database table. */
  47 + public static void createTable(Database db, boolean ifNotExists) {
  48 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  49 + db.execSQL("CREATE TABLE " + constraint + "\"LAUNCH_AD_INFO\" (" + //
  50 + "\"APPID\" TEXT PRIMARY KEY NOT NULL ," + // 0: appid
  51 + "\"ID\" TEXT," + // 1: id
  52 + "\"WJJ_AD_URL\" TEXT," + // 2: wjjAdUrl
  53 + "\"WJJ_AD_IMG_URL\" TEXT," + // 3: wjjAdImgUrl
  54 + "\"WJJ_ADV\" INTEGER," + // 4: wjjAdv
  55 + "\"WJJ_AD_IMG_PATH\" TEXT," + // 5: wjjAdImgPath
  56 + "\"DURATION\" INTEGER," + // 6: duration
  57 + "\"MODIFY_STATUS\" INTEGER);"); // 7: modifyStatus
  58 + }
  59 +
  60 + /** Drops the underlying database table. */
  61 + public static void dropTable(Database db, boolean ifExists) {
  62 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LAUNCH_AD_INFO\"";
  63 + db.execSQL(sql);
  64 + }
  65 +
  66 + @Override
  67 + protected final void bindValues(DatabaseStatement stmt, LaunchAdInfo entity) {
  68 + stmt.clearBindings();
  69 + stmt.bindString(1, entity.getAppid());
  70 +
  71 + String id = entity.getId();
  72 + if (id != null) {
  73 + stmt.bindString(2, id);
  74 + }
  75 +
  76 + String wjjAdUrl = entity.getWjjAdUrl();
  77 + if (wjjAdUrl != null) {
  78 + stmt.bindString(3, wjjAdUrl);
  79 + }
  80 +
  81 + String wjjAdImgUrl = entity.getWjjAdImgUrl();
  82 + if (wjjAdImgUrl != null) {
  83 + stmt.bindString(4, wjjAdImgUrl);
  84 + }
  85 +
  86 + Boolean wjjAdv = entity.getWjjAdv();
  87 + if (wjjAdv != null) {
  88 + stmt.bindLong(5, wjjAdv ? 1L: 0L);
  89 + }
  90 +
  91 + String wjjAdImgPath = entity.getWjjAdImgPath();
  92 + if (wjjAdImgPath != null) {
  93 + stmt.bindString(6, wjjAdImgPath);
  94 + }
  95 +
  96 + Integer duration = entity.getDuration();
  97 + if (duration != null) {
  98 + stmt.bindLong(7, duration);
  99 + }
  100 +
  101 + Integer modifyStatus = entity.getModifyStatus();
  102 + if (modifyStatus != null) {
  103 + stmt.bindLong(8, modifyStatus);
  104 + }
  105 + }
  106 +
  107 + @Override
  108 + protected final void bindValues(SQLiteStatement stmt, LaunchAdInfo entity) {
  109 + stmt.clearBindings();
  110 + stmt.bindString(1, entity.getAppid());
  111 +
  112 + String id = entity.getId();
  113 + if (id != null) {
  114 + stmt.bindString(2, id);
  115 + }
  116 +
  117 + String wjjAdUrl = entity.getWjjAdUrl();
  118 + if (wjjAdUrl != null) {
  119 + stmt.bindString(3, wjjAdUrl);
  120 + }
  121 +
  122 + String wjjAdImgUrl = entity.getWjjAdImgUrl();
  123 + if (wjjAdImgUrl != null) {
  124 + stmt.bindString(4, wjjAdImgUrl);
  125 + }
  126 +
  127 + Boolean wjjAdv = entity.getWjjAdv();
  128 + if (wjjAdv != null) {
  129 + stmt.bindLong(5, wjjAdv ? 1L: 0L);
  130 + }
  131 +
  132 + String wjjAdImgPath = entity.getWjjAdImgPath();
  133 + if (wjjAdImgPath != null) {
  134 + stmt.bindString(6, wjjAdImgPath);
  135 + }
  136 +
  137 + Integer duration = entity.getDuration();
  138 + if (duration != null) {
  139 + stmt.bindLong(7, duration);
  140 + }
  141 +
  142 + Integer modifyStatus = entity.getModifyStatus();
  143 + if (modifyStatus != null) {
  144 + stmt.bindLong(8, modifyStatus);
  145 + }
  146 + }
  147 +
  148 + @Override
  149 + public String readKey(Cursor cursor, int offset) {
  150 + return cursor.getString(offset + 0);
  151 + }
  152 +
  153 + @Override
  154 + public LaunchAdInfo readEntity(Cursor cursor, int offset) {
  155 + LaunchAdInfo entity = new LaunchAdInfo( //
  156 + cursor.getString(offset + 0), // appid
  157 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // id
  158 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // wjjAdUrl
  159 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // wjjAdImgUrl
  160 + cursor.isNull(offset + 4) ? null : cursor.getShort(offset + 4) != 0, // wjjAdv
  161 + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // wjjAdImgPath
  162 + cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6), // duration
  163 + cursor.isNull(offset + 7) ? null : cursor.getInt(offset + 7) // modifyStatus
  164 + );
  165 + return entity;
  166 + }
  167 +
  168 + @Override
  169 + public void readEntity(Cursor cursor, LaunchAdInfo entity, int offset) {
  170 + entity.setAppid(cursor.getString(offset + 0));
  171 + entity.setId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  172 + entity.setWjjAdUrl(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  173 + entity.setWjjAdImgUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  174 + entity.setWjjAdv(cursor.isNull(offset + 4) ? null : cursor.getShort(offset + 4) != 0);
  175 + entity.setWjjAdImgPath(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
  176 + entity.setDuration(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6));
  177 + entity.setModifyStatus(cursor.isNull(offset + 7) ? null : cursor.getInt(offset + 7));
  178 + }
  179 +
  180 + @Override
  181 + protected final String updateKeyAfterInsert(LaunchAdInfo entity, long rowId) {
  182 + return entity.getAppid();
  183 + }
  184 +
  185 + @Override
  186 + public String getKey(LaunchAdInfo entity) {
  187 + if(entity != null) {
  188 + return entity.getAppid();
  189 + } else {
  190 + return null;
  191 + }
  192 + }
  193 +
  194 + @Override
  195 + public boolean hasKey(LaunchAdInfo entity) {
  196 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  197 + }
  198 +
  199 + @Override
  200 + protected final boolean isEntityUpdateable() {
  201 + return true;
  202 + }
  203 +
  204 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/NewContactFriendEntityDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.NewContactFriendEntity;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "NEW_CONTACT_FRIEND_ENTITY".
  17 +*/
  18 +public class NewContactFriendEntityDao extends AbstractDao<NewContactFriendEntity, String> {
  19 +
  20 + public static final String TABLENAME = "NEW_CONTACT_FRIEND_ENTITY";
  21 +
  22 + /**
  23 + * Properties of entity NewContactFriendEntity.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Uid = new Property(0, String.class, "uid", true, "UID");
  28 + public final static Property CacheData = new Property(1, String.class, "cacheData", false, "CACHE_DATA");
  29 + }
  30 +
  31 +
  32 + public NewContactFriendEntityDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public NewContactFriendEntityDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"NEW_CONTACT_FRIEND_ENTITY\" (" + //
  44 + "\"UID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uid
  45 + "\"CACHE_DATA\" TEXT);"); // 1: cacheData
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NEW_CONTACT_FRIEND_ENTITY\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, NewContactFriendEntity entity) {
  56 + stmt.clearBindings();
  57 +
  58 + String uid = entity.getUid();
  59 + if (uid != null) {
  60 + stmt.bindString(1, uid);
  61 + }
  62 +
  63 + String cacheData = entity.getCacheData();
  64 + if (cacheData != null) {
  65 + stmt.bindString(2, cacheData);
  66 + }
  67 + }
  68 +
  69 + @Override
  70 + protected final void bindValues(SQLiteStatement stmt, NewContactFriendEntity entity) {
  71 + stmt.clearBindings();
  72 +
  73 + String uid = entity.getUid();
  74 + if (uid != null) {
  75 + stmt.bindString(1, uid);
  76 + }
  77 +
  78 + String cacheData = entity.getCacheData();
  79 + if (cacheData != null) {
  80 + stmt.bindString(2, cacheData);
  81 + }
  82 + }
  83 +
  84 + @Override
  85 + public String readKey(Cursor cursor, int offset) {
  86 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  87 + }
  88 +
  89 + @Override
  90 + public NewContactFriendEntity readEntity(Cursor cursor, int offset) {
  91 + NewContactFriendEntity entity = new NewContactFriendEntity( //
  92 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uid
  93 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // cacheData
  94 + );
  95 + return entity;
  96 + }
  97 +
  98 + @Override
  99 + public void readEntity(Cursor cursor, NewContactFriendEntity entity, int offset) {
  100 + entity.setUid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  101 + entity.setCacheData(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  102 + }
  103 +
  104 + @Override
  105 + protected final String updateKeyAfterInsert(NewContactFriendEntity entity, long rowId) {
  106 + return entity.getUid();
  107 + }
  108 +
  109 + @Override
  110 + public String getKey(NewContactFriendEntity entity) {
  111 + if(entity != null) {
  112 + return entity.getUid();
  113 + } else {
  114 + return null;
  115 + }
  116 + }
  117 +
  118 + @Override
  119 + public boolean hasKey(NewContactFriendEntity entity) {
  120 + return entity.getUid() != null;
  121 + }
  122 +
  123 + @Override
  124 + protected final boolean isEntityUpdateable() {
  125 + return true;
  126 + }
  127 +
  128 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/NewPhoneContactEntityDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.NewPhoneContactEntity;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "NEW_PHONE_CONTACT_ENTITY".
  17 +*/
  18 +public class NewPhoneContactEntityDao extends AbstractDao<NewPhoneContactEntity, String> {
  19 +
  20 + public static final String TABLENAME = "NEW_PHONE_CONTACT_ENTITY";
  21 +
  22 + /**
  23 + * Properties of entity NewPhoneContactEntity.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Uid = new Property(0, String.class, "uid", true, "UID");
  28 + public final static Property CacheData = new Property(1, String.class, "cacheData", false, "CACHE_DATA");
  29 + }
  30 +
  31 +
  32 + public NewPhoneContactEntityDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public NewPhoneContactEntityDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"NEW_PHONE_CONTACT_ENTITY\" (" + //
  44 + "\"UID\" TEXT PRIMARY KEY NOT NULL ," + // 0: uid
  45 + "\"CACHE_DATA\" TEXT);"); // 1: cacheData
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NEW_PHONE_CONTACT_ENTITY\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, NewPhoneContactEntity entity) {
  56 + stmt.clearBindings();
  57 +
  58 + String uid = entity.getUid();
  59 + if (uid != null) {
  60 + stmt.bindString(1, uid);
  61 + }
  62 +
  63 + String cacheData = entity.getCacheData();
  64 + if (cacheData != null) {
  65 + stmt.bindString(2, cacheData);
  66 + }
  67 + }
  68 +
  69 + @Override
  70 + protected final void bindValues(SQLiteStatement stmt, NewPhoneContactEntity entity) {
  71 + stmt.clearBindings();
  72 +
  73 + String uid = entity.getUid();
  74 + if (uid != null) {
  75 + stmt.bindString(1, uid);
  76 + }
  77 +
  78 + String cacheData = entity.getCacheData();
  79 + if (cacheData != null) {
  80 + stmt.bindString(2, cacheData);
  81 + }
  82 + }
  83 +
  84 + @Override
  85 + public String readKey(Cursor cursor, int offset) {
  86 + return cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0);
  87 + }
  88 +
  89 + @Override
  90 + public NewPhoneContactEntity readEntity(Cursor cursor, int offset) {
  91 + NewPhoneContactEntity entity = new NewPhoneContactEntity( //
  92 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // uid
  93 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // cacheData
  94 + );
  95 + return entity;
  96 + }
  97 +
  98 + @Override
  99 + public void readEntity(Cursor cursor, NewPhoneContactEntity entity, int offset) {
  100 + entity.setUid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  101 + entity.setCacheData(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  102 + }
  103 +
  104 + @Override
  105 + protected final String updateKeyAfterInsert(NewPhoneContactEntity entity, long rowId) {
  106 + return entity.getUid();
  107 + }
  108 +
  109 + @Override
  110 + public String getKey(NewPhoneContactEntity entity) {
  111 + if(entity != null) {
  112 + return entity.getUid();
  113 + } else {
  114 + return null;
  115 + }
  116 + }
  117 +
  118 + @Override
  119 + public boolean hasKey(NewPhoneContactEntity entity) {
  120 + return entity.getUid() != null;
  121 + }
  122 +
  123 + @Override
  124 + protected final boolean isEntityUpdateable() {
  125 + return true;
  126 + }
  127 +
  128 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/NewsNumberDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.NewsNumber;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "NEWS_NUMBER".
  17 +*/
  18 +public class NewsNumberDao extends AbstractDao<NewsNumber, String> {
  19 +
  20 + public static final String TABLENAME = "NEWS_NUMBER";
  21 +
  22 + /**
  23 + * Properties of entity NewsNumber.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Ts = new Property(0, String.class, "ts", true, "TS");
  28 + public final static Property NewsList = new Property(1, String.class, "newsList", false, "NEWS_LIST");
  29 + }
  30 +
  31 +
  32 + public NewsNumberDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public NewsNumberDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"NEWS_NUMBER\" (" + //
  44 + "\"TS\" TEXT PRIMARY KEY NOT NULL ," + // 0: ts
  45 + "\"NEWS_LIST\" TEXT);"); // 1: newsList
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NEWS_NUMBER\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, NewsNumber entity) {
  56 + stmt.clearBindings();
  57 + stmt.bindString(1, entity.getTs());
  58 +
  59 + String newsList = entity.getNewsList();
  60 + if (newsList != null) {
  61 + stmt.bindString(2, newsList);
  62 + }
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, NewsNumber entity) {
  67 + stmt.clearBindings();
  68 + stmt.bindString(1, entity.getTs());
  69 +
  70 + String newsList = entity.getNewsList();
  71 + if (newsList != null) {
  72 + stmt.bindString(2, newsList);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 0);
  79 + }
  80 +
  81 + @Override
  82 + public NewsNumber readEntity(Cursor cursor, int offset) {
  83 + NewsNumber entity = new NewsNumber( //
  84 + cursor.getString(offset + 0), // ts
  85 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1) // newsList
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, NewsNumber entity, int offset) {
  92 + entity.setTs(cursor.getString(offset + 0));
  93 + entity.setNewsList(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(NewsNumber entity, long rowId) {
  98 + return entity.getTs();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(NewsNumber entity) {
  103 + if(entity != null) {
  104 + return entity.getTs();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(NewsNumber entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/SearchContentDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.SearchContent;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "SEARCH_CONTENT".
  17 +*/
  18 +public class SearchContentDao extends AbstractDao<SearchContent, String> {
  19 +
  20 + public static final String TABLENAME = "SEARCH_CONTENT";
  21 +
  22 + /**
  23 + * Properties of entity SearchContent.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", false, "SID");
  28 + public final static Property Content = new Property(1, String.class, "content", true, "CONTENT");
  29 + }
  30 +
  31 +
  32 + public SearchContentDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public SearchContentDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"SEARCH_CONTENT\" (" + //
  44 + "\"SID\" TEXT," + // 0: sid
  45 + "\"CONTENT\" TEXT PRIMARY KEY NOT NULL );"); // 1: content
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SEARCH_CONTENT\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, SearchContent entity) {
  56 + stmt.clearBindings();
  57 +
  58 + String sid = entity.getSid();
  59 + if (sid != null) {
  60 + stmt.bindString(1, sid);
  61 + }
  62 + stmt.bindString(2, entity.getContent());
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, SearchContent entity) {
  67 + stmt.clearBindings();
  68 +
  69 + String sid = entity.getSid();
  70 + if (sid != null) {
  71 + stmt.bindString(1, sid);
  72 + }
  73 + stmt.bindString(2, entity.getContent());
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 1);
  79 + }
  80 +
  81 + @Override
  82 + public SearchContent readEntity(Cursor cursor, int offset) {
  83 + SearchContent entity = new SearchContent( //
  84 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // sid
  85 + cursor.getString(offset + 1) // content
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, SearchContent entity, int offset) {
  92 + entity.setSid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  93 + entity.setContent(cursor.getString(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(SearchContent entity, long rowId) {
  98 + return entity.getContent();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(SearchContent entity) {
  103 + if(entity != null) {
  104 + return entity.getContent();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(SearchContent entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/SearchHistoryDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.SearchHistory;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "SEARCH_HISTORY".
  17 +*/
  18 +public class SearchHistoryDao extends AbstractDao<SearchHistory, String> {
  19 +
  20 + public static final String TABLENAME = "SEARCH_HISTORY";
  21 +
  22 + /**
  23 + * Properties of entity SearchHistory.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Sid = new Property(0, String.class, "sid", false, "SID");
  28 + public final static Property History = new Property(1, String.class, "history", true, "HISTORY");
  29 + }
  30 +
  31 +
  32 + public SearchHistoryDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public SearchHistoryDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"SEARCH_HISTORY\" (" + //
  44 + "\"SID\" TEXT," + // 0: sid
  45 + "\"HISTORY\" TEXT PRIMARY KEY NOT NULL );"); // 1: history
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SEARCH_HISTORY\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, SearchHistory entity) {
  56 + stmt.clearBindings();
  57 +
  58 + String sid = entity.getSid();
  59 + if (sid != null) {
  60 + stmt.bindString(1, sid);
  61 + }
  62 + stmt.bindString(2, entity.getHistory());
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, SearchHistory entity) {
  67 + stmt.clearBindings();
  68 +
  69 + String sid = entity.getSid();
  70 + if (sid != null) {
  71 + stmt.bindString(1, sid);
  72 + }
  73 + stmt.bindString(2, entity.getHistory());
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 1);
  79 + }
  80 +
  81 + @Override
  82 + public SearchHistory readEntity(Cursor cursor, int offset) {
  83 + SearchHistory entity = new SearchHistory( //
  84 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // sid
  85 + cursor.getString(offset + 1) // history
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, SearchHistory entity, int offset) {
  92 + entity.setSid(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  93 + entity.setHistory(cursor.getString(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(SearchHistory entity, long rowId) {
  98 + return entity.getHistory();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(SearchHistory entity) {
  103 + if(entity != null) {
  104 + return entity.getHistory();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(SearchHistory entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/SysNumReadableDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.SysNumReadable;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "SYS_NUM_READABLE".
  17 +*/
  18 +public class SysNumReadableDao extends AbstractDao<SysNumReadable, String> {
  19 +
  20 + public static final String TABLENAME = "SYS_NUM_READABLE";
  21 +
  22 + /**
  23 + * Properties of entity SysNumReadable.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property HomeId = new Property(0, String.class, "homeId", true, "HOME_ID");
  28 + public final static Property TimeStep = new Property(1, Long.class, "timeStep", false, "TIME_STEP");
  29 + }
  30 +
  31 +
  32 + public SysNumReadableDao(DaoConfig config) {
  33 + super(config);
  34 + }
  35 +
  36 + public SysNumReadableDao(DaoConfig config, DaoSession daoSession) {
  37 + super(config, daoSession);
  38 + }
  39 +
  40 + /** Creates the underlying database table. */
  41 + public static void createTable(Database db, boolean ifNotExists) {
  42 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  43 + db.execSQL("CREATE TABLE " + constraint + "\"SYS_NUM_READABLE\" (" + //
  44 + "\"HOME_ID\" TEXT PRIMARY KEY NOT NULL ," + // 0: homeId
  45 + "\"TIME_STEP\" INTEGER);"); // 1: timeStep
  46 + }
  47 +
  48 + /** Drops the underlying database table. */
  49 + public static void dropTable(Database db, boolean ifExists) {
  50 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SYS_NUM_READABLE\"";
  51 + db.execSQL(sql);
  52 + }
  53 +
  54 + @Override
  55 + protected final void bindValues(DatabaseStatement stmt, SysNumReadable entity) {
  56 + stmt.clearBindings();
  57 + stmt.bindString(1, entity.getHomeId());
  58 +
  59 + Long timeStep = entity.getTimeStep();
  60 + if (timeStep != null) {
  61 + stmt.bindLong(2, timeStep);
  62 + }
  63 + }
  64 +
  65 + @Override
  66 + protected final void bindValues(SQLiteStatement stmt, SysNumReadable entity) {
  67 + stmt.clearBindings();
  68 + stmt.bindString(1, entity.getHomeId());
  69 +
  70 + Long timeStep = entity.getTimeStep();
  71 + if (timeStep != null) {
  72 + stmt.bindLong(2, timeStep);
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public String readKey(Cursor cursor, int offset) {
  78 + return cursor.getString(offset + 0);
  79 + }
  80 +
  81 + @Override
  82 + public SysNumReadable readEntity(Cursor cursor, int offset) {
  83 + SysNumReadable entity = new SysNumReadable( //
  84 + cursor.getString(offset + 0), // homeId
  85 + cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1) // timeStep
  86 + );
  87 + return entity;
  88 + }
  89 +
  90 + @Override
  91 + public void readEntity(Cursor cursor, SysNumReadable entity, int offset) {
  92 + entity.setHomeId(cursor.getString(offset + 0));
  93 + entity.setTimeStep(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1));
  94 + }
  95 +
  96 + @Override
  97 + protected final String updateKeyAfterInsert(SysNumReadable entity, long rowId) {
  98 + return entity.getHomeId();
  99 + }
  100 +
  101 + @Override
  102 + public String getKey(SysNumReadable entity) {
  103 + if(entity != null) {
  104 + return entity.getHomeId();
  105 + } else {
  106 + return null;
  107 + }
  108 + }
  109 +
  110 + @Override
  111 + public boolean hasKey(SysNumReadable entity) {
  112 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  113 + }
  114 +
  115 + @Override
  116 + protected final boolean isEntityUpdateable() {
  117 + return true;
  118 + }
  119 +
  120 +}
... ...
core/database/src/main/java/com/cnlive/database/dao/WitnessDao.java 0 → 100644
  1 +package com.cnlive.database.dao;
  2 +
  3 +import android.database.Cursor;
  4 +import android.database.sqlite.SQLiteStatement;
  5 +
  6 +import org.greenrobot.greendao.AbstractDao;
  7 +import org.greenrobot.greendao.Property;
  8 +import org.greenrobot.greendao.internal.DaoConfig;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.database.DatabaseStatement;
  11 +
  12 +import com.cnlive.database.bean.Witness;
  13 +
  14 +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
  15 +/**
  16 + * DAO for table "WITNESS".
  17 +*/
  18 +public class WitnessDao extends AbstractDao<Witness, String> {
  19 +
  20 + public static final String TABLENAME = "WITNESS";
  21 +
  22 + /**
  23 + * Properties of entity Witness.<br/>
  24 + * Can be used for QueryBuilder and for referencing column names.
  25 + */
  26 + public static class Properties {
  27 + public final static Property Id = new Property(0, String.class, "id", false, "ID");
  28 + public final static Property Sid = new Property(1, String.class, "sid", false, "SID");
  29 + public final static Property Medias = new Property(2, String.class, "medias", false, "MEDIAS");
  30 + public final static Property Title = new Property(3, String.class, "title", false, "TITLE");
  31 + public final static Property Wit = new Property(4, String.class, "wit", false, "WIT");
  32 + public final static Property Type = new Property(5, Integer.class, "type", false, "TYPE");
  33 + public final static Property Videotype = new Property(6, String.class, "videotype", false, "VIDEOTYPE");
  34 + public final static Property Gopath = new Property(7, String.class, "gopath", false, "GOPATH");
  35 + public final static Property Multiplecategory = new Property(8, Integer.class, "multiplecategory", false, "MULTIPLECATEGORY");
  36 + public final static Property Tag = new Property(9, String.class, "tag", false, "TAG");
  37 + public final static Property TimeStamp = new Property(10, String.class, "timeStamp", true, "TIME_STAMP");
  38 + public final static Property Dutation = new Property(11, String.class, "dutation", false, "DUTATION");
  39 + public final static Property Src = new Property(12, String.class, "src", false, "SRC");
  40 + public final static Property Taglist = new Property(13, String.class, "taglist", false, "TAGLIST");
  41 + }
  42 +
  43 +
  44 + public WitnessDao(DaoConfig config) {
  45 + super(config);
  46 + }
  47 +
  48 + public WitnessDao(DaoConfig config, DaoSession daoSession) {
  49 + super(config, daoSession);
  50 + }
  51 +
  52 + /** Creates the underlying database table. */
  53 + public static void createTable(Database db, boolean ifNotExists) {
  54 + String constraint = ifNotExists? "IF NOT EXISTS ": "";
  55 + db.execSQL("CREATE TABLE " + constraint + "\"WITNESS\" (" + //
  56 + "\"ID\" TEXT," + // 0: id
  57 + "\"SID\" TEXT," + // 1: sid
  58 + "\"MEDIAS\" TEXT," + // 2: medias
  59 + "\"TITLE\" TEXT," + // 3: title
  60 + "\"WIT\" TEXT," + // 4: wit
  61 + "\"TYPE\" INTEGER," + // 5: type
  62 + "\"VIDEOTYPE\" TEXT," + // 6: videotype
  63 + "\"GOPATH\" TEXT," + // 7: gopath
  64 + "\"MULTIPLECATEGORY\" INTEGER," + // 8: multiplecategory
  65 + "\"TAG\" TEXT," + // 9: tag
  66 + "\"TIME_STAMP\" TEXT PRIMARY KEY NOT NULL ," + // 10: timeStamp
  67 + "\"DUTATION\" TEXT," + // 11: dutation
  68 + "\"SRC\" TEXT," + // 12: src
  69 + "\"TAGLIST\" TEXT);"); // 13: taglist
  70 + }
  71 +
  72 + /** Drops the underlying database table. */
  73 + public static void dropTable(Database db, boolean ifExists) {
  74 + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"WITNESS\"";
  75 + db.execSQL(sql);
  76 + }
  77 +
  78 + @Override
  79 + protected final void bindValues(DatabaseStatement stmt, Witness entity) {
  80 + stmt.clearBindings();
  81 +
  82 + String id = entity.getId();
  83 + if (id != null) {
  84 + stmt.bindString(1, id);
  85 + }
  86 +
  87 + String sid = entity.getSid();
  88 + if (sid != null) {
  89 + stmt.bindString(2, sid);
  90 + }
  91 +
  92 + String medias = entity.getMedias();
  93 + if (medias != null) {
  94 + stmt.bindString(3, medias);
  95 + }
  96 +
  97 + String title = entity.getTitle();
  98 + if (title != null) {
  99 + stmt.bindString(4, title);
  100 + }
  101 +
  102 + String wit = entity.getWit();
  103 + if (wit != null) {
  104 + stmt.bindString(5, wit);
  105 + }
  106 +
  107 + Integer type = entity.getType();
  108 + if (type != null) {
  109 + stmt.bindLong(6, type);
  110 + }
  111 +
  112 + String videotype = entity.getVideotype();
  113 + if (videotype != null) {
  114 + stmt.bindString(7, videotype);
  115 + }
  116 +
  117 + String gopath = entity.getGopath();
  118 + if (gopath != null) {
  119 + stmt.bindString(8, gopath);
  120 + }
  121 +
  122 + Integer multiplecategory = entity.getMultiplecategory();
  123 + if (multiplecategory != null) {
  124 + stmt.bindLong(9, multiplecategory);
  125 + }
  126 +
  127 + String tag = entity.getTag();
  128 + if (tag != null) {
  129 + stmt.bindString(10, tag);
  130 + }
  131 + stmt.bindString(11, entity.getTimeStamp());
  132 +
  133 + String dutation = entity.getDutation();
  134 + if (dutation != null) {
  135 + stmt.bindString(12, dutation);
  136 + }
  137 +
  138 + String src = entity.getSrc();
  139 + if (src != null) {
  140 + stmt.bindString(13, src);
  141 + }
  142 +
  143 + String taglist = entity.getTaglist();
  144 + if (taglist != null) {
  145 + stmt.bindString(14, taglist);
  146 + }
  147 + }
  148 +
  149 + @Override
  150 + protected final void bindValues(SQLiteStatement stmt, Witness entity) {
  151 + stmt.clearBindings();
  152 +
  153 + String id = entity.getId();
  154 + if (id != null) {
  155 + stmt.bindString(1, id);
  156 + }
  157 +
  158 + String sid = entity.getSid();
  159 + if (sid != null) {
  160 + stmt.bindString(2, sid);
  161 + }
  162 +
  163 + String medias = entity.getMedias();
  164 + if (medias != null) {
  165 + stmt.bindString(3, medias);
  166 + }
  167 +
  168 + String title = entity.getTitle();
  169 + if (title != null) {
  170 + stmt.bindString(4, title);
  171 + }
  172 +
  173 + String wit = entity.getWit();
  174 + if (wit != null) {
  175 + stmt.bindString(5, wit);
  176 + }
  177 +
  178 + Integer type = entity.getType();
  179 + if (type != null) {
  180 + stmt.bindLong(6, type);
  181 + }
  182 +
  183 + String videotype = entity.getVideotype();
  184 + if (videotype != null) {
  185 + stmt.bindString(7, videotype);
  186 + }
  187 +
  188 + String gopath = entity.getGopath();
  189 + if (gopath != null) {
  190 + stmt.bindString(8, gopath);
  191 + }
  192 +
  193 + Integer multiplecategory = entity.getMultiplecategory();
  194 + if (multiplecategory != null) {
  195 + stmt.bindLong(9, multiplecategory);
  196 + }
  197 +
  198 + String tag = entity.getTag();
  199 + if (tag != null) {
  200 + stmt.bindString(10, tag);
  201 + }
  202 + stmt.bindString(11, entity.getTimeStamp());
  203 +
  204 + String dutation = entity.getDutation();
  205 + if (dutation != null) {
  206 + stmt.bindString(12, dutation);
  207 + }
  208 +
  209 + String src = entity.getSrc();
  210 + if (src != null) {
  211 + stmt.bindString(13, src);
  212 + }
  213 +
  214 + String taglist = entity.getTaglist();
  215 + if (taglist != null) {
  216 + stmt.bindString(14, taglist);
  217 + }
  218 + }
  219 +
  220 + @Override
  221 + public String readKey(Cursor cursor, int offset) {
  222 + return cursor.getString(offset + 10);
  223 + }
  224 +
  225 + @Override
  226 + public Witness readEntity(Cursor cursor, int offset) {
  227 + Witness entity = new Witness( //
  228 + cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0), // id
  229 + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // sid
  230 + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // medias
  231 + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title
  232 + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // wit
  233 + cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // type
  234 + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // videotype
  235 + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // gopath
  236 + cursor.isNull(offset + 8) ? null : cursor.getInt(offset + 8), // multiplecategory
  237 + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // tag
  238 + cursor.getString(offset + 10), // timeStamp
  239 + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // dutation
  240 + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // src
  241 + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13) // taglist
  242 + );
  243 + return entity;
  244 + }
  245 +
  246 + @Override
  247 + public void readEntity(Cursor cursor, Witness entity, int offset) {
  248 + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getString(offset + 0));
  249 + entity.setSid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
  250 + entity.setMedias(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
  251 + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
  252 + entity.setWit(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
  253 + entity.setType(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
  254 + entity.setVideotype(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
  255 + entity.setGopath(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
  256 + entity.setMultiplecategory(cursor.isNull(offset + 8) ? null : cursor.getInt(offset + 8));
  257 + entity.setTag(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
  258 + entity.setTimeStamp(cursor.getString(offset + 10));
  259 + entity.setDutation(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11));
  260 + entity.setSrc(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12));
  261 + entity.setTaglist(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13));
  262 + }
  263 +
  264 + @Override
  265 + protected final String updateKeyAfterInsert(Witness entity, long rowId) {
  266 + return entity.getTimeStamp();
  267 + }
  268 +
  269 + @Override
  270 + public String getKey(Witness entity) {
  271 + if(entity != null) {
  272 + return entity.getTimeStamp();
  273 + } else {
  274 + return null;
  275 + }
  276 + }
  277 +
  278 + @Override
  279 + public boolean hasKey(Witness entity) {
  280 + throw new UnsupportedOperationException("Unsupported for entities with a non-null key");
  281 + }
  282 +
  283 + @Override
  284 + protected final boolean isEntityUpdateable() {
  285 + return true;
  286 + }
  287 +
  288 +}
... ...
core/database/src/main/java/com/cnlive/database/dbUtil/DaoHelper.java 0 → 100644
  1 +package com.cnlive.database.dbUtil;
  2 +
  3 +import android.content.Context;
  4 +
  5 +
  6 +import com.alibaba.android.arouter.launcher.ARouter;
  7 +import com.cnlive.core.libs.base.arouter.user.CNLiveUserService;
  8 +import com.cnlive.database.dao.AudioPlayHistoricalRecordDao;
  9 +import com.cnlive.database.dao.AudioPlayLastInfoDao;
  10 +import com.cnlive.database.dao.ChatFileMsgDao;
  11 +import com.cnlive.database.dao.ChatImageAndVideoMsgDao;
  12 +import com.cnlive.database.dao.ChatMediaDao;
  13 +import com.cnlive.database.dao.ContactListDao;
  14 +import com.cnlive.database.dao.ContanctDaRenEntityDao;
  15 +import com.cnlive.database.dao.ContanctGroupChatEntityDao;
  16 +import com.cnlive.database.dao.DBFriendCircleMessageDao;
  17 +import com.cnlive.database.dao.DBMomentDetailDao;
  18 +import com.cnlive.database.dao.DBMomentItemDao;
  19 +import com.cnlive.database.dao.DaoMaster;
  20 +import com.cnlive.database.dao.DaoSession;
  21 +import com.cnlive.database.dao.DarenDetailMsgDao;
  22 +import com.cnlive.database.dao.DarenListMsgDao;
  23 +import com.cnlive.database.dao.DownloadInfoDao;
  24 +import com.cnlive.database.dao.ExceptionInfoDao;
  25 +import com.cnlive.database.dao.HolidayThemeInfoDao;
  26 +import com.cnlive.database.dao.IMConversationInfoDao;
  27 +import com.cnlive.database.dao.IMGroupFaceMemberIdsDao;
  28 +import com.cnlive.database.dao.IMGroupMembersDao;
  29 +import com.cnlive.database.dao.IMGroupMembersListDao;
  30 +import com.cnlive.database.dao.IMGroupMembersManagerListDao;
  31 +import com.cnlive.database.dao.IMUserInfoDao;
  32 +import com.cnlive.database.dao.LaunchAdInfoDao;
  33 +import com.cnlive.database.dao.NewContactFriendEntityDao;
  34 +import com.cnlive.database.dao.NewPhoneContactEntityDao;
  35 +import com.cnlive.database.dao.NewsNumberDao;
  36 +import com.cnlive.database.dao.SearchContentDao;
  37 +import com.cnlive.database.dao.SearchHistoryDao;
  38 +import com.cnlive.database.dao.SysNumReadableDao;
  39 +import com.cnlive.database.dao.WitnessDao;
  40 +
  41 +import org.greenrobot.greendao.database.Database;
  42 +
  43 +
  44 +/**
  45 + * Created by xiansong on 2017/9/8.
  46 + */
  47 +
  48 +public class DaoHelper {
  49 + private static char[] databasePassword = "com.cnlive.strike_Passw0rd".toCharArray();
  50 + private static DaoHelper instance;
  51 + private Database db;
  52 + private DaoMaster daoMaster;
  53 + private DaoSession daoSession;
  54 +
  55 + public DaoHelper(Context context) {
  56 + CNLiveUserService service = (CNLiveUserService) ARouter.getInstance().navigation(CNLiveUserService.class);
  57 + String userId = service.getUid(context);
  58 + DaoMaster.OpenHelper helper = new MigrationHelper(context, (userId == null ? "" : userId) + "-strike-db", null);
  59 + db = helper.getEncryptedWritableDb(databasePassword);
  60 + daoMaster = new DaoMaster(db);
  61 + daoSession = daoMaster.newSession();
  62 + }
  63 +
  64 + public static synchronized DaoHelper getInstance(Context ctx) {
  65 + if (instance == null)
  66 + instance = new DaoHelper(ctx.getApplicationContext());
  67 + return instance;
  68 + }
  69 +
  70 + public static synchronized DaoHelper updateInstance(Context ctx) {
  71 + instance = new DaoHelper(ctx.getApplicationContext());
  72 + return instance;
  73 + }
  74 +
  75 + public ExceptionInfoDao getExceptionInfoDao() {
  76 + return daoSession.getExceptionInfoDao();
  77 + }
  78 +
  79 + public IMGroupMembersDao getIMGroupMembersDao() {
  80 + return daoSession.getIMGroupMembersDao();
  81 + }
  82 +
  83 + public IMGroupMembersListDao getIMGroupMembersListDao() {
  84 + return daoSession.getIMGroupMembersListDao();
  85 + }
  86 +
  87 + public IMUserInfoDao getIMUserInfoDao() {
  88 + return daoSession.getIMUserInfoDao();
  89 + }
  90 +
  91 + public IMConversationInfoDao getIMConversationInfoDao() {
  92 + return daoSession.getIMConversationInfoDao();
  93 + }
  94 +
  95 + public SysNumReadableDao getSysNumReadableDao() {
  96 + return daoSession.getSysNumReadableDao();
  97 + }
  98 +
  99 + public DBFriendCircleMessageDao getFriendCircleMessageDao() {
  100 + return daoSession.getDBFriendCircleMessageDao();
  101 + }
  102 +
  103 + public DBMomentDetailDao getDBMomentDetailDao() {
  104 + return daoSession.getDBMomentDetailDao();
  105 + }
  106 +
  107 + public DBMomentItemDao getDBMomentItemDao() {
  108 + return daoSession.getDBMomentItemDao();
  109 + }
  110 +
  111 + public ChatMediaDao getChatMediaDao() {
  112 + return daoSession.getChatMediaDao();
  113 + }
  114 +
  115 + public SearchHistoryDao getSearchHistoryDao() {
  116 + return daoSession.getSearchHistoryDao();
  117 + }
  118 +
  119 +
  120 + public ChatImageAndVideoMsgDao getChatImageAndVideoMsgDao() {
  121 + return daoSession.getChatImageAndVideoMsgDao();
  122 + }
  123 +
  124 + public WitnessDao getWitnessDao() {
  125 + return daoSession.getWitnessDao();
  126 + }
  127 + public SearchContentDao getSearchContentDao(){
  128 + return daoSession.getSearchContentDao();
  129 + }
  130 + public DarenDetailMsgDao getDarenDetailDao() {
  131 + return daoSession.getDarenDetailMsgDao();
  132 + }
  133 +
  134 + public DarenListMsgDao getDarenListDao() {
  135 + return daoSession.getDarenListMsgDao();
  136 + }
  137 +
  138 + public ChatFileMsgDao getChatFileMsgDao() {
  139 + return daoSession.getChatFileMsgDao();
  140 + }
  141 +
  142 + public AudioPlayHistoricalRecordDao getAudioHistoryRecordDao() {
  143 + return daoSession.getAudioPlayHistoricalRecordDao();
  144 + }
  145 +
  146 + public AudioPlayLastInfoDao getAudioPlayLastInfoDao() {
  147 + return daoSession.getAudioPlayLastInfoDao();
  148 + }
  149 +
  150 + public DownloadInfoDao getDownloadInfoDao() {
  151 + return daoSession.getDownloadInfoDao();
  152 + }
  153 +
  154 + public NewsNumberDao getNewsNumberDao() {
  155 + return daoSession.getNewsNumberDao();
  156 + }
  157 +
  158 + /**
  159 + * 新的朋友
  160 + *
  161 + * @return
  162 + */
  163 + public NewContactFriendEntityDao getNewContactFriendEntityDao() {
  164 + return daoSession.getNewContactFriendEntityDao();
  165 + }
  166 +
  167 + /**
  168 + * 新的朋友
  169 + *
  170 + * @return
  171 + */
  172 + public NewPhoneContactEntityDao getNewPhoneContactEntityDao() {
  173 + return daoSession.getNewPhoneContactEntityDao();
  174 + }
  175 +
  176 + public IMGroupFaceMemberIdsDao getGroupFaceMemberIdsDao() {
  177 + return daoSession.getIMGroupFaceMemberIdsDao();
  178 + }
  179 +
  180 + /**
  181 + * 联系人-群聊
  182 + *
  183 + * @return
  184 + */
  185 + public ContanctGroupChatEntityDao getContanctGroupChatEntityDao() {
  186 + return daoSession.getContanctGroupChatEntityDao();
  187 + }
  188 +
  189 + /**
  190 + * 联系人-达人列表
  191 + *
  192 + * @return
  193 + */
  194 + public ContanctDaRenEntityDao getContanctDaRenEntityDao() {
  195 + return daoSession.getContanctDaRenEntityDao();
  196 + }
  197 +
  198 + public IMGroupMembersManagerListDao getGroupMemberManagerIdsDao() {
  199 + return daoSession.getIMGroupMembersManagerListDao();
  200 + }
  201 +
  202 + public ContactListDao getContactListDao() {
  203 + return daoSession.getContactListDao();
  204 + }
  205 +
  206 + public LaunchAdInfoDao getLaunchAdInfo() {
  207 + return daoSession.getLaunchAdInfoDao();
  208 + }
  209 +
  210 + public HolidayThemeInfoDao getHolidayThemeInfoDao() {
  211 + return daoSession.getHolidayThemeInfoDao();
  212 + }
  213 +}
... ...
core/database/src/main/java/com/cnlive/database/dbUtil/MigrationHelper.java 0 → 100644
  1 +package com.cnlive.database.dbUtil;
  2 +
  3 +import android.content.Context;
  4 +import android.database.sqlite.SQLiteDatabase;
  5 +
  6 +import com.cnlive.database.dao.AudioPlayHistoricalRecordDao;
  7 +import com.cnlive.database.dao.AudioPlayLastInfoDao;
  8 +import com.cnlive.database.dao.ChatFileMsgDao;
  9 +import com.cnlive.database.dao.ChatImageAndVideoMsgDao;
  10 +import com.cnlive.database.dao.ChatMediaDao;
  11 +import com.cnlive.database.dao.ContactListDao;
  12 +import com.cnlive.database.dao.DBFriendCircleMessageDao;
  13 +import com.cnlive.database.dao.DBMomentDetailDao;
  14 +import com.cnlive.database.dao.DBMomentItemDao;
  15 +import com.cnlive.database.dao.DaoMaster;
  16 +import com.cnlive.database.dao.DarenDetailMsgDao;
  17 +import com.cnlive.database.dao.DarenListMsgDao;
  18 +import com.cnlive.database.dao.DownloadInfoDao;
  19 +import com.cnlive.database.dao.ExceptionInfoDao;
  20 +import com.cnlive.database.dao.HolidayThemeInfoDao;
  21 +import com.cnlive.database.dao.IMConversationInfoDao;
  22 +import com.cnlive.database.dao.IMGroupFaceMemberIdsDao;
  23 +import com.cnlive.database.dao.IMGroupMembersDao;
  24 +import com.cnlive.database.dao.IMGroupMembersListDao;
  25 +import com.cnlive.database.dao.IMGroupMembersManagerListDao;
  26 +import com.cnlive.database.dao.IMUserInfoDao;
  27 +import com.cnlive.database.dao.LaunchAdInfoDao;
  28 +import com.cnlive.database.dao.NewContactFriendEntityDao;
  29 +import com.cnlive.database.dao.NewPhoneContactEntityDao;
  30 +import com.cnlive.database.dao.NewsNumberDao;
  31 +import com.cnlive.database.dao.SearchContentDao;
  32 +import com.cnlive.database.dao.SearchHistoryDao;
  33 +import com.cnlive.database.dao.SysNumReadableDao;
  34 +import com.cnlive.database.dao.WitnessDao;
  35 +
  36 +import org.greenrobot.greendao.database.Database;
  37 +
  38 +/**
  39 + * created by hanyayun
  40 + * on 2019/12/12
  41 + */
  42 +public class MigrationHelper extends DaoMaster.OpenHelper {
  43 +
  44 + public MigrationHelper(Context context, String name) {
  45 + super(context, name);
  46 + }
  47 +
  48 + public MigrationHelper(Context context, String name, SQLiteDatabase.CursorFactory factory) {
  49 + super(context, name, factory);
  50 + }
  51 +
  52 + @Override
  53 + public void onUpgrade(Database db, int oldVersion, int newVersion) {
  54 + new UpgradeHelper().migrate(db, //UserDao.class
  55 + ExceptionInfoDao.class,
  56 + IMGroupMembersListDao.class,
  57 + IMGroupMembersDao.class,
  58 + IMUserInfoDao.class,
  59 + IMConversationInfoDao.class,
  60 + SysNumReadableDao.class,
  61 + DBFriendCircleMessageDao.class,
  62 + ChatMediaDao.class,
  63 + SearchHistoryDao.class,
  64 + ChatImageAndVideoMsgDao.class,
  65 + DBMomentDetailDao.class,
  66 + DBMomentItemDao.class,
  67 + DarenDetailMsgDao.class,
  68 + DarenListMsgDao.class,
  69 + ChatFileMsgDao.class,
  70 + WitnessDao.class,
  71 + AudioPlayHistoricalRecordDao.class,
  72 + DownloadInfoDao.class,
  73 + NewsNumberDao.class,
  74 + NewContactFriendEntityDao.class,
  75 + NewPhoneContactEntityDao.class,
  76 + AudioPlayLastInfoDao.class,
  77 + IMGroupFaceMemberIdsDao.class,
  78 + IMGroupMembersManagerListDao.class,
  79 + ContactListDao.class,
  80 + SearchContentDao.class,
  81 + IMGroupMembersManagerListDao.class,
  82 + LaunchAdInfoDao.class,
  83 + HolidayThemeInfoDao.class
  84 + );
  85 + }
  86 +}
... ...
core/database/src/main/java/com/cnlive/database/dbUtil/UpgradeHelper.java 0 → 100644
  1 +package com.cnlive.database.dbUtil;
  2 +
  3 +import android.database.Cursor;
  4 +import android.text.TextUtils;
  5 +
  6 +import com.cnlive.database.dao.DaoMaster;
  7 +
  8 +import org.greenrobot.greendao.AbstractDao;
  9 +import org.greenrobot.greendao.database.Database;
  10 +import org.greenrobot.greendao.internal.DaoConfig;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.Arrays;
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * created by hanyayun
  18 + * on 2019/12/12
  19 + */
  20 +public class UpgradeHelper {
  21 +
  22 + private static final String CONVERSION_CLASS_NOT_FOUND_EXCEPTION = "MIGRATION HELPER - CLASS DOESN'T MATCH WITH THE CURRENT PARAMETERS";
  23 +
  24 + public void migrate(final Database db, final Class<? extends AbstractDao<?, ?>>... daoClasses) {
  25 + generateTempTables(db, daoClasses);
  26 + DaoMaster.dropAllTables(db, true);
  27 + DaoMaster.createAllTables(db, false);
  28 + restoreData(db, daoClasses);
  29 + }
  30 +
  31 + private void generateTempTables(Database db, Class<? extends AbstractDao<?, ?>>... daoClasses) {
  32 + for (int i = 0; i < daoClasses.length; i++) {
  33 + try {
  34 + DaoConfig daoConfig = new DaoConfig(db, daoClasses[i]);
  35 + String divider = "";
  36 + String tableName = daoConfig.tablename;
  37 + String tempTableName = daoConfig.tablename.concat("_TEMP");
  38 + ArrayList<String> properties = new ArrayList<>();
  39 +
  40 + StringBuilder createTableStringBuilder = new StringBuilder();
  41 +
  42 + createTableStringBuilder.append("CREATE TABLE ").append(tempTableName).append(" (");
  43 +
  44 + for (int j = 0; j < daoConfig.properties.length; j++) {
  45 + String columnName = daoConfig.properties[j].columnName;
  46 +
  47 + if (getColumns(db, tableName).contains(columnName)) {
  48 + properties.add(columnName);
  49 +
  50 + String type = null;
  51 +
  52 + try {
  53 + type = getTypeByClass(daoConfig.properties[j].type);
  54 + } catch (Exception exception) {
  55 + exception.printStackTrace();
  56 + }
  57 +
  58 + createTableStringBuilder.append(divider).append(columnName).append(" ").append(type);
  59 +
  60 + if (daoConfig.properties[j].primaryKey) {
  61 + createTableStringBuilder.append(" PRIMARY KEY");
  62 + }
  63 +
  64 + divider = ",";
  65 + }
  66 + }
  67 + createTableStringBuilder.append(");");
  68 +
  69 + db.execSQL(createTableStringBuilder.toString());
  70 +
  71 + StringBuilder insertTableStringBuilder = new StringBuilder();
  72 +
  73 + insertTableStringBuilder.append("INSERT INTO ").append(tempTableName).append(" (");
  74 + insertTableStringBuilder.append(TextUtils.join(",", properties));
  75 + insertTableStringBuilder.append(") SELECT ");
  76 + insertTableStringBuilder.append(TextUtils.join(",", properties));
  77 + insertTableStringBuilder.append(" FROM ").append(tableName).append(";");
  78 +
  79 + db.execSQL(insertTableStringBuilder.toString());
  80 + } catch (Exception e) {
  81 + e.printStackTrace();
  82 + } finally {
  83 + continue;
  84 + }
  85 + }
  86 + }
  87 +
  88 + private void restoreData(Database db, Class<? extends AbstractDao<?, ?>>... daoClasses) {
  89 + for (int i = 0; i < daoClasses.length; i++) {
  90 + try {
  91 + DaoConfig daoConfig = new DaoConfig(db, daoClasses[i]);
  92 + String tableName = daoConfig.tablename;
  93 + String tempTableName = daoConfig.tablename.concat("_TEMP");
  94 + ArrayList<String> properties = new ArrayList();
  95 +
  96 + for (int j = 0; j < daoConfig.properties.length; j++) {
  97 + String columnName = daoConfig.properties[j].columnName;
  98 +
  99 + if (getColumns(db, tempTableName).contains(columnName)) {
  100 + properties.add(columnName);
  101 + }
  102 + }
  103 +
  104 + StringBuilder insertTableStringBuilder = new StringBuilder();
  105 +
  106 + insertTableStringBuilder.append("INSERT INTO ").append(tableName).append(" (");
  107 + insertTableStringBuilder.append(TextUtils.join(",", properties));
  108 + insertTableStringBuilder.append(") SELECT ");
  109 + insertTableStringBuilder.append(TextUtils.join(",", properties));
  110 + insertTableStringBuilder.append(" FROM ").append(tempTableName).append(";");
  111 +
  112 + StringBuilder dropTableStringBuilder = new StringBuilder();
  113 +
  114 + dropTableStringBuilder.append("DROP TABLE ").append(tempTableName);
  115 +
  116 + db.execSQL(insertTableStringBuilder.toString());
  117 + db.execSQL(dropTableStringBuilder.toString());
  118 + } catch (Exception e) {
  119 + e.printStackTrace();
  120 + } finally {
  121 + continue;
  122 + }
  123 + }
  124 + }
  125 +
  126 + private String getTypeByClass(Class<?> type) throws Exception {
  127 + if (type.equals(String.class)) {
  128 + return " TEXT";
  129 + }
  130 + if (type.equals(Integer.class) || type.equals(int.class) ||
  131 + type.equals(byte.class) || type.equals(Byte.class) ||
  132 + type.equals(short.class) || type.equals(Short.class)) {
  133 + return " INTEGER DEFAULT 0";
  134 + }
  135 +
  136 + if (type.equals(Double.class) || type.equals(double.class)) {
  137 + return "DOUBLE DEFAULT 0";
  138 + }
  139 +
  140 + if(type.equals(float.class) || type.equals(Float.class)){
  141 + return "FLOAT DEFAULT 0";
  142 + }
  143 +
  144 + if (type.equals(Long.class) || type.equals(long.class)) {
  145 + return " Long DEFAULT 0";
  146 + }
  147 + if (type.equals(Boolean.class) || type.equals(boolean.class)) {
  148 + return " NUMERIC DEFAULT 0";
  149 + }
  150 +
  151 + Exception exception = new Exception(CONVERSION_CLASS_NOT_FOUND_EXCEPTION.concat(" - Class: ").concat(type.toString()));
  152 + exception.printStackTrace();
  153 + throw exception;
  154 + }
  155 +
  156 + private static List<String> getColumns(Database db, String tableName) {
  157 +
  158 + List<String> columns = new ArrayList<>();
  159 + Cursor cursor = null;
  160 + try {
  161 + cursor = db.rawQuery("SELECT * FROM " + tableName + " limit 1", null);
  162 + if (cursor != null) {
  163 + columns = new ArrayList<>(Arrays.asList(cursor.getColumnNames()));
  164 + }
  165 + } catch (Exception e) {
  166 + e.printStackTrace();
  167 + } finally {
  168 + if (cursor != null)
  169 + cursor.close();
  170 + }
  171 + return columns;
  172 + }
  173 +}
... ...
core/database/src/main/res/values/strings.xml 0 → 100644
  1 +<resources>
  2 + <string name="app_name">database</string>
  3 +</resources>
... ...
core/database/src/test/java/com/cnlive/database/ExampleUnitTest.java 0 → 100644
  1 +package com.cnlive.database;
  2 +
  3 +import org.junit.Test;
  4 +
  5 +import static org.junit.Assert.*;
  6 +
  7 +/**
  8 + * Example local unit test, which will execute on the development machine (host).
  9 + *
  10 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  11 + */
  12 +public class ExampleUnitTest {
  13 + @Test
  14 + public void addition_isCorrect() {
  15 + assertEquals(4, 2 + 2);
  16 + }
  17 +}
0 18 \ No newline at end of file
... ...
settings.gradle
1 1 include ':app:strike'
2 2 //基础库
3   -include ':core:base',':core:network',':core:imageload' ,':core:app_qr'
  3 +include ':core:base',':core:network',':core:imageload' ,':core:app_qr',':core:database'
4 4 include ':cloud:user',':cloud:pay',':cloud:third_tool',':cloud:video'
5 5 include ':module:xiaojiasoundbox',':module:pedometer',':module:shanghaishop'
6 6 include ':library_baidumap'
... ...