23 lines
1.8 KiB
Go
23 lines
1.8 KiB
Go
|
|
package models
|
|||
|
|
|
|||
|
|
import "git.apinb.com/bsm-sdk/core/database"
|
|||
|
|
|
|||
|
|
// ProducerAccount 对应 producer_account,保存可登录的生产商企业主数据。
|
|||
|
|
type ProducerAccount struct {
|
|||
|
|
Entity // 公共实体字段
|
|||
|
|
ProducerCode string `gorm:"column:producer_code;type:varchar(64);not null;uniqueIndex" json:"producer_code"` // 生产商编码
|
|||
|
|
Name string `gorm:"column:name;type:varchar(128);not null" json:"name"` // 生产商名称
|
|||
|
|
CreditCode string `gorm:"column:credit_code;type:varchar(64);not null;default:'';index" json:"credit_code"` // 统一社会信用代码
|
|||
|
|
Principal string `gorm:"column:principal;type:varchar(64);not null;default:''" json:"principal"` // 企业负责人
|
|||
|
|
Phone string `gorm:"column:phone;type:varchar(32);not null;default:''" json:"phone"` // 联系电话
|
|||
|
|
Address string `gorm:"column:address;type:varchar(255);not null;default:''" json:"address"` // 企业地址
|
|||
|
|
Username string `gorm:"column:username;type:varchar(64);not null;uniqueIndex" json:"username"` // 登录用户名
|
|||
|
|
DisplayName string `gorm:"column:display_name;type:varchar(64);not null;default:''" json:"display_name"` // 登录展示名称
|
|||
|
|
PasswordHash string `gorm:"column:password_hash;type:varchar(255);not null" json:"-"` // 登录密码哈希
|
|||
|
|
RoleCode string `gorm:"column:role_code;type:varchar(64);not null;default:'admin'" json:"role_code"` // 生产商端角色编码
|
|||
|
|
Remark string `gorm:"column:remark;type:text;not null;default:''" json:"remark"` // 备注
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() { database.AppendMigrate(&ProducerAccount{}) }
|
|||
|
|
func (table *ProducerAccount) TableName() string { return "producer_account" }
|