optical_data.go 433 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "server/global"
  4. )
  5. type OpticalData struct {
  6. global.GVA_MODEL
  7. Sn string `json:"sn" gorm:"comment:编号"`
  8. TunnelSn string `json:"tunnelSn" gorm:"comment:隧道序号"`
  9. Illuminance int64 `json:"illuminance" gorm:"comment:光照度"`
  10. }
  11. func (OpticalData) TableName() string {
  12. return "optical_data"
  13. }
  14. func (od OpticalData) CreateOpticalData() error {
  15. return global.GVA_DB.Create(&od).Error
  16. }