package Model import "github.com/spf13/viper" const ( TDicNation_Id = "id" //民族id TDicNation_Nationname = "nationname" //民族名称 TDicNation_Nationvalue = "nationvalue" //民族key ) type TDicNation struct { Id string `gorm:"column:id;primary_key" json:"id"` //民族id Nationname string `gorm:"column:nationname" json:"nationname"` //民族名称 Nationvalue int64 `gorm:"column:nationvalue" json:"nationvalue"` //民族key } func (TDicNation) TableName() string { tableName := "t_dic_nation" if viper.GetString("database.dbtype") == "kingbase" || viper.GetString("database.dbtype") == "postgres" { return viper.GetString("database.dbnames") + "." + tableName } return tableName }