package model import "shylinux.com/x/mysql-story/src/db" const ( UID = "uid" NAME = "name" TYPE = "type" TITLE = "title" CONTENT = "content" USER_UID = "user_uid" USER_STORAGE_ROLE = "user_storage_role" STORAGE_UID = "storage_uid" STORAGE_NAME = "storage_name" STORAGE_TYPE = "storage_type" FILE_UID = "file_uid" FILE_TYPE = "file_type" COMPANY_UID = "company_uid" CITY_UID = "city_uid" SIZE = "size" ) type UserStorage struct { db.ModelUserPlace StorageUID string `gorm:"type:char(32);index"` } type Storage struct { db.ModelPlace CompanyUID string `gorm:"type:char(32);index"` } type File struct { db.ModelContent StorageUID string `gorm:"type:char(32);index"` Type uint8 `gorm:"default:0"` Size int `gorm:"default:0"` } func init() { db.CmdModels("", &UserStorage{}, &Storage{}, &File{}) }