|
@@ -10,29 +10,15 @@ import com.ysnows.base.utils.MMKVManager;
|
|
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
-public class User implements IUser, Parcelable , IModel {
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * uid : 185
|
|
|
- * name : 微信
|
|
|
- * mobile : 18353965350
|
|
|
- * avatar :
|
|
|
- * money : 0.00
|
|
|
- * type : 1
|
|
|
- * status : 1
|
|
|
- * openid : 011reE00052RfK1ZQ3100fcB1Q2reE0G
|
|
|
- * union_id : null
|
|
|
- * create_time : 2020-09-10 19:52:56
|
|
|
- * update_time : 1970-01-01 08:00:00
|
|
|
- * delete_time : null
|
|
|
- */
|
|
|
+public class User implements IUser, Parcelable, IModel {
|
|
|
+
|
|
|
+
|
|
|
public String uid;
|
|
|
public String name;
|
|
|
public String mobile;
|
|
|
public String avatar;
|
|
|
public String money;
|
|
|
- public String type;//1是司机 2是货主
|
|
|
+ public int type;//1是司机 2是货主
|
|
|
public String status;
|
|
|
public String openid;
|
|
|
public String union_id;
|
|
@@ -40,55 +26,15 @@ public class User implements IUser, Parcelable , IModel {
|
|
|
public String update_time;
|
|
|
public String delete_time;
|
|
|
|
|
|
-
|
|
|
- protected User(Parcel in) {
|
|
|
- uid = in.readString();
|
|
|
- name = in.readString();
|
|
|
- mobile = in.readString();
|
|
|
- avatar = in.readString();
|
|
|
- money = in.readString();
|
|
|
- type = in.readString();
|
|
|
- status = in.readString();
|
|
|
- openid = in.readString();
|
|
|
- union_id = in.readString();
|
|
|
- create_time = in.readString();
|
|
|
- update_time = in.readString();
|
|
|
- delete_time = in.readString();
|
|
|
+ public Boolean isDriver() {
|
|
|
+ return type == 1;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void writeToParcel(Parcel dest, int flags) {
|
|
|
- dest.writeString(uid);
|
|
|
- dest.writeString(name);
|
|
|
- dest.writeString(mobile);
|
|
|
- dest.writeString(avatar);
|
|
|
- dest.writeString(money);
|
|
|
- dest.writeString(type);
|
|
|
- dest.writeString(status);
|
|
|
- dest.writeString(openid);
|
|
|
- dest.writeString(union_id);
|
|
|
- dest.writeString(create_time);
|
|
|
- dest.writeString(update_time);
|
|
|
- dest.writeString(delete_time);
|
|
|
- }
|
|
|
|
|
|
- @Override
|
|
|
- public int describeContents() {
|
|
|
- return 0;
|
|
|
+ public Boolean isShipper() {
|
|
|
+ return type == 2;
|
|
|
}
|
|
|
|
|
|
- public static final Creator<User> CREATOR = new Creator<User>() {
|
|
|
- @Override
|
|
|
- public User createFromParcel(Parcel in) {
|
|
|
- return new User(in);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public User[] newArray(int size) {
|
|
|
- return new User[size];
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
@Nullable
|
|
|
@Override
|
|
|
public String avatar() {
|
|
@@ -114,7 +60,51 @@ public class User implements IUser, Parcelable , IModel {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public int describeContents() {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void writeToParcel(Parcel dest, int flags) {
|
|
|
+ dest.writeString(this.uid);
|
|
|
+ dest.writeString(this.name);
|
|
|
+ dest.writeString(this.mobile);
|
|
|
+ dest.writeString(this.avatar);
|
|
|
+ dest.writeString(this.money);
|
|
|
+ dest.writeInt(this.type);
|
|
|
+ dest.writeString(this.status);
|
|
|
+ dest.writeString(this.openid);
|
|
|
+ dest.writeString(this.union_id);
|
|
|
+ dest.writeString(this.create_time);
|
|
|
+ dest.writeString(this.update_time);
|
|
|
+ dest.writeString(this.delete_time);
|
|
|
+ }
|
|
|
|
|
|
+ protected User(Parcel in) {
|
|
|
+ this.uid = in.readString();
|
|
|
+ this.name = in.readString();
|
|
|
+ this.mobile = in.readString();
|
|
|
+ this.avatar = in.readString();
|
|
|
+ this.money = in.readString();
|
|
|
+ this.type = in.readInt();
|
|
|
+ this.status = in.readString();
|
|
|
+ this.openid = in.readString();
|
|
|
+ this.union_id = in.readString();
|
|
|
+ this.create_time = in.readString();
|
|
|
+ this.update_time = in.readString();
|
|
|
+ this.delete_time = in.readString();
|
|
|
+ }
|
|
|
|
|
|
+ public static final Creator<User> CREATOR = new Creator<User>() {
|
|
|
+ @Override
|
|
|
+ public User createFromParcel(Parcel source) {
|
|
|
+ return new User(source);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public User[] newArray(int size) {
|
|
|
+ return new User[size];
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|