增加了年度审查

This commit is contained in:
2025-09-02 14:04:12 +08:00
parent ca05f0d16e
commit f08692c58e
3 changed files with 116 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package model
import (
"gorm.io/gorm"
"hospital-admin-api/global"
"time"
)
// SystemConfig 系统配置表
type SystemConfig struct {
SystemConfigId int64 `gorm:"column:system_config_id;type:int(10);primary_key;comment:主键id" json:"system_config_id"`
IsAutoPharVerifyPrescription int `gorm:"column:is_auto_phar_verify_prescription;type:tinyint(1);default:0;comment:药师是否自动审核处方(0:否 1:是)" json:"is_auto_phar_verify_prescription"`
IsAnnualReview int `gorm:"column:is_annual_review;type:tinyint(1);default:0;comment:是否开启年度审查(0:否 1:是)" json:"is_annual_review"`
Model
}
func (m *SystemConfig) TableName() string {
return "gdxz_system_config"
}
func (m *SystemConfig) BeforeCreate(tx *gorm.DB) error {
if m.SystemConfigId == 0 {
m.SystemConfigId = 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
}