You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.2 KiB
Go
30 lines
1.2 KiB
Go
4 weeks ago
|
package Model
|
||
|
|
||
|
import "github.com/spf13/viper"
|
||
|
|
||
|
const (
|
||
|
TDictionary_Id = "id" //字典id
|
||
|
TDictionary_Dic_sort = "dic_sort" //字典分类
|
||
|
TDictionary_Dic_name = "dic_name" //字典名称
|
||
|
TDictionary_Dic_parentid = "dic_parentid" //字典父级id
|
||
|
TDictionary_Dic_serial = "dic_serial" //排序
|
||
|
TDictionary_Dic_describe = "dic_describe" //基础描述
|
||
|
)
|
||
|
|
||
|
type TDictionary struct {
|
||
|
Id string `gorm:"column:id;primary_key" json:"id"` //字典id
|
||
|
Dic_sort string `gorm:"column:dic_sort" json:"dic_sort"` //字典分类
|
||
|
Dic_name string `gorm:"column:dic_name" json:"dic_name"` //字典名称
|
||
|
Dic_parentid string `gorm:"column:dic_parentid" json:"dic_parentid"` //字典父级id
|
||
|
Dic_serial int64 `gorm:"column:dic_serial" json:"dic_serial"` //排序
|
||
|
Dic_describe string `gorm:"column:dic_describe" json:"dic_describe"` //基础描述
|
||
|
}
|
||
|
|
||
|
func (TDictionary) TableName() string {
|
||
|
tableName := "t_dictionary"
|
||
|
if viper.GetString("database.dbtype") == "kingbase" || viper.GetString("database.dbtype") == "postgres" {
|
||
|
return viper.GetString("database.dbnames") + "." + tableName
|
||
|
}
|
||
|
return tableName
|
||
|
}
|