ソースを参照

删除重复的UserInfoEntity并更新数据库版本

zengjiebin 8 年 前
コミット
e5877bce58

+ 7 - 0
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -24,6 +24,7 @@ import android.widget.TextView;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.bumptech.glide.request.RequestOptions;
 import com.kfzs.duanduan.BaseCompatFragment;
 import com.kfzs.duanduan.event.BigEvent;
@@ -39,6 +40,7 @@ import com.sheep.gamegroup.model.entity.MoreDataEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.SmallSheepContract;
 import com.sheep.gamegroup.presenter.SmallSheepPresenter;
+import com.sheep.gamegroup.util.AppUtil;
 import com.sheep.gamegroup.util.ImageGlarryDrawable;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MyDbManager;
@@ -250,6 +252,11 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
             e.printStackTrace();
         }
         mHanderl.sendEmptyMessage(0);
+        //PersionInfoAct.java与AskGetMoneyAct.java中分享二维码时的图片预下载
+        Glide.with(this)
+                .load(AppUtil.getQRLink(userEntity.getShare_link(), 800))
+                .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
+                .preload(800, 800);
 
     }
 

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -3,11 +3,13 @@ package com.sheep.gamegroup.model.entity;
 import org.xutils.db.annotation.Column;
 import org.xutils.db.annotation.Table;
 
+import java.io.Serializable;
+
 /**
  * Created by ljy on 2018/3/17.
  */
 @Table(name = "user")
