This commit is contained in:
2025-12-26 14:16:01 +08:00
parent 7a6c4012d1
commit c046441d4e
2 changed files with 44 additions and 8 deletions
@@ -2,9 +2,11 @@ package com.sw.plate.utils.arcface.facedb.entity;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import java.util.Arrays;
@@ -42,6 +44,14 @@ public class FaceEntity implements Parcelable {
*/
@ColumnInfo(name = "register_time")
private long registerTime;
/**
* 用户类型:1-普通会员、2-临时用户、3-内部员工、或者其它待定类型
*/
@ColumnInfo(name = "user_type")
private String userType;
@Ignore
private int trackId;//人脸追踪ID
public FaceEntity(String userName, String imagePath, byte[] featureData) {
this.userName = userName;
@@ -119,6 +129,22 @@ public class FaceEntity implements Parcelable {
this.registerTime = registerTime;
}
public int getTrackId() {
return trackId;
}
public void setTrackId(int trackId) {
this.trackId = trackId;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
@Override
public int describeContents() {
return 0;
@@ -131,8 +157,11 @@ public class FaceEntity implements Parcelable {
dest.writeString(userName);
dest.writeString(imagePath);
dest.writeByteArray(featureData);
dest.writeString(userType);
}
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -142,16 +171,17 @@ public class FaceEntity implements Parcelable {
return false;
}
FaceEntity that = (FaceEntity) o;
return faceId == that.faceId &&
registerTime == that.registerTime &&
userName.equals(that.userName) &&
imagePath.equals(that.imagePath) &&
Arrays.equals(featureData, that.featureData);
return this.faceId == that.faceId &&
this.registerTime == that.registerTime &&
TextUtils.equals(this.userName, that.userName) &&
TextUtils.equals(this.imagePath, that.imagePath) &&
Arrays.equals(featureData, that.featureData) &&
TextUtils.equals(this.userType, that.userType);
}
@Override
public int hashCode() {
int result = Objects.hash(faceId, registerTime, userName, imagePath);
int result = Objects.hash(faceId, registerTime, userName, imagePath, userType);
result = 31 * result + Arrays.hashCode(featureData);
return result;
}