77 lines
2.3 KiB
Go
77 lines
2.3 KiB
Go
|
|
// Package model define model struct of model runtime service
|
||
|
|
package model
|
||
|
|
|
||
|
|
import "modelRT/orm"
|
||
|
|
|
||
|
|
// IndentityTokenModelInterface define basic identity token model type interface
|
||
|
|
type IndentityTokenModelInterface interface {
|
||
|
|
GetGridInfo() *orm.Grid
|
||
|
|
GetZoneInfo() *orm.Zone
|
||
|
|
GetStationInfo() *orm.Station
|
||
|
|
GetComponentInfo() *orm.Component
|
||
|
|
IsLocal() bool
|
||
|
|
}
|
||
|
|
|
||
|
|
// LongIdentityTokenModel define struct to long identity token info
|
||
|
|
type LongIdentityTokenModel struct {
|
||
|
|
GridInfo *orm.Grid
|
||
|
|
ZoneInfo *orm.Zone
|
||
|
|
StationInfo *orm.Station
|
||
|
|
ComponentInfo *orm.Component
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetGridInfo define return the grid information in the long identity token
|
||
|
|
func (l *LongIdentityTokenModel) GetGridInfo() *orm.Grid {
|
||
|
|
return l.GridInfo
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetZoneInfo define return the zone information in the long identity token
|
||
|
|
func (l *LongIdentityTokenModel) GetZoneInfo() *orm.Zone {
|
||
|
|
return l.ZoneInfo
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetStationInfo define return the station information in the long identity token
|
||
|
|
func (l *LongIdentityTokenModel) GetStationInfo() *orm.Station {
|
||
|
|
return l.StationInfo
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetComponentInfo define return the component information in the long identity token
|
||
|
|
func (l *LongIdentityTokenModel) GetComponentInfo() *orm.Component {
|
||
|
|
return l.ComponentInfo
|
||
|
|
}
|
||
|
|
|
||
|
|
// IsLocal define return the is_local information in the long identity token
|
||
|
|
func (l *LongIdentityTokenModel) IsLocal() bool {
|
||
|
|
return false
|
||
|
|
}
|
||
|
|
|
||
|
|
// ShortIdentityTokenModel define struct to short identity token info
|
||
|
|
type ShortIdentityTokenModel struct {
|
||
|
|
ComponentInfo *orm.Component
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetGridInfo define return the grid information in the short identity token
|
||
|
|
func (s *ShortIdentityTokenModel) GetGridInfo() *orm.Grid {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetZoneInfo define return the zone information in the short identity token
|
||
|
|
func (s *ShortIdentityTokenModel) GetZoneInfo() *orm.Zone {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetStationInfo define return the station information in the short identity token
|
||
|
|
func (s *ShortIdentityTokenModel) GetStationInfo() *orm.Station {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetComponentInfo define return the component information in the short identity token
|
||
|
|
func (s *ShortIdentityTokenModel) GetComponentInfo() *orm.Component {
|
||
|
|
return s.ComponentInfo
|
||
|
|
}
|
||
|
|
|
||
|
|
// IsLocal define return the is_local information in the short identity token
|
||
|
|
func (s *ShortIdentityTokenModel) IsLocal() bool {
|
||
|
|
return true
|
||
|
|
}
|