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

40 lines
2.0 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"
)
// SystemInquiryConfig 系统问诊配置
type SystemInquiryConfig struct {
SystemInquiryConfigId int64 `gorm:"column:system_inquiry_config_id;type:bigint(19);primary_key;comment:主键id" json:"system_inquiry_config_id"`
InquiryType int `gorm:"column:inquiry_type;type:tinyint(1);comment:接诊类型1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)" json:"inquiry_type"`
InquiryMode int `gorm:"column:inquiry_mode;type:tinyint(1);default:1;comment:接诊方式1:图文 2:视频 3:语音 4:电话 5:会员)" json:"inquiry_mode"`
MaxWorkNumDay int `gorm:"column:max_work_num_day;type:int(11);default:0;comment:每日最大接诊数量" json:"max_work_num_day"`
InquiryPrice string `gorm:"column:inquiry_price;type:varchar(255);comment:接诊价格" json:"inquiry_price"`
MinInquiryPrice float64 `gorm:"column:min_inquiry_price;type:decimal(10,2);comment:最低接诊价格(专家问诊)" json:"min_inquiry_price"`
MaxInquiryPrice float64 `gorm:"column:max_inquiry_price;type:decimal(10,2);comment:最高接诊价格(专家问诊)" json:"max_inquiry_price"`
TimesNumber int `gorm:"column:times_number;type:int(11);default:0;comment:沟通次数0为不限制次数" json:"times_number"`
Duration int `gorm:"column:duration;type:int(11);default:0;comment:沟通时长分钟0为不限制时长" json:"duration"`
Model
}
func (m *SystemInquiryConfig) TableName() string {
return "gdxz_system_inquiry_config"
}
func (m *SystemInquiryConfig) BeforeCreate(tx *gorm.DB) error {
if m.SystemInquiryConfigId == 0 {
m.SystemInquiryConfigId = 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
}