state

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStateDto

type KVStateDto struct {
	ID        int       `json:"id"`
	UID       uuid.UUID `json:"uid"`
	TeamID    int       `json:"teamID"`
	StateType int       `json:"state_type"`
	AppRefID  int       `json:"app_ref_id"`
	Version   int       `json:"version"`
	Key       string    `json:"key"`
	Value     string    `json:"value"`
	CreatedAt time.Time `json:"created_at"`
	CreatedBy int       `json:"created_by"`
	UpdatedAt time.Time `json:"updated_at"`
	UpdatedBy int       `json:"updated_by"`
}

func NewKVStateDto

func NewKVStateDto() *KVStateDto

func (*KVStateDto) ConstructByApp

func (kvsd *KVStateDto) ConstructByApp(app *app.AppDto)

func (*KVStateDto) ConstructByKvState

func (kvsd *KVStateDto) ConstructByKvState(kvState *repository.KVState)

func (*KVStateDto) ConstructByMap

func (kvsd *KVStateDto) ConstructByMap(data interface{}) error

func (*KVStateDto) ConstructForDependenciesState

func (kvsd *KVStateDto) ConstructForDependenciesState(data interface{}) error

func (*KVStateDto) ConstructWithDisplayNameForDelete

func (kvsd *KVStateDto) ConstructWithDisplayNameForDelete(displayNameInterface interface{}) error

func (*KVStateDto) ConstructWithEditVersion

func (kvsd *KVStateDto) ConstructWithEditVersion()

func (*KVStateDto) ConstructWithID

func (kvsd *KVStateDto) ConstructWithID(id int)

func (*KVStateDto) ConstructWithKey

func (kvsd *KVStateDto) ConstructWithKey(key string)

func (*KVStateDto) ConstructWithType

func (kvsd *KVStateDto) ConstructWithType(stateType int)

func (*KVStateDto) ConstructWithValue

func (kvsd *KVStateDto) ConstructWithValue(value string)

func (*KVStateDto) InitUID added in v1.9.0

func (k *KVStateDto) InitUID()

func (*KVStateDto) SetTeamID added in v1.9.0

func (k *KVStateDto) SetTeamID(teamID int)

type KVStateService

type KVStateService interface {
	CreateKVState(kvstate KVStateDto) (KVStateDto, error)
	DeleteKVState(kvstateID int) error
	UpdateKVState(kvstate KVStateDto) (KVStateDto, error)
	GetKVStateByID(kvstateID int) (KVStateDto, error)
	GetKVStateByKey(kvStateDto *KVStateDto) (*KVStateDto, error)
	GetAllTypeKVStateByApp(app *app.AppDto, version int) ([]*KVStateDto, error)
	GetKVStateByApp(app *app.AppDto, statetype int, version int) ([]*KVStateDto, error)
	ReleaseKVStateByApp(app *app.AppDto) error
}

type KVStateServiceImpl

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

func NewKVStateServiceImpl

func NewKVStateServiceImpl(logger *zap.SugaredLogger,
	kvStateRepository repository.KVStateRepository) *KVStateServiceImpl

func (*KVStateServiceImpl) CreateKVState

func (impl *KVStateServiceImpl) CreateKVState(kvstate *KVStateDto) (*KVStateDto, error)

func (*KVStateServiceImpl) DeleteAllEditKVStateByStateType

func (impl *KVStateServiceImpl) DeleteAllEditKVStateByStateType(kvStateDto *KVStateDto) error

func (*KVStateServiceImpl) DeleteKVState

func (impl *KVStateServiceImpl) DeleteKVState(teamID int, kvstateID int) error

func (*KVStateServiceImpl) DeleteKVStateByKey

func (impl *KVStateServiceImpl) DeleteKVStateByKey(kvStateDto *KVStateDto) error

func (*KVStateServiceImpl) GetAllTypeKVStateByApp

func (impl *KVStateServiceImpl) GetAllTypeKVStateByApp(app *app.AppDto, version int) ([]*KVStateDto, error)

func (*KVStateServiceImpl) GetKVStateByApp

func (impl *KVStateServiceImpl) GetKVStateByApp(app *app.AppDto, statetype int, version int) ([]*KVStateDto, error)

func (*KVStateServiceImpl) GetKVStateByID

func (impl *KVStateServiceImpl) GetKVStateByID(teamID int, kvstateID int) (KVStateDto, error)

func (*KVStateServiceImpl) GetKVStateByKey

func (impl *KVStateServiceImpl) GetKVStateByKey(kvStateDto *KVStateDto) (*KVStateDto, error)

func (*KVStateServiceImpl) ReleaseKVStateByApp

func (impl *KVStateServiceImpl) ReleaseKVStateByApp(teamID int, appDto *app.AppDto) error

@todo: should this method be in a transaction?

func (*KVStateServiceImpl) UpdateKVState

func (impl *KVStateServiceImpl) UpdateKVState(kvstate KVStateDto) (KVStateDto, error)

func (*KVStateServiceImpl) UpdateKVStateByID

func (impl *KVStateServiceImpl) UpdateKVStateByID(kvStateDto *KVStateDto) error

func (*KVStateServiceImpl) UpdateKVStateByKey

func (impl *KVStateServiceImpl) UpdateKVStateByKey(kvStateDto *KVStateDto) error

type SetStateDto

type SetStateDto struct {
	ID        int       `json:"id"`
	UID       uuid.UUID `json:"uid"`
	TeamID    int       `json:"teamID"`
	StateType int       `json:"state_type"`
	AppRefID  int       `json:"app_ref_id"`
	Version   int       `json:"version"`
	Value     string    `json:"value"`
	CreatedAt time.Time `json:"created_at"`
	CreatedBy int       `json:"created_by"`
	UpdatedAt time.Time `json:"updated_at"`
	UpdatedBy int       `json:"updated_by"`
}

func NewSetStateDto

func NewSetStateDto() *SetStateDto

func (*SetStateDto) ConstructByApp

func (setsd *SetStateDto) ConstructByApp(app *app.AppDto)

func (*SetStateDto) ConstructBySetState

func (setsd *SetStateDto) ConstructBySetState(setState *repository.SetState)

func (*SetStateDto) ConstructWithDisplayNameForDelete

func (setsd *SetStateDto) ConstructWithDisplayNameForDelete(displayNameInterface interface{}) error

func (*SetStateDto) ConstructWithEditVersion

func (setsd *SetStateDto) ConstructWithEditVersion()

func (*SetStateDto) ConstructWithType

func (setsd *SetStateDto) ConstructWithType(stateType int)

func (*SetStateDto) ConstructWithValue

func (setsd *SetStateDto) ConstructWithValue(value string)

func (*SetStateDto) ConstructWithValueAfterUpdate

func (setsd *SetStateDto) ConstructWithValueAfterUpdate(dnsfu *repository.DisplayNameStateForUpdate)

func (*SetStateDto) ConstructWithValueBeforeUpdate

func (setsd *SetStateDto) ConstructWithValueBeforeUpdate(dnsfu *repository.DisplayNameStateForUpdate)

func (*SetStateDto) InitUID added in v1.9.0

func (s *SetStateDto) InitUID()

func (*SetStateDto) SetTeamID added in v1.9.0

func (s *SetStateDto) SetTeamID(teamID int)

type SetStateService

type SetStateService interface {
	CreateSetState(setState *SetStateDto) (*SetStateDto, error)
	DeleteSetState(setStateID int) error
	DeleteSetStateByValue(setStateDto *SetStateDto) error
	UpdateSetState(setState *SetStateDto) (*SetStateDto, error)
	UpdateSetStateByValue(beforeSetStateDto *SetStateDto, afterSetStateDto *SetStateDto) error
	GetSetStateByID(setStateID int) (SetStateDto, error)
	GetByValue(setStateDto *SetStateDto) (*SetStateDto, error)
}

type SetStateServiceImpl

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

func NewSetStateServiceImpl

func NewSetStateServiceImpl(logger *zap.SugaredLogger,
	setStateRepository repository.SetStateRepository) *SetStateServiceImpl

func (*SetStateServiceImpl) CreateSetState

func (impl *SetStateServiceImpl) CreateSetState(setState *SetStateDto) (*SetStateDto, error)

func (*SetStateServiceImpl) DeleteSetState

func (impl *SetStateServiceImpl) DeleteSetState(teamID, setStateID int) error

func (*SetStateServiceImpl) DeleteSetStateByValue

func (impl *SetStateServiceImpl) DeleteSetStateByValue(setStateDto *SetStateDto) error

func (*SetStateServiceImpl) GetByValue

func (impl *SetStateServiceImpl) GetByValue(setStateDto *SetStateDto) (*SetStateDto, error)

func (*SetStateServiceImpl) GetSetStateByID

func (impl *SetStateServiceImpl) GetSetStateByID(teamID, setStateID int) (SetStateDto, error)

func (*SetStateServiceImpl) UpdateSetState

func (impl *SetStateServiceImpl) UpdateSetState(setState *SetStateDto) (*SetStateDto, error)

func (*SetStateServiceImpl) UpdateSetStateByValue

func (impl *SetStateServiceImpl) UpdateSetStateByValue(beforeSetStateDto *SetStateDto, afterSetStateDto *SetStateDto) error

type TreeStateDto

type TreeStateDto struct {
	ID                 int       `json:"id"`
	UID                uuid.UUID `json:"uid"`
	TeamID             int       `json:"teamID"`
	StateType          int       `json:"state_type"`
	ParentNodeRefID    int       `json:"parent_node_ref_id"`
	ChildrenNodeRefIDs []int     `json:"children_node_ref_ids"`
	AppRefID           int       `json:"app_ref_id"`
	Version            int       `json:"version"`
	Name               string    `json:"name"`
	ParentNode         string    `json:"parentNode"`
	Content            string    `json:"content"`
	CreatedAt          time.Time `json:"created_at"`
	CreatedBy          int       `json:"created_by"`
	UpdatedAt          time.Time `json:"updated_at"`
	UpdatedBy          int       `json:"updated_by"`
}

func NewTreeStateDto