-public class UserEntity {
+public class UserEntity implements Serializable {
 
     @Column(name = "id", isId = true, autoGen = true)
     private int _id;//11,

+ 0 - 206
app/src/main/java/com/sheep/gamegroup/model/entity/UserInfoEntity.java

@@ -1,206 +0,0 @@
-/**
- * Copyright 2018 bejson.com
- */
-package com.sheep.gamegroup.model.entity;
-
-
-import java.io.Serializable;
-
-/**
- * Auto-generated: 2018-03-26 11:24:11
- *
- * @author bejson.com (i@bejson.com)
- * @website http://www.bejson.com/java2pojo/
- */
-public class UserInfoEntity  implements Serializable {
-
-    private int id;
-    private String mobile;
-    private String nickname;
-    private double balance;
-    private String invitation_code;
-    private String parent_code;
-    private double total_asset;
-    private long last_login_time;
-    private long create_time;
-    private long update_time;
-    private String avatar;
-    private String access_token;
-    private String refresh_token;
-    private String open_id;
-    private String real_name;
-    private String id_number;
-    private String bank_card;
-    private int total_withdraw;
-    private String wx_openid;
-    private String wx_nickname;
-    private String share_link;
-
-    public int getId() {
-        return id;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    public String getNickname() {
-        return nickname;
-    }
-
-    public void setNickname(String nickname) {
-        this.nickname = nickname;
-    }
-
-    public double getBalance() {
-        return balance;
-    }
-
-    public void setBalance(double balance) {
-        this.balance = balance;
-    }
-
-    public String getInvitation_code() {
-        return invitation_code;
-    }
-
-    public void setInvitation_code(String invitation_code) {
-        this.invitation_code = invitation_code;
-    }
-
-    public String getParent_code() {
-        return parent_code;
-    }
-
-    public void setParent_code(String parent_code) {
-        this.parent_code = parent_code;
-    }
-
-    public double getTotal_asset() {
-        return total_asset;
-    }
-
-    public void setTotal_asset(double total_asset) {
-        this.total_asset = total_asset;
-    }
-
-    public long getLast_login_time() {
-        return last_login_time;
-    }
-
-    public void setLast_login_time(long last_login_time) {
-        this.last_login_time = last_login_time;
-    }
-
-    public long getCreate_time() {
-        return create_time;
-    }
-
-    public void setCreate_time(long create_time) {
-        this.create_time = create_time;
-    }
-
-    public long getUpdate_time() {
-        return update_time;
-    }
-
-    public void setUpdate_time(long update_time) {
-        this.update_time = update_time;
-    }
-
-    public String getAvatar() {
-        return avatar;
-    }
-
-    public void setAvatar(String avatar) {
-        this.avatar = avatar;
-    }
-
-    public String getAccess_token() {
-        return access_token;
-    }
-
-    public void setAccess_token(String access_token) {
-        this.access_token = access_token;
-    }
-
-    public String getRefresh_token() {
-        return refresh_token;
-    }
-
-    public void setRefresh_token(String refresh_token) {
-        this.refresh_token = refresh_token;
-    }
-
-    public String getOpen_id() {
-        return open_id;
-    }
-
-    public void setOpen_id(String open_id) {
-        this.open_id = open_id;
-    }
-
-    public String getReal_name() {
-        return real_name;
-    }
-
-    public void setReal_name(String real_name) {
-        this.real_name = real_name;
-    }
-
-    public String getId_number() {
-        return id_number;
-    }
-
-    public void setId_number(String id_number) {
-        this.id_number = id_number;
-    }
-
-    public String getBank_card() {
-        return bank_card;
-    }
-
-    public void setBank_card(String bank_card) {
-        this.bank_card = bank_card;
-    }
-
-    public int getTotal_withdraw() {
-        return total_withdraw;
-    }
-
-    public void setTotal_withdraw(int total_withdraw) {
-        this.total_withdraw = total_withdraw;
-    }
-
-    public String getWx_openid() {
-        return wx_openid;
-    }
-
-    public void setWx_openid(String wx_openid) {
-        this.wx_openid = wx_openid;
-    }
-
-    public String getWx_nickname() {
-        return wx_nickname;
-    }
-
-    public void setWx_nickname(String wx_nickname) {
-        this.wx_nickname = wx_nickname;
-    }
-
-    public String getShare_link() {
-        return share_link;
-    }
-
-    public void setShare_link(String share_link) {
-        this.share_link = share_link;
-    }
-}

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritContract.java

@@ -2,7 +2,7 @@ package com.sheep.gamegroup.presenter;
 
 import com.sheep.gamegroup.IBase.IBasePresenter;
 import com.sheep.gamegroup.IBase.IBaseView;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 
 /**
  * Created by Administrator on 2018/3/10.
@@ -15,7 +15,7 @@ public interface AccountAndSecuritContract {
     }
 
     interface View extends IBaseView {
-       void   showTask(UserInfoEntity entity);
+       void   showTask(UserEntity entity);
 
 
     }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/presenter/AccountAndSecuritPresenter.java

@@ -3,7 +3,7 @@ package com.sheep.gamegroup.presenter;
 import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -48,7 +48,7 @@ public class AccountAndSecuritPresenter implements  AccountAndSecuritContract.Pr
                         if(baseMessage!=null){
 
 
-                        UserInfoEntity loginEty = FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),UserInfoEntity.class);
+                        UserEntity loginEty = FastJsonUtils.toBean( JSONObject.toJSONString(baseMessage.getData()),UserEntity.class);
                         view.showTask(loginEty);
 
                         }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/presenter/RealNameAutherPresenter.java

@@ -7,7 +7,7 @@ import com.sheep.gamegroup.exception.ExceptionEngine;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.LoginEntity;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.gamegroup.util.MyDbManager;

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/presenter/SmallSheepPresenter.java

@@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.MoreDataEntity;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.jiuyan.samllsheep.SheepApp;

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -9,7 +9,7 @@ import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.bean.KFIntentKeys;
 import com.sheep.gamegroup.model.entity.TaskEty;
 import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.entity.WXOnHookAccount;
 import com.sheep.gamegroup.view.activity.AccountAndSecurityAct;
 import com.sheep.gamegroup.view.activity.ActGuideDeblocked;
@@ -354,7 +354,7 @@ public class Jump2View {
      * @param context
      * @param o
      */
-    public void goPersionInfo(Context context, UserInfoEntity o){
+    public void goPersionInfo(Context context, UserEntity o){
         Intent i = new Intent(context, PersionInfoAct.class);
         i.putExtra("info", o);
         context.startActivity(i);
@@ -366,7 +366,7 @@ public class Jump2View {
      * @param context
      * @param o
      */
-    public void goRealNameAuther(Context context, UserInfoEntity o){
+    public void goRealNameAuther(Context context, UserEntity o){
         Intent i = new Intent(context, RealNameAuthenAct.class);
         i.putExtra("info", o);
         context.startActivity(i);

+ 7 - 7
app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java

@@ -20,7 +20,7 @@ import com.sheep.gamegroup.event.MoneyChange;
 import com.sheep.gamegroup.event.RealNameAutehrChange;
 import com.sheep.gamegroup.event.UserNameChange;
 import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.AccountAndSecuritContract;
 import com.sheep.gamegroup.presenter.AccountAndSecuritPresenter;
 import com.sheep.gamegroup.util.ActivityManager;
@@ -79,7 +79,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
 
     @Inject
     AccountAndSecuritPresenter presenter;
-    UserInfoEntity mEntity;
+    UserEntity mEntity;
     @BindView(R.id.tv_submit)
     TextView tvSubmit;
 
@@ -118,7 +118,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
 
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void onMessageEvent(UserNameChange done) {
-        UserInfoEntity user=mEntity;
+        UserEntity user=mEntity;
         user.setNickname(done.getNikeName());
         mEntity=user;
         tvName.setText(mEntity.getNickname());
@@ -133,7 +133,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
 
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void onMessageEvent(ImageHeadChange done) {
-        UserInfoEntity user=mEntity;
+        UserEntity user=mEntity;
         user.setAvatar(done.getAvatar());
         mEntity=user;
         Glide.with(AccountAndSecurityAct.this)
@@ -147,7 +147,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void onMessageEvent(RealNameAutehrChange done) {
 
-        UserInfoEntity entiy=mEntity;
+        UserEntity entiy=mEntity;
         entiy.setReal_name(done.getRealName());
         entiy.setId_number(done.getIdCard());
         entiy.setBank_card(done.getBanck());
@@ -247,7 +247,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
 
 
     @Override
-    public void showTask(final UserInfoEntity entity) {
+    public void showTask(final UserEntity entity) {
         UserEntity userEntity = null;
         try{
             userEntity = MyDbManager.getInstance()
@@ -309,7 +309,7 @@ public class AccountAndSecurityAct extends BaseActivity implements AccountAndSec
         }
     }
 
-    private  void  refalshAuther(UserInfoEntity entity ){
+    private  void  refalshAuther(UserEntity entity ){
         boolean isBanck = TextUtils.isEmpty(entity.getBank_card());
         boolean isId_number = TextUtils.isEmpty(entity.getId_number());
         boolean isRoalName = TextUtils.isEmpty(entity.getReal_name());

+ 0 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -184,10 +184,6 @@ public class AskGetMoneyAct extends BaseUMActivity implements UMShareListener, A
                 tvMoney.setText(mEntity.getAward());
             }
         });
-        Glide.with(this)
-                .load(AppUtil.getQRLink(mEntity.getShare_link(), 800))
-                .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
-                .preload(800, 800);
 
     }
 

+ 4 - 8
app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java

@@ -19,7 +19,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.bumptech.glide.request.RequestOptions;
 import com.sheep.gamegroup.event.ImageHeadChange;
 import com.sheep.gamegroup.event.UserNameChange;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.util.AppUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.jiuyan.samllsheep.R;
@@ -42,7 +42,7 @@ import butterknife.OnClick;
 
 public class PersionInfoAct extends AbsChooseImageActivity {
 
-    UserInfoEntity mEntity;
+    UserEntity mEntity;
     @BindView(R.id.tv_name)
     TextView tvName;
     @BindView(R.id.tv_nike)
@@ -87,7 +87,7 @@ public class PersionInfoAct extends AbsChooseImageActivity {
     public void initData() {
         Intent i = getIntent();
         if (i != null && i.hasExtra("info")) {
-            mEntity = (UserInfoEntity) i.getSerializableExtra("info");
+            mEntity = (UserEntity) i.getSerializableExtra("info");
             if (mEntity != null) {
                 tvNike.setText(mEntity.getNickname());
                 tvSheepId.setText(mEntity.getInvitation_code());
@@ -99,10 +99,6 @@ public class PersionInfoAct extends AbsChooseImageActivity {
                         .load("http://cdngame.kuaifazs.com/icon.png")
                         .apply(new RequestOptions().override(23))
                         .into(tv_qr_small);
-                Glide.with(this)
-                        .load(AppUtil.getQRLink(mEntity.getShare_link(), 800))
-                        .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE))
-                        .preload(800, 800);
 
                 Glide.with(PersionInfoAct.this)
                         .load(mEntity.getAvatar())
@@ -118,7 +114,7 @@ public class PersionInfoAct extends AbsChooseImageActivity {
 
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void onMessageEvent(UserNameChange done) {
-        UserInfoEntity user = mEntity;
+        UserEntity user = mEntity;
         user.setNickname(done.getNikeName());
         mEntity = user;
         tvNike.setText(mEntity.getNickname());

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java

@@ -18,7 +18,7 @@ import com.sheep.gamegroup.di.modules.PersonalCenterModule;
 import com.sheep.gamegroup.event.UserNameChange;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.UserEntity;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.PersonalCenterContract;
 import com.sheep.gamegroup.presenter.PersonalCenterPresenter;
 import com.sheep.gamegroup.util.Jump2View;

+ 3 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/RealNameAuthenAct.java

@@ -14,7 +14,7 @@ import com.sheep.gamegroup.di.components.DaggerRealNameAutherComponent;
 import com.sheep.gamegroup.di.modules.AccountAndSercuritModule;
 import com.sheep.gamegroup.di.modules.RealNameAutherModule;
 import com.sheep.gamegroup.event.RealNameAutehrChange;
-import com.sheep.gamegroup.model.entity.UserInfoEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.presenter.RealNameAutherContract;
 import com.sheep.gamegroup.presenter.RealNameAutherPresenter;
 import com.sheep.gamegroup.util.StringUtils;
@@ -49,7 +49,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
     @BindView(R.id.et_name)
     EditText etName;
 
-    UserInfoEntity mEntity;
+    UserEntity mEntity;
     @Inject
     RealNameAutherPresenter  presenter;
 
@@ -81,7 +81,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
 
         Intent i = getIntent();
         if (i != null && i.hasExtra("info")) {
-            mEntity = (UserInfoEntity) i.getSerializableExtra("info");
+            mEntity = (UserEntity) i.getSerializableExtra("info");
             if(mEntity!=null) {
 
                 if(!android.text.TextUtils.isEmpty(mEntity.getReal_name())){

+ 2 - 2
datashare/src/main/java/com/kfzs/duanduan/data/graph/provider/channel/DaoMaster.java

@@ -18,10 +18,10 @@ import com.kfzs.duanduan.datashare.provider.download.DownLoadInfoDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
- * Master of DAO (schema version 4): knows all DAOs.
+ * Master of DAO (schema version 5): knows all DAOs.
  */
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 4;
+    public static final int SCHEMA_VERSION = 5;
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {