app

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID          int                    `json:"actionId"`
	UID         uuid.UUID              `json:"uid"`
	TeamID      int                    `json:"teamID"`
	App         int                    `json:"-"`
	Version     int                    `json:"-"`
	Resource    int                    `json:"resourceId,omitempty"`
	DisplayName string                 `json:"displayName"`
	Type        string                 `json:"actionType"`
	Template    map[string]interface{} `json:"content"`
	Transformer map[string]interface{} `json:"transformer"`
	TriggerMode string                 `json:"triggerMode"`
	Config      string                 `json:"config"`
	CreatedAt   time.Time              `json:"createdAt,omitempty"`
	CreatedBy   int                    `json:"createdBy,omitempty"`
	UpdatedAt   time.Time              `json:"updatedAt,omitempty"`
	UpdatedBy   int                    `json:"updatedBy,omitempty"`
}

func (*Action) ExportConfig added in v1.9.0

func (action *Action) ExportConfig() *repository.ActionConfig

type ActionForExport added in v1.9.0

type ActionForExport struct {
	ID          string                   `json:"actionId"`
	UID         uuid.UUID                `json:"uid"`
	TeamID      string                   `json:"teamID"`
	App         string                   `json:"-"`
	Version     int                      `json:"-"`
	Resource    string                   `json:"resourceId,omitempty"`
	DisplayName string                   `json:"displayName"`
	Type        string                   `json:"actionType"`
	Template    map[string]interface{}   `json:"content"`
	Transformer map[string]interface{}   `json:"transformer"`
	TriggerMode string                   `json:"triggerMode"`
	Config      *repository.ActionConfig `json:"config"`
	CreatedAt   time.Time                `json:"createdAt,omitempty"`
	CreatedBy   string                   `json:"createdBy,omitempty"`
	UpdatedAt   time.Time                `json:"updatedAt,omitempty"`
	UpdatedBy   string                   `json:"updatedBy,omitempty"`
}

func NewActionForExport added in v1.9.0

func NewActionForExport(action *Action) *ActionForExport

type AppActivity

type AppActivity struct {
	Modifier   string    `json:"modifier"`
	ModifiedAt time.Time `json:"modifiedAt"`
}

type AppDto

type AppDto struct {
	ID              int                   `json:"appId"` // generated by database primary key serial
	UID             uuid.UUID             `json:"uid"`
	TeamID          int                   `json:"teamID"`
	Name            string                `json:"appName" validate:"required"`
	ReleaseVersion  int                   `json:"releaseVersion"`  // release version used for mark the app release version.
	MainlineVersion int                   `json:"mainlineVersion"` // mainline version keep the newest app version in database.
	Config          *repository.AppConfig `json:"config"`
	CreatedBy       int                   `json:"-" `
	CreatedAt       time.Time             `json:"-"`
	UpdatedBy       int                   `json:"updatedBy"`
	UpdatedAt       time.Time             `json:"updatedAt"`
	AppActivity     AppActivity           `json:"appActivity"`
}

func NewAppDto

func NewAppDto() *AppDto

func (*AppDto) ConstructByMap

func (appd *AppDto) ConstructByMap(data interface{})

func (*AppDto) ConstructWithID

func (appd *AppDto) ConstructWithID(id int)

func (*AppDto) ConstructWithUpdateBy

func (appd *AppDto) ConstructWithUpdateBy(updateBy int)

func (*AppDto) InitUID added in v1.9.0

func (a *AppDto) InitUID()

func (*AppDto) InitUpdatedAt added in v1.9.0

func (a *AppDto) InitUpdatedAt()

func (*AppDto) SetTeamID added in v1.9.0

func (a *AppDto) SetTeamID(teamID int)

func (*AppDto) UpdateAppDTOConfig added in v1.9.0

func (a *AppDto) UpdateAppDTOConfig(appConfig *repository.AppConfig, userID int)

type AppDtoForExport added in v1.9.0

type AppDtoForExport struct {
	ID              string                `json:"appId"` // generated by database primary key serial
	UID             uuid.UUID             `json:"uid"`
	TeamID          string                `json:"teamID"`
	Name            string                `json:"appName" validate:"required"`
	ReleaseVersion  int                   `json:"releaseVersion"`  // release version used for mark the app release version.
	MainlineVersion int                   `json:"mainlineVersion"` // mainline version keep the newest app version in database.
	Config          *repository.AppConfig `json:"config"`
	CreatedBy       string                `json:"-" `
	CreatedAt       time.Time             `json:"-"`
	UpdatedBy       string                `json:"updatedBy"`
	UpdatedAt       time.Time             `json:"updatedAt"`
	AppActivity     AppActivity           `json:"appActivity"`
}

func NewAppDtoForExport added in v1.9.0

func NewAppDtoForExport(a *AppDto) *AppDtoForExport

func (*AppDtoForExport) ExportForFeedback added in v1.9.0

func (resp *AppDtoForExport) ExportForFeedback() interface{}

type AppService