func NewTreeStateDto() *TreeStateDto

func (*TreeStateDto) ConstructByApp

func (tsd *TreeStateDto) ConstructByApp(app *app.AppDto)

func (*TreeStateDto) ConstructByMap

func (tsd *TreeStateDto) ConstructByMap(data interface{})

func (*TreeStateDto) ConstructByTreeState

func (tsd *TreeStateDto) ConstructByTreeState(treeState *repository.TreeState) error

func (*TreeStateDto) ConstructWithContent

func (tsd *TreeStateDto) ConstructWithContent(content []byte)

func (*TreeStateDto) ConstructWithDisplayNameForDelete

func (tsd *TreeStateDto) ConstructWithDisplayNameForDelete(displayNameInterface interface{}) error

func (*TreeStateDto) ConstructWithEditVersion

func (tsd *TreeStateDto) ConstructWithEditVersion()

func (*TreeStateDto) ConstructWithID

func (tsd *TreeStateDto) ConstructWithID(id int)

func (*TreeStateDto) ConstructWithNewStateContent

func (tsd *TreeStateDto) ConstructWithNewStateContent(ntsd *TreeStateDto)

func (*TreeStateDto) ConstructWithType

func (tsd *TreeStateDto) ConstructWithType(stateType int)

func (*TreeStateDto) InitUID added in v1.9.0

func (s *TreeStateDto) InitUID()

func (*TreeStateDto) SetTeamID added in v1.9.0

func (s *TreeStateDto) SetTeamID(teamID int)

type TreeStateService

type TreeStateService interface {
	CreateTreeState(treestate *TreeStateDto) (*TreeStateDto, error)
	DeleteTreeState(teamID int, treestateId int) error
	UpdateTreeState(treestate *TreeStateDto) (*TreeStateDto, error)
	GetTreeStateByID(teamID int, treestateID int) (TreeStateDto, error)
	GetAllTypeTreeStateByApp(app *app.AppDto, version int) ([]*TreeStateDto, error)
	GetTreeStateByApp(app *app.AppDto, statetype int, version int) ([]*TreeStateDto, error)
	ReleaseTreeStateByApp(app *app.AppDto) error
	CreateComponentTree(appDto *app.AppDto, parentNodeID int, componentNodeTree *repository.ComponentNode) error
	GetTreeStateByName(currentNode *TreeStateDto) (*TreeStateDto, error)
}

type TreeStateServiceImpl

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

func NewTreeStateServiceImpl

func NewTreeStateServiceImpl(logger *zap.SugaredLogger, treestateRepository repository.TreeStateRepository) *TreeStateServiceImpl

func (*TreeStateServiceImpl) CreateComponentTree

func (impl *TreeStateServiceImpl) CreateComponentTree(appDto *app.AppDto, parentNodeID int, componentNodeTree *repository.ComponentNode) error

func (*TreeStateServiceImpl) CreateTreeState

func (impl *TreeStateServiceImpl) CreateTreeState(treestate *TreeStateDto) (*TreeStateDto, error)

func (*TreeStateServiceImpl) DeleteTreeState

func (impl *TreeStateServiceImpl) DeleteTreeState(teamID int, treestateID int) error

func (*TreeStateServiceImpl) DeleteTreeStateNodeRecursive

func (impl *TreeStateServiceImpl) DeleteTreeStateNodeRecursive(currentNode *TreeStateDto) error

func (*TreeStateServiceImpl) GetAllTypeTreeStateByApp

func (impl *TreeStateServiceImpl) GetAllTypeTreeStateByApp(app *app.AppDto, version int) ([]*TreeStateDto, error)

func (*TreeStateServiceImpl) GetTreeStateByApp

func (impl *TreeStateServiceImpl) GetTreeStateByApp(app *app.AppDto, statetype int, version int) ([]*TreeStateDto, error)

func (*TreeStateServiceImpl) GetTreeStateByID

func (impl *TreeStateServiceImpl) GetTreeStateByID(teamID int, treestateID int) (TreeStateDto, error)

func (*TreeStateServiceImpl) GetTreeStateByName

func (impl *TreeStateServiceImpl) GetTreeStateByName(currentNode *TreeStateDto) (*TreeStateDto, error)

func (*TreeStateServiceImpl) MoveTreeStateNode

func (impl *TreeStateServiceImpl) MoveTreeStateNode(currentNode *TreeStateDto) error

@todo: add tree ref circle checker.

func (*TreeStateServiceImpl) NewTreeStateByComponentState

func (impl *TreeStateServiceImpl) NewTreeStateByComponentState(appDto *app.AppDto, cnode *repository.ComponentNode) (*TreeStateDto, error)

func (*TreeStateServiceImpl) ReleaseTreeStateByApp

func (impl *TreeStateServiceImpl) ReleaseTreeStateByApp(app *app.AppDto) error

@todo: should this method be in a transaction?

func (*TreeStateServiceImpl) UpdateTreeState

func (impl *TreeStateServiceImpl) UpdateTreeState(treestate *TreeStateDto) (*TreeStateDto, error)

Jump to

Keyboard shortcuts

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