hospital-admin-api/api/model/userPharmacistInfo.go

47 lines
2.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// UserPharmacistInfo 药师-详情表
type UserPharmacistInfo struct {
InfoId int64 `gorm:"column:info_id;type:bigint(19);primary_key;comment:主键id" json:"info_id"`
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id" json:"user_id"`
PharmacistId int64 `gorm:"column:pharmacist_id;type:bigint(19);comment:药师id" json:"pharmacist_id"`
CardType int `gorm:"column:card_type;type:tinyint(1);comment:类型1:身份证 2:护照 3:港澳通行证 4:台胞证)" json:"card_type"`
CardName string `gorm:"column:card_name;type:varchar(30);comment:证件姓名" json:"card_name"`
CardNameMask string `gorm:"column:card_name_mask;type:varchar(30);comment:证件姓名(掩码)" json:"card_name_mask"`
CardNum string `gorm:"column:card_num;type:varchar(50);comment:证件号码" json:"card_num"`
CardNumMask string `gorm:"column:card_num_mask;type:varchar(50);comment:证件号码(掩码)" json:"card_num_mask"`
LicenseCert string `gorm:"column:license_cert;type:varchar(255);comment:医师执业证(逗号分隔)" json:"license_cert"`
QualificationCert string `gorm:"column:qualification_cert;type:varchar(255);comment:医师资格证(逗号分隔)" json:"qualification_cert"`
QualificationCertNum string `gorm:"column:qualification_cert_num;type:varchar(255);comment:医师资格证号(逗号分隔)" json:"qualification_cert_num"`
WorkCert string `gorm:"column:work_cert;type:varchar(255);comment:医师工作证(逗号分隔)" json:"work_cert"`
MultiPointImages string `gorm:"column:multi_point_images;type:varchar(255);comment:多点执业备案信息(逗号分隔)" json:"multi_point_images"`
IdCardFront string `gorm:"column:id_card_front;type:varchar(255);comment:身份证正面图片" json:"id_card_front"`
IdCardBack string `gorm:"column:id_card_back;type:varchar(255);comment:身份证背面图片" json:"id_card_back"`
SignImage string `gorm:"column:sign_image;type:varchar(255);comment:签名图片" json:"sign_image"`
Model
}
func (m *UserPharmacistInfo) TableName() string {
return "gdxz_user_pharmacist_info"
}
func (m *UserPharmacistInfo) BeforeCreate(tx *gorm.DB) error {
if m.InfoId == 0 {
m.InfoId = global.Snowflake.Generate().Int64()
}
m.CreatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("CreatedAt", m.CreatedAt)
m.UpdatedAt = LocalTime(time.Now())
tx.Statement.SetColumn("UpdatedAt", m.UpdatedAt)
return nil
}