tables

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus struct {
	UserID   string `json:"user_id"`
	UserName string `json:"user_name"`

	AppID   string           `json:"app_id"`
	TableID string           `json:"tableID" binding:"required"`
	Schema  models.WebSchema `json:"schema"`

	Source models.SourceType `json:"source"` // source 1 是表单驱动,2是模型驱动
	Update bool              `json:"update"`
	ConvertSchemas
}

type ComponentProp

type ComponentProp struct {
	AppID   string   `json:"appID"`
	TableID string   `json:"tableID"`
	Columns []string `json:"columns"`
	// 'sub_table | foreign_table'
	Subordination string `json:"subordination"`
	// 关联表schema
	AssociatedTable interface{}            `json:"associatedTable"`
	Multiple        bool                   `json:"multiple"`
	FieldName       string                 `json:"fieldName"`
	AggType         string                 `json:"aggType"`
	Conditions      map[string]interface{} `json:"condition"`
	FilterConfig    map[string]interface{} `json:"filterConfig"`
	Template        string                 `json:"template"`
}

ComponentProp schema中 x-component-props 结构.

type ConvertSchemas

type ConvertSchemas struct {
	ConvertSchema models.SchemaProperties `json:"convertSchema"`
	Title         string
	FieldLen      int64
	Description   string
}

type CreateTableReq

type CreateTableReq struct {
	AppID    string            `json:"app_id"`
	TableID  string            `json:"tableID"`
	Schema   models.WebSchema  `json:"schema"`
	UserID   string            `json:"user_id"`
	UserName string            `json:"user_name"`
	Source   models.SourceType `json:"source"` // source 1 是表单驱动,2是模型驱动
}

type DeleteTableReq

type DeleteTableReq struct {
	AppID   string `json:"appID"`
	TableID string `json:"tableID"`
}

type DeleteTableResp

type DeleteTableResp struct{}

type DoResponse

type DoResponse struct{}

type FindTableReq

type FindTableReq struct {
	Title  string            `json:"title"`
	AppID  string            `json:"appID"`
	Page   int               `json:"page"`
	Size   int               `json:"size"`
	Source models.SourceType `json:"source"`
}

type FindTableResp

type FindTableResp struct {
	List  []*tableVo `json:"list"`
	Total int64      `json:"total"`
}

type GetTableInfoReq

type GetTableInfoReq struct {
	TableID string `json:"tableID" binding:"required"`
	AppID   string `json:"appID"`
}

type GetTableInfoResp

type GetTableInfoResp struct {
	TableID     string `json:"tableID"`
	FieldLen    int64  `json:"fieldLen"`
	CreatorName string `json:"createdBy"`
	CreatedAt   int64  `json:"createdAt"`
	EditorName  string `json:"updatedBy"`
	UpdatedAt   int64  `json:"updatedAt"`
}

type GetTableReq

type GetTableReq struct {
	AppID   string `json:"appID"`
	TableID string `json:"tableID"`
}

type GetTableResp

type GetTableResp struct {
	// id pk
	ID string `json:"id"`
	// table design json schema
	Schema models.WebSchema `json:"schema"`
	// table page config json schema
	Config models.Config `json:"config"`

	TableID string `json:"tableID"`
}

type Guidance

type Guidance interface {
	Do(ctx context.Context, bus *Bus) (*DoResponse, error)
}

func NewWebTable

func NewWebTable(conf *config.Config) (Guidance, error)

type Table

type Table interface {
	GetTable(ctx context.Context, req *GetTableReq) (*GetTableResp, error)
	DeleteTable(ctx context.Context, req *DeleteTableReq) (*DeleteTableResp, error)
	FindTable(ctx context.Context, req *FindTableReq) (*FindTableResp, error)
	UpdateConfig(ctx context.Context, req *UpdateConfigReq) (*UpdateConfigResp, error)
	GetTableInfo(ctx context.Context, req *GetTableInfoReq) (*GetTableInfoResp, error)
}

func NewTable

func NewTable(conf *config2.Config) (Table, error)

type UpdateConfigReq

type UpdateConfigReq struct {
	TableID string        `json:"tableID"`
	AppID   string        `json:"appID"`
	Config  models.Config `json:"config"`
}

type UpdateConfigResp

type UpdateConfigResp struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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