collection

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCollection

func CreateCollection(dBResource *crud.Resource, c *gin.Context)

创建集合

func GetCollection

func GetCollection(dBResource *crud.Resource, c *gin.Context)

查看集合

func QueryCollection

func QueryCollection(dBResource *crud.Resource, c *gin.Context)

获取集合

Types

type Collection

type Collection struct {
	base.BaseId `bson,inline`
	Name        string              `bson:"name,omitempty" json:"name,omitempty" update:"setOnInsert"`
	Description string              `bson:"description,omitempty" json:"description,omitempty"`
	Version     int64               `bson:"version,omitempty" json:"version,omitempty"`
	Extend      string              `bson:"extend,omitempty" json:"extend,omitempty"`
	Owner       string              `bson:"owner,omitempty" json:"owner,omitempty"`
	Fields      []CollectionField   `bson:"fields,omitempty" json:"fields,omitempty"`
	Developers  []Developer         `bson:"developers,omitempty" json:"developers,omitempty"`
	Functions   map[string]Function `bson:"functions,omitempty" json:"functions,omitempty"`
}

集合

func (*Collection) GetCollectionName

func (collection *Collection) GetCollectionName() *string

type CollectionField

type CollectionField struct {
	// 字段名称
	Name string `bson:"name" json:"name"`
	// 字段中文名称
	Title string `bson:"title" json:"title"`
	// 字段类型
	Type string `bson:"type" json:"type"`
	// 字段描述
	Desc string `bson:"desc,omitempty" json:"desc,omitempty"`

	RefField bool `bson:"refField,omitempty" json:"refField,omitempty"`

	SetOnInsert bool `bson:"setOnInsert,omitempty" json:"setOnInsert,omitempty"`
	// 如果是内置对象模型,具体的字段是定义
	Fields []CollectionField `bson:"fields,omitempty" json:"fields,omitempty"`

	SelectOptions []SelectOptions `bson:"selectOptions,omitempty" json:"selectOptions,omitempty"`
	// 值
	Value interface{} `bson:"value,omitempty" json:"value,omitempty"`
	// 默认值
	DefaultValue interface{} `bson:"defaultValue,omitempty" json:"defaultValue,omitempty"`
	// 验证规则
	Validate string `bson:"validate,omitempty" json:"validate,omitempty"`
	// id 初始化值
	IdInitVal int64 `bson:"idInitVal,omitempty" json:"idInitVal,omitempty"`
	// id key
	IdKey string `bson:"idKey,omitempty" json:"idKey,omitempty"`
}

集合字段类型

type CollectionRequest

type CollectionRequest struct {
	commons.PagingRequest
	Name string `bson:"name,omitempty" json:"name,omitempty" update:"setOnInsert"`
}

type Developer

type Developer struct {
	Name string `bson:"name,omitempty" json:"name,omitempty"`
	Time string `bson:"time,omitempty" json:"time,omitempty"`
	Desc string `bson:"desc,omitempty" json:"desc,omitempty"`
}

开发者

type Function

type Function struct {
	Params   []CollectionField `bson:"params,omitempty" json:"params,omitempty"`
	Template string            `bson:"template,omitempty" json:"template,omitempty"`
}

开发者

type SelectOptions

type SelectOptions struct {
	Label string `bson:"label" json:"label"`
	Value string `bson:"value" json:"value"`
}

Jump to

Keyboard shortcuts

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