smart

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeToSqlType added in v0.6.19

func TypeToSqlType(t string) (st schemas.SQLType)

Types

type AutoOption

type AutoOption struct {
	Label string `json:"label"`
	Value any    `json:"value"`
}

type Column

type Column struct {
	Name      string `json:"name,omitempty"`
	Comment   string `json:"comment,omitempty"`
	Type      string `json:"type,omitempty"`
	Default   string `json:"default,omitempty"`
	NotNull   bool   `json:"not_null,omitempty"`
	Length    int64  `json:"length,omitempty"`
	Length2   int64  `json:"length2,omitempty"`
	Primary   bool   `json:"primary,omitempty"`
	Increment bool   `json:"increment,omitempty"`
	Indexed   bool   `json:"indexed,omitempty"`
	Created   bool   `json:"created,omitempty"`
	Updated   bool   `json:"updated,omitempty"`
	Json      bool   `json:"json,omitempty"`
}

Column 数据库列定义,放这里有点怪,但是又没办法

func (*Column) Cast added in v0.6.19

func (f *Column) Cast(v any) (ret any, err error)

func (*Column) ToColumn added in v0.6.19

func (f *Column) ToColumn() *schemas.Column

type Field

type Field struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Type        string `json:"type,omitempty"` //type object array
	Default     any    `json:"default,omitempty"`
	Placeholder string `json:"placeholder,omitempty"`
	Tips        string `json:"tips,omitempty"`

	Clear    bool `json:"clear,omitempty"`
	Disabled bool `json:"disabled,omitempty"`
	Hidden   bool `json:"hidden,omitempty"`

	Array    bool    `json:"array,omitempty"`
	Children []Field `json:"children,omitempty"` //子级?

	Required bool    `json:"required,omitempty"`
	Min      float64 `json:"min,omitempty"`
	Max      float64 `json:"max,omitempty"`
	Step     float64 `json:"step,omitempty"`

	Multiple bool `json:"multiple,omitempty"`

	Auto    []AutoOption   `json:"auto,omitempty"`
	Options []SelectOption `json:"options,omitempty"`
	Tree    []TreeOption   `json:"tree,omitempty"`

	Change string `json:"change,omitempty"`

	Time       bool   `json:"time,omitempty"`
	TimeFormat string `json:"time_format,omitempty"`

	Pattern string `json:"pattern,omitempty"`

	Upload string `json:"upload,omitempty"` //上传路径

}

type SelectOption

type SelectOption struct {
	Label    string `json:"label"`
	Value    any    `json:"value"`
	Title    string `json:"title,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
	Hide     bool   `json:"hide,omitempty"`
	Key      any    `json:"key,omitempty"`
}

type TreeOption added in v0.1.0

type TreeOption struct {
	Title      string        `json:"title,omitempty"`
	Key        string        `json:"key,omitempty"`
	IsLeaf     bool          `json:"isLeaf,omitempty"`
	Selectable bool          `json:"selectable,omitempty"`
	Disabled   bool          `json:"disabled,omitempty"`
	Expanded   bool          `json:"expanded,omitempty"`
	Children   []*TreeOption `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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