model

package
v0.0.0-...-f65af78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DictGetValue

func DictGetValue(db *gorm.DB, typ int, key string) (string, error)

DictGetValue looks up a single value from the dict table by type and key.

func DictSetValue

func DictSetValue(db *gorm.DB, typ int, key, value string) error

DictSetValue updates the value in the dict table for the given type and key.

Types

type Attribute

type Attribute struct {
	ID    uint   `json:"id" gorm:"primaryKey"`
	Name  string `json:"name" gorm:"comment:名称"`
	Type  uint32 `json:"type" gorm:"comment:类型"`
	Value string `json:"value" gorm:"值"`
}

type Dict

type Dict struct {
	Group uint32 `json:"group" gorm:"primaryKey;comment:组"`
	Key   string `json:"key" gorm:"primaryKey;comment:键"`
	Value string `json:"value" gorm:"comment:值"`
	Type  uint32 `json:"type" gorm:"comment:类型"`
	Seq   uint32 `json:"seq" gorm:"comment:排序"`
}

type Enum

type Enum struct {
	ID    uint   `json:"id" gorm:"primaryKey"`
	Group uint32 `json:"group" gorm:"uniqueIndex:idx_group_name;not null;default:0;comment:枚举组"`
	Name  string `json:"name" gorm:"uniqueIndex:idx_group_name;not null;comment:名称"`
	Type  uint32 `json:"type" gorm:"comment:类型"`
}

type EnumValue

type EnumValue struct {
	ID     uint   `json:"id" gorm:"primaryKey"`
	EnumID uint   `json:"enumId" gorm:"index;not null;comment:枚举id"`
	Index  uint32 `json:"index" gorm:"comment:索引"`
	Value  string `json:"value" gorm:"not null;comment:值"`
}

type Object

type Object struct {
	ID      uint   `json:"id" gorm:"primaryKey"`
	FieldID uint   `json:"fieldId" gorm:"comment:字段id"`
	Value   string `json:"value" gorm:"comment:值"`
}

type PostgresEnum

type PostgresEnum struct {
	ID    uint `gorm:"primaryKey"`
	Enums sqlx.StringArray
}

type Struct

type Struct struct {
	ID   uint   `json:"id" gorm:"primaryKey"`
	Name string `json:"name" gorm:"comment:名称"`
}

Struct represents a dynamic struct definition stored in the database. Kind codes: {1,int8},{2,int16},...,{x,uint8},...,{x,uint64},{x,string}.

type StructField

type StructField struct {
	ID          uint   `json:"id" gorm:"primaryKey"`
	StructID    uint   `json:"structId" gorm:"comment:结构体id"`
	Name        string `json:"name" gorm:"comment:名称"`
	Kind        uint32 `json:"kind" gorm:"comment:类型"`
	Tag         string `json:"tag" gorm:"comment:标签"`
	Offset      uint32 `json:"offset" gorm:"comment:偏移量"`
	Anonymous   bool   `json:"anonymous" gorm:"comment:匿名"`
	SubStructID uint   `json:"subStructId" gorm:"comment:子结构体id"`
}

type TableColumn

type TableColumn struct {
	ID      uint   `json:"id" gorm:"primaryKey"`
	Name    string `json:"name" gorm:"comment:名称"`
	Type    string `json:"type" gorm:"comment:类型"`
	TableID uint   `json:"tableId" gorm:"comment:表id"`
}

type TableMeta

type TableMeta struct {
	ID   uint   `json:"id" gorm:"primaryKey"`
	Name string `json:"name" gorm:"comment:名称"`
}

type TableValue

type TableValue struct {
	ID       uint   `json:"id" gorm:"primaryKey"`
	ColumnID uint   `json:"columnId" gorm:"comment:字段id"`
	Value    string `json:"value" gorm:"comment:值"`
}

type Upload

type Upload struct {
	ID           uint64 `gorm:"primary_key" json:"id"`
	Name         string `gorm:"type:varchar(100);not null" json:"name"`
	OriginalName string `gorm:"type:varchar(100);not null" json:"original_name"`
	URL          string `json:"url"`
	MD5          string `gorm:"type:varchar(32)" json:"md5"`
	Mime         string `json:"mime"`
	Size         uint64 `json:"size"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL