新增审核多点,修改医生多点处理
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/bwmarrin/snowflake"
|
||||
"gorm.io/gorm"
|
||||
"hospital-admin-api/config"
|
||||
)
|
||||
|
||||
// HospitalDepartment 医院科室表-标准
|
||||
type HospitalDepartment struct {
|
||||
DepartmentId int64 `gorm:"column:department_id;type:bigint(19);primary_key;comment:主键id" json:"department_id"`
|
||||
DepartmentName string `gorm:"column:department_name;type:varchar(255);comment:科室名称" json:"department_name"`
|
||||
DepartmentCode string `gorm:"column:department_code;type:varchar(100);comment:科室代码" json:"department_code"`
|
||||
DepartmentType int `gorm:"column:department_type;type:tinyint(1);default:0;comment:科室类型(0:未知 1:肝脏病)" json:"department_type"`
|
||||
Model
|
||||
}
|
||||
|
||||
func (m *HospitalDepartment) TableName() string {
|
||||
return "gdxz_hospital_department"
|
||||
}
|
||||
|
||||
func (m *HospitalDepartment) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.DepartmentId == 0 {
|
||||
// 创建雪花算法实例
|
||||
sf, err := snowflake.NewNode(config.C.Snowflake)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 生成新的雪花算法 ID
|
||||
m.DepartmentId = sf.Generate().Int64()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
// UserCaCert 医师/药师ca监管证书表
|
||||
type UserCaCert struct {
|
||||
CertId int64 `gorm:"column:cert_id;type:bigint(19);primary_key;comment:主键id" json:"cert_id"`
|
||||
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id(系统证书时为null)" json:"user_id"`
|
||||
UserId *int64 `gorm:"column:user_id;type:bigint(19);comment:用户id(系统证书时为null)" json:"user_id"`
|
||||
IsSystem int `gorm:"column:is_system;type:tinyint(1);default:0;comment:是否系统证书(0:否 1:是)" json:"is_system"`
|
||||
Type int `gorm:"column:type;type:tinyint(1);comment:证书类型(1:线下 2:线上)" json:"type"`
|
||||
CertBase64 string `gorm:"column:cert_base64;type:text;comment:签名值证书" json:"cert_base64"`
|
||||
|
||||
Reference in New Issue
Block a user