This commit is contained in:
2024-10-17 23:52:10 +08:00
commit 1e92c359f4
14 changed files with 447 additions and 0 deletions

11
models/hospital.go Normal file
View File

@ -0,0 +1,11 @@
package models
type Hospital struct {
HospitalID int `gorm:"column:hospital_id" json:"hospital_id"`
HospitalName string `gorm:"column:hospital_name" json:"hospital_name"`
Address string `gorm:"column:address" json:"address"`
}
func (Hospital) TableName() string {
return "hospital"
}

35
models/record.go Normal file
View File

@ -0,0 +1,35 @@
package models
type Check struct {
CheckID int `gorm:"column:check_id"`
UserID int `gorm:"column:user_id"`
CheckDate string `gorm:"column:check_date"`
InsertTime string `gorm:"column:insert_time"`
UpdateTime string `gorm:"column:update_time"`
}
func (Check) TableName() string {
return "checks"
}
type CheckItem struct {
CheckItemID int `gorm:"column:check_item_id"`
CheckID int `gorm:"column:check_id"`
ItemID int `gorm:"column:item_id"`
ItemValue string `gorm:"column:item_value"`
}
func (CheckItem) TableName() string {
return "check_items"
}
type Item struct {
ItemID int `gorm:"column:item_id"`
ItemName string `gorm:"column:item_name"`
ItemNormalMin string `gorm:"column:item_normal_min"`
ItemNormalMax string `gorm:"column:item_normal_max"`
}
func (Item) TableName() string {
return "items"
}

17
models/user.go Normal file
View File

@ -0,0 +1,17 @@
package models
import "time"
type User struct {
UserID int `gorm:"column:user_id"`
UserName string `gorm:"column:user_name"`
Password string `gorm:"column:password"`
Brth time.Time `gorm:"column:brth"`
Height float32 `gorm:"column:height"`
Tel string `gorm:"column:tel"`
SMSTry int `gorm:"column:SMS_try"`
}
func (User) TableName() string {
return "user"
}