package db
|
|
type DomainUnit struct {
|
BaseModel
|
Name string `gorm:"column:name;" json:"name"` //(字符串) 资源名称
|
DomainType DomainType `gorm:"column:domain_type;type:tinyint" json:"domainType"` //(数字) 1-小区资源 2-派出所 3- 其他资源
|
ParentID string `gorm:"column:parent_id;type:varchar(255);not null;default:''" json:"parentId"` //(字符串) 父节点id
|
ParentName string `gorm:"-" json:"parentName"` //(字符串) 父节点name
|
BusinessGroupID string `gorm:"column:business_group_id;type:varchar(255);" json:"businessGroupId"` //(字符串) 组织id
|
Level int `gorm:"column:level;type:tinyint(1);not null;default:0" json:"level"` //等级
|
Remark string `gorm:"column:remark;type:varchar(255);not null;default:''" json:"remark"` //备注
|
Children []*DomainUnit `gorm:"-" json:"children"` //(列表) 下级资源
|
Linkman string `gorm:"column:linkman;type:varchar(255);not null;default:''" json:"linkman"` //联系人
|
Phone string `gorm:"column:phone;type:varchar(255);not null;default:''" json:"linkPhone"` //联系电话
|
Address string `gorm:"column:address;type:varchar(255);not null;default:''" json:"address"` //机构地址
|
MapShape string `gorm:"type:text;" json:"mapShape"` //地图形状数据,以字符串形式存储多边形坐标
|
MapCenter string `gorm:"type:varchar(255);" json:"mapCenter"` //地图中心点坐标
|
MapLevel int `gorm:"type:tinyint(3);" json:"mapLevel"` //地图级别或缩放级别
|
PicUrl string `json:"picUrl" gorm:"column:pic_url;type:varchar(255);comment:区域照片"` // 区域照片
|
}
|
|
func (DomainUnit) TableName() string {
|
return "domain_unit"
|
}
|
|
type DomainType int
|
|
const (
|
DomainTypeArea DomainType = 1 //小区
|
DomainTypeOrg DomainType = 2 //派出所
|
DomainTypeOther DomainType = 3 //其他
|
|
)
|