2021-01-12 11:59:51 +00:00
|
|
|
package domain
|
|
|
|
|
2021-01-28 05:35:26 +00:00
|
|
|
type Application interface {
|
|
|
|
GetAppID() string
|
|
|
|
GetApplicationName() string
|
|
|
|
GetState() AppState
|
2021-01-12 11:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AppState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
AppStateUnspecified AppState = iota
|
|
|
|
AppStateActive
|
|
|
|
AppStateInactive
|
|
|
|
AppStateRemoved
|
|
|
|
)
|
|
|
|
|
2021-02-22 11:27:47 +00:00
|
|
|
func (a AppState) Exists() bool {
|
|
|
|
return !(a == AppStateUnspecified || a == AppStateRemoved)
|
|
|
|
}
|
|
|
|
|
2021-01-28 05:35:26 +00:00
|
|
|
type ChangeApp struct {
|
|
|
|
AppID string
|
|
|
|
AppName string
|
|
|
|
State AppState
|
|
|
|
}
|
2021-01-12 11:59:51 +00:00
|
|
|
|
2021-01-28 05:35:26 +00:00
|
|
|
func (a *ChangeApp) GetAppID() string {
|
|
|
|
return a.AppID
|
|
|
|
}
|
2021-01-12 11:59:51 +00:00
|
|
|
|
2021-01-28 05:35:26 +00:00
|
|
|
func (a *ChangeApp) GetApplicationName() string {
|
|
|
|
return a.AppName
|
2021-01-12 11:59:51 +00:00
|
|
|
}
|
|
|
|
|
2021-01-28 05:35:26 +00:00
|
|
|
func (a *ChangeApp) GetState() AppState {
|
|
|
|
return a.State
|
2021-01-12 11:59:51 +00:00
|
|
|
}
|