block

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: AGPL-3.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	URL       string                 `json:"url"`
	Query     map[string]interface{} `json:"query"`
	Body      map[string]interface{} `json:"body"`
	Header    map[string]interface{} `json:"header"`
	ExtraData map[string]interface{} `json:"extraData"`
	Method    string                 `json:"method"`
}

API .

type DB

type DB struct {
	*gorm.DB
	// contains filtered or unexported fields
}

db .

func (*DB) Begin

func (db *DB) Begin() *DB

Begin .

type DashboardAPI

type DashboardAPI interface {
	CreateDashboard(block *UserBlock) (dash *DashboardBlockDTO, err error)
}

type DashboardBlockDTO

type DashboardBlockDTO struct {
	ID         string         `json:"id"`
	Name       string         `json:"name"`
	Desc       string         `json:"desc"`
	Scope      string         `json:"scope"`
	ScopeID    string         `json:"scopeId"`
	ViewConfig *ViewConfigDTO `json:"viewConfig"`
	DataConfig *dataConfigDTO `json:"-"`
	CreatedAt  int64          `json:"createdAt"`
	UpdatedAt  int64          `json:"updatedAt"`
	Version    string         `json:"version"`
}

DashboardBlockDTO .

func (*DashboardBlockDTO) ReplaceVCWithDynamicParameter

func (dash *DashboardBlockDTO) ReplaceVCWithDynamicParameter(query url.Values) *DashboardBlockDTO

type DashboardBlockQuery

type DashboardBlockQuery struct {
	ID            string
	Scope         string
	ScopeID       string
	CreatedAtDesc bool
}

DashboardBlockQuery .

func (*DashboardBlockQuery) Supplements

func (q *DashboardBlockQuery) Supplements(db *gorm.DB) *gorm.DB

Supplements Query condition .

type System

type System struct {
	*gorm.DB
}

System .

func (*System) Delete

func (db *System) Delete(query *DashboardBlockQuery) (err error)

Delete system dashboard block

func (*System) Get

func (db *System) Get(query *DashboardBlockQuery) (obj *SystemBlock, err error)

Get system dashboard block

func (*System) List

func (db *System) List(query *DashboardBlockQuery, pageSize int64, pageNo int64) (objs []*SystemBlock, total int, err error)

List system dashboard block

func (*System) Save

func (db *System) Save(obj *SystemBlock) error

Save system dashboard block

type SystemBlock

type SystemBlock struct {
	ID         string         `gorm:"not null;unique_index:id;type:varchar(64)" json:"id"`
	Name       string         `gorm:"not null;type:varchar(32);unique_index: Name, Scope, ScopeID"  json:"name" binding:"required"`
	Desc       string         `json:"desc"`
	Domain     string         `json:"domain"`
	Scope      string         `gorm:"unique_index: Name, Scope, ScopeID" json:"scope"`
	ScopeID    string         `gorm:"unique_index: Name, Scope, ScopeID" json:"scopeId"`
	ViewConfig *ViewConfigDTO `gorm:"not null;type:text"json:"viewConfig"`
	DataConfig *dataConfigDTO `gorm:"type:text" json:"dataConfig"`
	CreatedAt  time.Time      `json:"createdAt"`
	UpdatedAt  time.Time      `json:"updatedAt"`
	Version    string         `json:"version"`
}

systemBlock .

func (SystemBlock) TableName

func (SystemBlock) TableName() string

TableName .

type SystemBlockUpdate

type SystemBlockUpdate struct {
	Name       *string        `json:"name"`
	Desc       *string        `json:"desc"`
	ViewConfig *ViewConfigDTO `json:"viewConfig"`
}

SystemBlockUpdate .

type User

type User struct {
	*gorm.DB
}

User .

func (*User) Delete

func (db *User) Delete(query *DashboardBlockQuery) (err error)

Delete user dashboard block

func (*User) Get

func (db *User) Get(query *DashboardBlockQuery) (obj *UserBlock, err error)

Get user dashboard block

func (*User) List

func (db *User) List(query *DashboardBlockQuery, pageSize int64, pageNo int64) (objs []*UserBlock, total int, err error)

List user dashboard block

func (*User) Save

func (db *User) Save(obj *UserBlock) error

Save .

type UserBlock

type UserBlock struct {
	ID         string         `gorm:"not null;unique_index: Name, Scope, ScopeID,ID;type:varchar(64)" json:"id"`
	Name       string         `gorm:"not null;type:varchar(32);unique_index: Name, Scope, ScopeID,ID"  json:"name" binding:"required"`
	Desc       string         `json:"desc"`
	Domain     string         `json:"domain"`
	Scope      string         `gorm:"unique_index: Name, Scope, ScopeID,ID" json:"scope"`
	ScopeID    string         `gorm:"unique_index: Name, Scope, ScopeID,ID" json:"scopeId"`
	ViewConfig *ViewConfigDTO `gorm:"type:text;not null" json:"viewConfig"`
	DataConfig *dataConfigDTO `gorm:"type:text;not nul" json:"dataConfig"`
	CreatedAt  time.Time      `json:"createdAt"`
	UpdatedAt  time.Time      `json:"updatedAt"`
	Version    string         `json:"version"`
}

userBlock .

func (UserBlock) TableName

func (UserBlock) TableName() string

TableName .

type UserBlockUpdate

type UserBlockUpdate struct {
	Name       *string        `json:"name"`
	Desc       *string        `json:"desc"`
	ViewConfig *ViewConfigDTO `json:"viewConfig"`
	DataConfig *dataConfigDTO `json:"dataConfig"`
}

UserBlockUpdate .

type View

type View struct {
	Title          string      `json:"title"`
	Description    string      `json:"description"`
	ChartType      string      `json:"chartType"`
	DataSourceType string      `json:"dataSourceType"`
	StaticData     interface{} `json:"staticData"`
	Config         config      `json:"config"`
	API            *API        `json:"api"`
	Controls       interface{} `json:"controls"`
}

ViewResp .

type ViewConfigDTO

type ViewConfigDTO []*ViewConfigItem

ViewConfigDTO .

func (*ViewConfigDTO) Scan

func (vc *ViewConfigDTO) Scan(value interface{}) error

Scan .

func (*ViewConfigDTO) Value

func (vc *ViewConfigDTO) Value() (driver.Value, error)

Value .

type ViewConfigItem

type ViewConfigItem struct {
	W    int64  `json:"w"`
	H    int64  `json:"h"`
	X    int64  `json:"x"`
	Y    int64  `json:"y"`
	I    string `json:"i"`
	View *View  `json:"view"`
}

ViewConfig .

Jump to

Keyboard shortcuts

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