You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
package entity
import ( "gitea.baoapi.com/root/stu_uuos/util" "github.com/jinzhu/gorm" "time" )
// FmOrg 机构-管理设备
type FmOrg struct { Id string `json:"id" gorm:"column:id;type:uuid;primaryKey"` //组织id
Name string `json:"name" gorm:"column:name;type:varchar(200);not null"` //名称
Alias string `json:"alias" gorm:"column:alias;type:varchar(200)"` //机构简称
Contacts string `json:"contacts" gorm:"column:contacts;type:varchar(100)"` //设备负责联系人
Mobile string `json:"mobile" gorm:"column:mobile;type:varchar(100)"` //手机号
Summary string `json:"summary" gorm:"column:summary;type:varchar(200)"` //简介
Type int `json:"type" gorm:"column:type;type:int;default:1"` //类型 1:商户 3 门诊 4 调剂中心
Pid string `json:"pid" gorm:"column:pid;type:uuid"` //上级id 一级 0
Level int `json:"level" gorm:"column:level;type:int"` //(商户 1、2、3 、4;其他类型填0或空)
Province string `json:"province" gorm:"column:province;type:varchar(255)"` //省
City string `json:"city" gorm:"column:city;type:varchar(255)"` //市
District string `json:"district" gorm:"column:district;type:varchar(255)"` //区/县
Addr string `json:"addr" gorm:"column:addr;type:varchar(255)"` //详细地址
OrgRootId string `json:"org_root_id" gorm:"column:org_root_id;type:uuid"` //根id
CreatedAt time.Time `json:"created_at" form:"created_at"` UpdatedAt time.Time `json:"updated_at" form:"updated_at"` DeletedAt *time.Time `json:"deleted_at" form:"deleted_at" sql:"index"` }
type FmOrgReq struct { Id string `json:"id"` //组织id
Name string `json:"name" binding:"required"` //名称
Alias string `json:"alias"` //机构简称
Contacts string `json:"contacts"` //设备负责联系人
Mobile string `json:"mobile"` //手机号
Summary string `json:"summary" ` //简介
Type int `json:"type" binding:"required"` //类型 1:商户 3 门诊 4 调剂中心
Pid string `json:"pid" binding:"required"` //上级id 一级 0
Level int `json:"level"` //(商户 1、2、3 、4;其他类型填0或空)
Province string `json:"province"` //省
City string `json:"city"` //市
District string `json:"district"` //区/县
Addr string `json:"addr"` //详细地址
OrgRootId string `json:"org_root_id"` //根id
CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` }
func (deo *FmOrg) BeforeCreate(scope *gorm.Scope) error { deo.Id = util.GUUID.NewV1().String() if deo.Pid == util.EmptyUUID { deo.OrgRootId = deo.Id } return nil }
|