type AppService interface {
	CreateApp(app AppDto) (AppDto, error)
	IsPublicApp(teamID int, appID int) bool
	UpdateApp(app AppDto) (*AppDtoForExport, error)
	FetchAppByID(teamID int, appID int) (AppDto, error)
	DeleteApp(teamID int, appID int) error
	GetAllApps(teamID int) ([]*AppDtoForExport, error)
	DuplicateApp(teamID int, appID, userID int, name string) (*AppDtoForExport, error)
	ReleaseApp(teamID int, appID int) (int, error)
	GetMegaData(teamID int, appID int, version int) (*EditorForExport, error)
}

type AppServiceImpl

type AppServiceImpl struct {
	// contains filtered or unexported fields
}

func NewAppServiceImpl

func NewAppServiceImpl(logger *zap.SugaredLogger, appRepository repository.AppRepository,
	kvstateRepository repository.KVStateRepository,
	treestateRepository repository.TreeStateRepository, setstateRepository repository.SetStateRepository,
	actionRepository repository.ActionRepository) *AppServiceImpl

func (*AppServiceImpl) CreateApp

func (impl *AppServiceImpl) CreateApp(app AppDto) (AppDto, error)

func (*AppServiceImpl) DeleteApp

func (impl *AppServiceImpl) DeleteApp(teamID int, appID int) error

func (*AppServiceImpl) DuplicateApp

func (impl *AppServiceImpl) DuplicateApp(teamID int, appID int, userID int, name string) (*AppDtoForExport, error)

func (*AppServiceImpl) FetchAppByID

func (impl *AppServiceImpl) FetchAppByID(teamID int, appID int) (AppDto, error)

func (*AppServiceImpl) GetAllApps

func (impl *AppServiceImpl) GetAllApps(teamID int) ([]*AppDtoForExport, error)

func (*AppServiceImpl) GetMegaData

func (impl *AppServiceImpl) GetMegaData(teamID, appID, version int) (*EditorForExport, error)

func (*AppServiceImpl) IsPublicApp added in v1.9.0

func (impl *AppServiceImpl) IsPublicApp(teamID int, appID int) bool

func (*AppServiceImpl) ReleaseApp

func (impl *AppServiceImpl) ReleaseApp(teamID int, appID int) (int, error)

func (*AppServiceImpl) UpdateApp

func (impl *AppServiceImpl) UpdateApp(app AppDto) (*AppDtoForExport, error)

func (*AppServiceImpl) UpdateAppModifyTime

func (impl *AppServiceImpl) UpdateAppModifyTime(app *AppDto) error

call this method when action (over HTTP) and state (over websocket) changed

type ComponentNode

type ComponentNode struct {
	DisplayName    string                 `json:"displayName"`
	ParentNode     string                 `json:"parentNode"`
	ShowName       string                 `json:"showName"`
	Cerror         bool                   `json:"error"`
	IsDragging     bool                   `json:"isDragging"`
	IsResizing     bool                   `json:"isResizing"`
	ChildrenNode   []*ComponentNode       `json:"childrenNode"`
	Ctype          string                 `json:"type"`
	ContainerType  string                 `json:"containerType"`
	VerticalResize bool                   `json:"verticalResize"`
	H              float64                `json:"h"`
	W              float64                `json:"w"`
	MinH           float64                `json:"minH"`
	MinW           float64                `json:"minW"`
	UnitW          float64                `json:"unitW"`
	UnitH          float64                `json:"unitH"`
	X              float64                `json:"x"`
	Y              float64                `json:"y"`
	Z              float64                `json:"z"`
	Props          map[string]interface{} `json:"props"`
	PanelConfig    map[string]interface{} `json:"panelConfig"`
}

type Editor

type Editor struct {
	AppInfo               AppDto                 `json:"appInfo"`
	Actions               []Action               `json:"actions"`
	Components            *ComponentNode         `json:"components"`
	DependenciesState     map[string][]string    `json:"dependenciesState"`
	DragShadowState       map[string]interface{} `json:"dragShadowState"`
	DottedLineSquareState map[string]interface{} `json:"dottedLineSquareState"`
	DisplayNameState      []string               `json:"displayNameState"`
}

type EditorForExport added in v1.9.0

type EditorForExport struct {
	AppInfo               *AppDtoForExport       `json:"appInfo"`
	Actions               []*ActionForExport     `json:"actions"`
	Components            *ComponentNode         `json:"components"`
	DependenciesState     map[string][]string    `json:"dependenciesState"`
	DragShadowState       map[string]interface{} `json:"dragShadowState"`
	DottedLineSquareState map[string]interface{} `json:"dottedLineSquareState"`
	DisplayNameState      []string               `json:"displayNameState"`
}

func NewEditorForExport added in v1.9.0

func NewEditorForExport(editor *Editor) *EditorForExport

func (*EditorForExport) ExportForFeedback added in v1.9.0

func (resp *EditorForExport) ExportForFeedback() interface{}

Jump to

Keyboard shortcuts

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