package db
|
|
import (
|
"time"
|
|
"gorm.io/gorm"
|
)
|
|
type BaseEntity struct {
|
ID string `gorm:"primary_key;column:id;type:varchar(255);" json:"id"`
|
CreatedAt time.Time
|
UpdatedAt time.Time
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
}
|
|
type DbPersons struct {
|
BaseEntity
|
TableId string `gorm:"column:table_id"`
|
FaceFeature string `gorm:"column:face_feature"`
|
PersonPicUrl string `gorm:"column:person_pic_url"`
|
PersonName string `gorm:"column:person_name"`
|
Age string `gorm:"column:age"`
|
Sex string `gorm:"column:sex"`
|
IdCard string `gorm:"column:id_card"`
|
PhoneNum string `gorm:"column:phone_num"`
|
MonitorLevel string `gorm:"column:monitor_level"`
|
PicDesc string `gorm:"column:pic_desc"`
|
Reserved string `gorm:"column:reserved"`
|
FromServerId string `gorm:"column:from_server_id"`
|
LastAppearanceTime int64 `gorm:"column:last_appearance_time"`
|
SnapshotCount int `gorm:"column:snapshot_count"`
|
DaysAppeared int `gorm:"column:days_appeared"`
|
Location string `gorm:"column:location"`
|
LastLocation string `gorm:"column:last_location"`
|
FaceAngleYaw int32 `gorm:"column:face_angle_yaw"`
|
FaceAngleRoll int32 `gorm:"column:face_angle_roll"`
|
FaceAnglePitch int32 `gorm:"column:face_angle_pitch"`
|
CommunityID string `gorm:"column:community_id"` // 常住小区 domain unit ID
|
CommunityName string `gorm:"column:community_name"`
|
OrgID string `gorm:"column:org_id"` // 常住派出所 domain unit ID
|
OrgName string `gorm:"column:community"`
|
FrontFaceScore float64 `gorm:"column:front_face_score"`
|
ImageQuality float64 `gorm:"column:image_quality"`
|
SimilarPersonId string `gorm:"column:similar_person_id"`
|
PersonalStatus string `gorm:"column:personal_status"`
|
NonHuman bool `gorm:"column:non_human"` // 非活体(1非多体 0活体)
|
IdPicUrl string `gorm:"column:id_pic_url"`
|
IsDelete int `gorm:"column:is_delete"` // 0 未删除 1已删除
|
FaceUpdateTime int64 `gorm:"column:face_update_time"`
|
}
|
|
func (dp *DbPersons) TableName() string {
|
return "person"
|
}
|