github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/internal/server/model/zd-instances-item.go (about)

     1  package model
     2  
     3  import (
     4  	consts "github.com/easysoft/zendata/internal/pkg/const"
     5  )
     6  
     7  type ZdInstancesItem struct {
     8  	BaseModel
     9  
    10  	Instance string `json:"instance" yaml:"instance,omitempty"`
    11  	Note     string `json:"note" yaml:"note,omitempty"`
    12  
    13  	Field    string `json:"field" yaml:"field,omitempty"`
    14  	Range    string `json:"range" yaml:"range,omitempty"`
    15  	Prefix   string `json:"prefix" yaml:"prefix,omitempty"`
    16  	Postfix  string `json:"postfix" yaml:"postfix,omitempty"`
    17  	Loop     string `json:"loop" yaml:"loop,omitempty"`
    18  	Loopfix  string `json:"loopfix" yaml:"loopfix,omitempty"`
    19  	Format   string `json:"format" yaml:"format,omitempty"`
    20  	Type     string `json:"type" yaml:"type,omitempty"`
    21  	Mode     string `json:"mode" yaml:"mode,omitempty"`
    22  	Items    int    `json:"records,omitempty" yaml:"records,omitempty"`
    23  	Length   int    `json:"length" yaml:"length,omitempty"`
    24  	LeftPad  string `json:"leftPad" yaml:"leftPad,omitempty"`
    25  	RightPad string `json:"rightPad" yaml:"rightPad,omitempty"`
    26  	Rand     bool   `json:"rand" yaml:"rand,omitempty"`
    27  
    28  	Config string `json:"config" yaml:"config,omitempty"`
    29  	Use    string `json:"use" yaml:"use,omitempty"`
    30  	From   string `json:"fromCol" yaml:"from,omitempty"`
    31  	Select string `json:"selectCol" yaml:"select,omitempty"`
    32  	Where  string `json:"whereCol" yaml:"where,omitempty"`
    33  	Limit  int    `json:"limitCol" yaml:"limit,omitempty"`
    34  
    35  	Exp         string `json:"exp" yaml:"exp,omitempty"`
    36  	InstancesID uint   `json:"instancesID" yaml:"-"`
    37  	ParentID    uint   `json:"parentID" yaml:"-"`
    38  	ConfigID    uint   `json:"configID" yaml:"-"`
    39  	UseID       uint   `json:"useID" yaml:"-"`
    40  
    41  	Ord    int                `gorm:"default:1" json:"ord" yaml:"-"`
    42  	Fields []*ZdInstancesItem `gorm:"-" json:"fields" yaml:"fields,omitempty"`
    43  	Froms  []*ZdInstancesItem `gorm:"-" json:"froms" yaml:"froms,omitempty"`
    44  
    45  	// for range edit
    46  	IsRange  bool        `gorm:"default:true" json:"isRange" yaml:"-"`
    47  	Sections []ZdSection `gorm:"ForeignKey:ownerID" json:"sections" yaml:"-"`
    48  
    49  	// for refer edit
    50  	Refer ZdRefer `gorm:"ForeignKey:ownerID" json:"refer" yaml:"-"`
    51  }
    52  
    53  func (*ZdInstancesItem) TableName() string {
    54  	return consts.TablePrefix + "instances_item"
    55  }