models

package
v0.0.0-...-41ad4b5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableNameRequestWhitelist            = "request_whitelist"
	TableNameRequestBlacklist            = "request_blacklist"
	TableNameUser                        = "user"
	TableNameGroup                       = "group"
	TableNameRBACMenu                    = "rbac_menu"
	TableNameRBACMenuRole                = "rbac_menu_role"
	TableNameRBACMenuRoleBinding         = "rbac_menu_role_binding"
	TableNameRBACMenuRoleBindingUser     = "rbac_menu_role_binding_user"
	TableNameRBACMenuRoleBindingGroup    = "rbac_menu_role_binding_group"
	TableNameRBACMenuRoleBindingMenu     = "rbac_menu_role_binding_menu"
	TableNameRBACMenuRolePermissionUser  = "rbac_menu_permissions_user"
	TableNameRBACMenuRolePermissionGroup = "rbac_menu_permissions_group"
	TableNameRBACAPIAction               = "rbac_api_action"
	TableNameRBACAPIRole                 = "rbac_api_role"
	TableNameRBACAPIRoleRlAction         = "rbac_api_role_actions"
	TableNameRBACAPIRoleBinding          = "rbac_api_role_binding"
	TableNameRBACAPIRoleBindingRelUser   = "rbac_api_role_binding_user"
	TableNameRBACAPIRoleBindingRelGroup  = "rbac_api_role_binding_group"
	TableNameRBACAPIKey                  = "rbac_api_key"
	TableNameRBACAPIKeyRelRole           = "rbac_api_key_roles"
	TableNameTree                        = "tree"
	TableNameNode                        = "node"
	TableNameTreeResourceMapping         = "tree_resource_mapping"
	TableNameOperateLog                  = "operate_log"
	TableNameSuit                        = "server_suit"
	TableNameSuitType                    = "server_suit_type"
	TableNameSuitSeason                  = "server_suit_season"
	TableNameProvider                    = "server_provider"
	TableNameFactory                     = "server_factory"
	TableNameIdcRackSlot                 = "idc_rack_slot"
	TableNameIdcRack                     = "idc_rack"
	TableNameIdcRoom                     = "idc_room"
	TableNameIdc                         = "idc"
	TableNameAz                          = "az"
	TableNameServerTag                   = "server_tag"
	TableNameServerRelTag                = "server_rel_tag"
	TableNameServer                      = "server"
	TableNameServerIp                    = "server_ip"
	TableNameServerIpRelResource         = "server_rel_ip"
	TableNameServerIpRange               = "server_ip_range"
	TableNameAuditLogin                  = "audit_login"
	TableNameNetSwitch                   = "net_switch"
	TableNameNetRouter                   = "net_router"

	TableNameTicketCategory                = "ticket_category"
	TableNameTicketProduct                 = "ticket_product"
	TableNameTicketCategoryDocument        = "ticket_category_document"
	TableNameTicketWorkflowState           = "ticket_workflow_state"
	TableNameTicketWorkflowTransition      = "ticket_workflow_transition"
	TableNameTicketWorkflowRecord          = "ticket_workflow_record"
	TableNameTicketWorkflowFlowLog         = "ticket_workflow_flow_log"
	TableNameTicketWorkflowRecordComment   = "ticket_workflow_record_comment"
	TableNameTicketWorkflowCustomFormField = "ticket_workflow_custom_form_field"
	TableNameTicketWorkflowRecordFormField = "ticket_workflow_record_form_field"
	TableNameTicketRecordNodeUrge          = "ticket_record_node_urge"

	TableNameDutyLottery  = "duty_lottery"
	TableNameDutyExchange = "duty_exchange"
	TableNameDutyRoster   = "duty_roster"
)
View Source
const (
	LtCurrentMonthNum = -1
	EqCurrentMonthNum = 0
	GtCurrentMonthNum = 1
	WeekTransition    = "weekly"
	DayTransition     = "daily"
)
View Source
const (
	QueryMenuRoleBindingByUserIdOrGroupId = `` /* 375-byte string literal not displayed */

	QueryOnlineServerByTreeIdRawSQL = `` /* 196-byte string literal not displayed */

	QueryOfflineServerByTreeIdRawSQL = `` /* 195-byte string literal not displayed */

	QueryRelTreeNodePathServerByTreeIdsSQL = `` /* 196-byte string literal not displayed */

	BatchUpdateTreeNamePathSQL = `UPDATE tree 
		SET full_name_path = REPLACE ( full_name_path, ?, ? ) 
	WHERE
		full_name_path LIKE ?;`

	QueryTicketRecordTodoListRawSQL = `` /* 296-byte string literal not displayed */

)
View Source
const (
	ParticipantTypeUser      = 1
	ParticipantTypeGroup     = 2
	ParticipantTypeNoNeed    = 3
	ParticipantTypeApplicant = 4

	ApprovalTypePerson     = 1
	ApprovalTypeAutoPass   = 2
	ApprovalTypeAutoReject = 3
	ApprovalTypeNoNeed     = 4

	ApprovalButtonAgree   = "agree"
	ApprovalButtonReject  = "reject"
	ApprovalButtonDiscard = "discard"
)
View Source
const (
	TreeResourceMappingServerType = 1
	TreeResourceMappingNodeType   = 2
)

Variables

View Source
var (
	OperateConvertDB = map[string]int64{
		"移动": 1,
		"联通": 2,
		"电信": 3,
		"多线": 4,
	}
	StatusConvertDB = map[string]int64{
		"初始化":  1,
		"已上线":  2,
		"维护中":  3,
		"冷备":   4,
		"规划中":  5,
		"裁撤":   6,
		"建设中":  7,
		"裁撤新建": 8,
	}
	AttributeConvertDB = map[string]int64{
		"容器节点":  1,
		"虚拟机节点": 2,
		"物理机节点": 3,
		"混合节点":  4,
	}
	GradeConvertDB = map[string]int64{
		"标准": 1,
		"骨干": 2,
		"核心": 3,
	}
	ContractConvertDB = map[string]int64{
		"直签": 1,
		"代理": 2,
	}

	AssetsServerDeviceConvertDB = map[string]int64{
		"物理机": 1,
		"云主机": 3,
		"虚拟机": 2,
	}
	AssetsServerRoleConvertDB = map[string]int64{
		"lvs":    1,
		"master": 2,
		"node":   3,
		"other":  4,
	}
)
View Source
var (
	RequestWhitelistModel *requestWhitelistModel
	RequestBlacklistModel *blacklistModel
	UserModel             *userModel
	GroupModel            *groupModel

	MenuModel                     *rbacMenuModel
	RBACMenuRoleBindingModel      *menuRoleBindingModel
	RBACMenuRoleModel             *menuRoleModel
	RBACMenuPermissionsGroupModel *menuPermissionGroupModel
	RBACMenuPermissionsUserModel  *menuPermissionsUserModel
	RBACMenuPermissionModel       *menuPermissionModel
	RBACMenuRoleBindingMenuModel  *menuRoleBindingMenuModel
	RBACMenuRoleBindingUserModel  *menuRoleBindingUserModel
	RBACMenuRoleBindingGroupModel *menuRoleBindingGroupModel
	RBACAPIActionModel            *rbacAPIActionModel
	RBACAPIRoleModel              *rbacAPIRoleModel
	RBACAPIRoleBindingModel       *rbacAPIRoleBindingModel
	RBACAPIRoleBindingUserModel   *rbacAPIRoleBindingUserModel
	RBACAPIRoleBindingGroupModel  *rbacAPIRoleBindingGroupModel
	RBACAPIRoleRelResourceModel   *rbacAPIRoleResourceModel

	APIKeyModel        *apiKeyModel
	APIKeyRelRoleModel *apiKeyRelRole

	TreeModel       *treeModel
	NodeModel       *nodeModel
	OperateLogModel *operateLogModel

	ServerModel *serverModel

	IdcRackSlotModel *idcRackSlotModel
	FactoryModel     *factoryModel
	ProviderMode     *providerModel
	SuitModel        *suitModel

	NetIpModel  *netIpModel
	TicketModel *ticketModel
	OnCallModel *onCallModel
)
View Source
var (
	IdcRelPreload = []PreloadCondition{
		{
			Rel: clause.Associations,
		},
	}
	NetIpRelPreload = []PreloadCondition{
		{
			Rel: "IpRange",
		},
		{
			Rel: "IpRange.Node",
		},
		{
			Rel: "IpRange.Node.ProductLines",
		},
	}
	NetSwitchRelPreload = []PreloadCondition{
		{
			Rel: "Node",
		},
		{
			Rel: "RackSlot",
		},
		{
			Rel: "Factory",
		},
		{
			Rel: "Ip",
		},
	}
	NetRouterRelPreload = []PreloadCondition{
		{
			Rel: "Node",
		},
		{
			Rel: "RackSlot",
		},
		{
			Rel: "Factory",
		},
		{
			Rel: "Ip",
		},
	}

	TicketWorkflowPreload = []PreloadCondition{
		{
			Rel: "Product",
		},
	}

	TicketWorkflowWikiPreload = []PreloadCondition{
		{
			Rel: "Category",
		},
		{
			Rel: "Category.Product",
		},
	}

	TicketWorkflowStatePreload = []PreloadCondition{
		{
			Rel: "Category",
		},
		{
			Rel: "Category.Product",
		},
	}

	TicketWorkflowTransitionPreload = []PreloadCondition{
		{
			Rel: "Category",
		},
		{
			Rel: "Category.Product",
		},
		{
			Rel: "SrcState",
		},
		{
			Rel: "TargetState",
		},
	}

	TicketRecordPreload = []PreloadCondition{
		{
			Rel: "Category.Product",
		}, {
			Rel: "State",
		},
	}

	TicketRecordFlowLogPreload = []PreloadCondition{
		{
			Rel: "Record",
		}, {
			Rel: "Record.Category",
		},
		{
			Rel: "Record.Category.Product",
		},
		{
			Rel: "Record.State",
		},
	}

	TicketRecordFormPreload = []PreloadCondition{
		{
			Rel: "Record",
		},
		{
			Rel: "Record.State",
		},
	}

	TicketRecordCommentPreload = []PreloadCondition{
		{
			Rel: "User",
		},
		{
			Rel: "Record",
		},
	}
)
View Source
var (
	ActionVerbs = map[string]string{
		"POST":   "POST",
		"DELETE": "DELETE",
		"PUT":    "PUT",
		"GET":    "GET",
	}
)

Functions

func GeneratePreloadList

func GeneratePreloadList(preloadCond []PreloadCondition) []string

func GetNodeChoicesFieldByExcelRow

func GetNodeChoicesFieldByExcelRow(row []string) (map[string]int64, error)

func GetServerChoicesFieldByExcelRow

func GetServerChoicesFieldByExcelRow(row []string) (map[string]int64, error)

func InitialDB

func InitialDB(cfg *config.DBConfig) error

func JoinTableByM2M

func JoinTableByM2M() []error

func OrmDB

func OrmDB() *gorm.DB

Types

type APIAction

type APIAction struct {
	Id          int64     `json:"id"`
	Resource    string    `json:"resource"`
	Verb        string    `json:"verb"`
	Owner       string    `json:"owner"`
	Description string    `json:"description"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIAction) BeforeCreate

func (c *APIAction) BeforeCreate(tx *gorm.DB) (err error)

func (*APIAction) BeforeUpdate

func (c *APIAction) BeforeUpdate(tx *gorm.DB) (err error)

func (*APIAction) TableName

func (*APIAction) TableName() string

type APIKey

type APIKey struct {
	Id          int64      `json:"id"`
	Name        string     `json:"name"`
	Token       string     `json:"token"`
	ExpireIn    int64      `gorm:"column:expire_in" json:"expireIn"`
	Description string     `json:"description"`
	Roles       []*APIRole `gorm:"many2many:rbac_api_key_roles;joinForeignKey:key_id;joinReferences:role_id" json:"roles"`
	Owner       string     `json:"owner"`
	CreateTime  time.Time  `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time  `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIKey) BeforeCreate

func (c *APIKey) BeforeCreate(db *gorm.DB) error

func (*APIKey) BeforeUpdate

func (c *APIKey) BeforeUpdate(db *gorm.DB) error

func (*APIKey) TableName

func (*APIKey) TableName() string

type APIKeyRelRole

type APIKeyRelRole struct {
	Id         int64     `json:"id"`
	RoleId     int64     `gorm:"column:role_id" json:"roleId"`
	KeyId      int64     `gorm:"column:key_id" json:"keyId"`
	Role       APIRole   `gorm:"foreignKey:RoleId" json:"role"`
	Key        APIKey    `gorm:"foreignKey:KeyId" json:"key"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIKeyRelRole) BeforeCreate

func (c *APIKeyRelRole) BeforeCreate(db *gorm.DB) error

func (*APIKeyRelRole) BeforeUpdate

func (c *APIKeyRelRole) BeforeUpdate(db *gorm.DB) error

func (*APIKeyRelRole) TableName

func (*APIKeyRelRole) TableName() string

type APIRole

type APIRole struct {
	Id          int64        `json:"id"`
	Name        string       `json:"name"`
	Owner       string       `json:"owner"`
	Actions     []*APIAction `gorm:"many2many:rbac_api_role_actions;joinForeignKey:role_id;joinReferences:action_id" json:"actions"`
	Description string       `json:"description"`
	CreateTime  time.Time    `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time    `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIRole) BeforeCreate

func (c *APIRole) BeforeCreate(tx *gorm.DB) (err error)

func (*APIRole) BeforeUpdate

func (c *APIRole) BeforeUpdate(tx *gorm.DB) (err error)

func (*APIRole) Builder

func (c *APIRole) Builder() *ModelOrmBuilder

func (*APIRole) TableName

func (*APIRole) TableName() string

type APIRoleBinding

type APIRoleBinding struct {
	Id         int64     `json:"id"`
	RoleId     int64     `gorm:"column:role_id" json:"roleId"`
	Role       APIRole   `gorm:"foreignKey:RoleId" json:"role"`
	Users      []User    `gorm:"many2many:rbac_api_role_binding_users;joinForeignKey:role_binding_id;joinReferences:user_id" json:"users"`
	Groups     []Group   `gorm:"many2many:rbac_api_role_binding_groups;joinForeignKey:role_binding_id;joinReferences:group_id" json:"groups"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIRoleBinding) BeforeCreate

func (c *APIRoleBinding) BeforeCreate(db *gorm.DB) error

func (*APIRoleBinding) BeforeUpdate

func (c *APIRoleBinding) BeforeUpdate(db *gorm.DB) error

func (*APIRoleBinding) TableName

func (*APIRoleBinding) TableName() string

type APIRoleBindingRelGroup

type APIRoleBindingRelGroup struct {
	Id            int64     `json:"id"`
	RoleBindingId int64     `gorm:"column:role_binding_id" json:"roleBindingId"`
	GroupId       int64     `gorm:"column:group_id" json:"groupId"`
	Group         Group     `gorm:"foreignKey:GroupId" json:"group"`
	CreateTime    time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime    time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIRoleBindingRelGroup) BeforeCreate

func (c *APIRoleBindingRelGroup) BeforeCreate(db *gorm.DB) error

func (*APIRoleBindingRelGroup) BeforeUpdate

func (c *APIRoleBindingRelGroup) BeforeUpdate(db *gorm.DB) error

func (*APIRoleBindingRelGroup) TableName

func (*APIRoleBindingRelGroup) TableName() string

type APIRoleBindingRelUser

type APIRoleBindingRelUser struct {
	Id            int64     `json:"id"`
	RoleBindingId int64     `gorm:"column:role_binding_id" json:"roleBindingId"`
	UserId        int64     `gorm:"column:user_id" json:"userId"`
	User          User      `gorm:"foreignKey:UserId" json:"user"`
	CreateTime    time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime    time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIRoleBindingRelUser) BeforeCreate

func (c *APIRoleBindingRelUser) BeforeCreate(db *gorm.DB) error

func (*APIRoleBindingRelUser) BeforeUpdate

func (c *APIRoleBindingRelUser) BeforeUpdate(db *gorm.DB) error

func (*APIRoleBindingRelUser) TableName

func (*APIRoleBindingRelUser) TableName() string

type APIRoleRelAction

type APIRoleRelAction struct {
	Id         int64     `json:"id"`
	RoleId     int64     `gorm:"primaryKey;column:role_id" json:"roleId"`
	ActionId   int64     `gorm:"primaryKey;column:action_id" json:"actionId"`
	Role       APIRole   `gorm:"foreignKey:RoleId" json:"role"`
	Action     APIAction `gorm:"foreignKey:ActionId" json:"action"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*APIRoleRelAction) TableName

func (*APIRoleRelAction) TableName() string

type AuditLogin

type AuditLogin struct {
	Id         int64     `json:"id"`
	Username   string    `json:"username"`
	Type       int64     `json:"type"`
	Datetime   time.Time `json:"datetime"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*AuditLogin) Builder

func (c *AuditLogin) Builder() *ModelOrmBuilder

func (*AuditLogin) TableName

func (*AuditLogin) TableName() string

type Az

type Az struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	CnName     string    `gorm:"column:cn_name" json:"cnName"`
	Region     string    `json:"region"`
	Province   string    `json:"province"`
	Type       int64     `json:"type"`
	Status     int64     `json:"status"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Az) Builder

func (c *Az) Builder() *ModelOrmBuilder

func (*Az) TableName

func (*Az) TableName() string

type DutyExchange

type DutyExchange struct {
	Id          int64     `json:"id"`
	CurrentUser string    `gorm:"current_user" json:"currentUser"`
	HistoryUser string    `gorm:"history_user" json:"historyUser"`
	Datetime    time.Time `json:"datetime"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*DutyExchange) TableName

func (*DutyExchange) TableName() string

type DutyLottery

type DutyLottery struct {
	Id            int64     `json:"id"`
	UserIds       string    `gorm:"column:user_ids" json:"userIds"`
	DutyType      string    `gorm:"column:duty_type" json:"dutyType"`
	EffectiveTime time.Time `gorm:"column:effective_time" json:"effectiveTime"`
	Description   string    `json:"description"`
	CreateTime    time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime    time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*DutyLottery) Builder

func (c *DutyLottery) Builder() *ModelOrmBuilder

func (*DutyLottery) TableName

func (*DutyLottery) TableName() string

func (*DutyLottery) UserIdsFormat

func (c *DutyLottery) UserIdsFormat() []string

type DutyRoster

type DutyRoster struct {
	Id            int64       `json:"id"`
	CurrentUser   string      `gorm:"current_user" json:"currentUser"`
	HistoryUser   string      `gorm:"history_user" json:"historyUser"`
	Datetime      time.Time   `json:"datetime"`
	DutyLotteryId int64       `gorm:"column:duty_lottery_id" json:"dutyLotteryId"`
	DutyLottery   DutyLottery `gorm:"foreignKey:duty_lottery_id" json:"dutyLottery"`
	CreateTime    time.Time   `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime    time.Time   `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*DutyRoster) TableName

func (*DutyRoster) TableName() string

type Factory

type Factory struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name"`
	Creator     string    `json:"creator"`
	ModeName    string    `gorm:"column:mode_name" json:"modeName"`
	EnName      string    `gorm:"column:en_name" json:"enName"`
	CnName      string    `gorm:"column:cn_name" json:"cnName"`
	Description string    `json:"description"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Factory) Builder

func (c *Factory) Builder() *ModelOrmBuilder

func (*Factory) TableName

func (*Factory) TableName() string

type Group

type Group struct {
	Id               int64              `json:"id"`
	Name             string             `json:"name"`
	Email            string             `json:"email"`
	CnName           string             `gorm:"column:cn_name" json:"cnName"`
	MenuRoleBindings []*MenuRoleBinding `gorm:"many2many:rbac_menu_role_binding_group;joinForeignKey:group_id;joinReferences:role_binding_id" json:"-"`
	Description      string             `json:"description"`
	CreateTime       time.Time          `json:"createTime"`
	UpdateTime       time.Time          `json:"updateTime"`
}

func (*Group) BeforeCreate

func (c *Group) BeforeCreate(tx *gorm.DB) (err error)

func (*Group) BeforeUpdate

func (c *Group) BeforeUpdate(tx *gorm.DB) (err error)

func (*Group) Builder

func (c *Group) Builder() *ModelOrmBuilder

func (*Group) TableName

func (*Group) TableName() string

type Idc

type Idc struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name"`
	CnName      string    `gorm:"column:cn_name" json:"cnName"`
	Status      int64     `json:"status"`
	PhysicsAzId int64     `gorm:"column:physics_az_id" json:"physicsAzId"`
	VirtualAzId int64     `gorm:"column:virtual_az_id" json:"virtualAzId"`
	Address     string    `json:"address"`
	Region      string    `json:"region"`
	City        string    `json:"city"`
	CabinetNum  int64     `gorm:"column:cabinet_num" json:"cabinetNum"`
	IdcPhone    string    `gorm:"column:idc_phone" json:"idcPhone"`
	IdcMail     string    `gorm:"column:idc_mail" json:"idcMail"`
	Comment     string    `json:"comment"`
	Creator     string    `json:"creator"`
	PhysicsAz   Az        `gorm:"foreignKey:physics_az_id" json:"physicsAz"`
	VirtualAz   Az        `gorm:"foreignKey:virtual_az_id" json:"virtualAz"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Idc) Builder

func (c *Idc) Builder() *ModelOrmBuilder

func (*Idc) TableName

func (*Idc) TableName() string

type IdcRack

type IdcRack struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Row        string    `json:"row"`
	Col        string    `json:"col"`
	Group      string    `json:"group"`
	UNum       int64     `gorm:"column:u_num" json:"uNum"`
	RatedPower int64     `gorm:"column:rated_power" json:"ratedPower"`
	NetUNum    int64     `gorm:"column:net_u_num" json:"netUNum"`
	Current    int64     `json:"current"`
	IdcRoomId  int64     `gorm:"column:idc_room_id" json:"idcRoomId"`
	IdcRoom    IdcRoom   `gorm:"foreignKey:idc_room_id" json:"idcRoom"`
	Status     int64     `json:"status"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*IdcRack) Builder

func (c *IdcRack) Builder() *ModelOrmBuilder

func (*IdcRack) GetByName

func (*IdcRack) GetByName(name string) (IdcRack, error)

func (*IdcRack) TableName

func (*IdcRack) TableName() string

type IdcRackSlot

type IdcRackSlot struct {
	Id         int64     `json:"id"`
	IdcRackId  int64     `gorm:"column:idc_rack_id" json:"idcRackId"`
	IdcRack    IdcRack   `gorm:"foreignKey:idc_rack_id" json:"idcRack"`
	Type       int64     `json:"type"`
	UNum       int64     `gorm:"column:u_num" json:"uNum"`
	Port       int64     `json:"port"`
	Status     int64     `json:"status"`
	Slot       int64     `json:"slot"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*IdcRackSlot) Builder

func (c *IdcRackSlot) Builder() *ModelOrmBuilder

func (*IdcRackSlot) FullName

func (c *IdcRackSlot) FullName() string

func (*IdcRackSlot) TableName

func (*IdcRackSlot) TableName() string

type IdcRackSlotFull

type IdcRackSlotFull struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type IdcRoom

type IdcRoom struct {
	Id          int64     `json:"id"`
	RoomName    string    `gorm:"column:room_name" json:"roomName"`
	IdcId       int64     `gorm:"column:idc_id" json:"idcId"`
	Idc         Idc       `gorm:"foreignKey:idc_id" json:"idc"`
	PduStandard string    `gorm:"column:pdu_standard" json:"pduStandard"`
	PowerMode   string    `gorm:"column:power_mode" json:"powerMode"`
	RackSize    string    `gorm:"column:rack_size" json:"rackSize"`
	BearerType  string    `gorm:"column:bearer_type" json:"bearerType"`
	BearWeight  string    `gorm:"column:bear_weight" json:"bearWeight"`
	Status      int64     `json:"status"`
	Creator     string    `json:"creator"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*IdcRoom) Builder

func (c *IdcRoom) Builder() *ModelOrmBuilder

func (*IdcRoom) GetByName

func (*IdcRoom) GetByName(name string) (IdcRoom, error)

func (*IdcRoom) TableName

func (*IdcRoom) TableName() string

type IpRange

type IpRange struct {
	Id          int64     `json:"id"`
	Cidr        string    `json:"cidr"`
	Env         int64     `gorm:"column:env" json:"env"`
	Version     int64     `json:"version"`
	Status      int64     `json:"status"`
	Operator    int64     `json:"operator"`
	Ip          []NetIp   `json:"ip"`
	NodeId      int64     `gorm:"column:node_id" json:"nodeId"`
	Node        Node      `gorm:"foreignKey:node_id" json:"node"`
	Gateway     string    `json:"gateway"`
	Type        int64     `json:"type"`
	Creator     string    `json:"creator"`
	Description string    `json:"description"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*IpRange) Builder

func (c *IpRange) Builder() *ModelOrmBuilder

func (*IpRange) TableName

func (*IpRange) TableName() string
type Menu struct {
	Id          int64       `json:"id"`
	Name        string      `gorm:"column:name" json:"name"`
	Key         string      `gorm:"column:key" json:"key"`
	ParentId    int64       `gorm:"column:parent_id" json:"parentId"`
	CreateUser  string      `gorm:"column:create_user" json:"createUser"`
	Roles       []*MenuRole `gorm:"many2many:rbac_menu_role_binding_menu;joinForeignKey:menu_id;joinReferences:role_id" json:"roles"`
	Description string      `json:"description"`
	CreateTime  time.Time   `json:"createTime"`
	UpdateTime  time.Time   `json:"updateTime"`
}
func (*Menu) TableName() string
type MenuPermissionsGroup struct {
	Id         int64     `json:"id"`
	MenuId     int64     `gorm:"column:menu_id" json:"menuId"`
	GroupId    int64     `gorm:"column:group_id" json:"groupId"`
	Group      Group     `gorm:"foreignKey:GroupId" json:"group"`
	Menu       Menu      `gorm:"foreignKey:MenuId" json:"menu"`
	Read       bool      `gorm:"column:read" json:"read"`
	Create     bool      `gorm:"column:create" json:"create"`
	Update     bool      `gorm:"column:update" json:"update"`
	Delete     bool      `gorm:"column:delete" json:"delete"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}
func (*MenuPermissionsGroup) TableName() string
type MenuPermissionsUser struct {
	Id         int64     `json:"id"`
	MenuId     int64     `gorm:"column:menu_id" json:"menuId"`
	UserId     int64     `gorm:"column:user_id" json:"userId"`
	User       User      `gorm:"references:Id" json:"user"`
	Menu       Menu      `gorm:"foreignKey:MenuId" json:"menu"`
	Read       bool      `gorm:"column:read" json:"read"`
	Create     bool      `gorm:"column:create" json:"create"`
	Update     bool      `gorm:"column:update" json:"update"`
	Delete     bool      `gorm:"column:delete" json:"delete"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}
func (*MenuPermissionsUser) TableName() string
type MenuRole struct {
	Id          int64              `json:"id"`
	Name        string             `gorm:"column:name;unique;not null" json:"name"`
	Menus       []*Menu            `gorm:"many2many:rbac_menu_role_binding_menu;joinForeignKey:role_id;joinReferences:menu_id" json:"menus"`
	RoleBinding []*MenuRoleBinding `gorm:"foreignKey:RoleId"`
	Description string             `json:"description"`
	CreateTime  time.Time          `json:"createTime"`
	UpdateTime  time.Time          `json:"updateTime"`
}
func (u *MenuRole) BeforeCreate(tx *gorm.DB) (err error)
func (u *MenuRole) BeforeUpdate(tx *gorm.DB) (err error)
func (*MenuRole) TableName() string
type MenuRoleBinding struct {
	Id         int64     `json:"id"`
	RoleId     int64     `gorm:"column:role_id; not null;" json:"-"`
	Role       MenuRole  `gorm:"foreignKey:RoleId" json:"role"`
	Users      []User    `gorm:"many2many:rbac_menu_role_binding_user;joinForeignKey:role_binding_id;joinReferences:user_id" json:"users"`
	Groups     []Group   `gorm:"many2many:rbac_menu_role_binding_group;joinForeignKey:role_binding_id;joinReferences:group_id" json:"groups"`
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
}
func (c *MenuRoleBinding) BeforeCreate(db *gorm.DB) error
func (*MenuRoleBinding) TableName() string
type MenuRoleBindingGroup struct {
	Id            int64     `json:"id"`
	GroupId       int64     `gorm:"primaryKey;column:group_id" json:"groupId"`
	RoleBindingId int64     `gorm:"primaryKey;column:role_binding_id; not null;" json:"roleBindingId"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}
func (c *MenuRoleBindingGroup) BeforeCreate(db *gorm.DB) error
func (*MenuRoleBindingGroup) TableName() string
type MenuRoleBindingGroupInfo struct {
	Id            int64     `json:"id"`
	RoleBindingId int64     `json:"roleBindingId"`
	Group         Group     `json:"group"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}
type MenuRoleBindingMenu struct {
	Id         int64     `json:"id"`
	RoleId     int64     `gorm:"primaryKey;column:role_id" json:"roleId"`
	MenuId     int64     `gorm:"primaryKey;column:menu_id; not null;" json:"menuId"`
	Role       MenuRole  `gorm:"foreignKey:RoleId" json:"role"`
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
}
func (c *MenuRoleBindingMenu) BeforeCreate(db *gorm.DB) error
func (*MenuRoleBindingMenu) TableName() string
type MenuRoleBindingUser struct {
	Id            int64     `json:"id"`
	UserId        int64     `gorm:"primaryKey;column:user_id" json:"userId"`
	RoleBindingId int64     `gorm:"primaryKey;column:role_binding_id; not null;" json:"roleBindingId"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}
func (c *MenuRoleBindingUser) BeforeCreate(db *gorm.DB) error
func (*MenuRoleBindingUser) TableName() string
type MenuRoleBindingUserInfo struct {
	Id            int64     `json:"id"`
	RoleBindingId int64     `json:"roleBindingId"`
	User          User      `json:"user"`
	CreateTime    time.Time `json:"createTime"`
	UpdateTime    time.Time `json:"updateTime"`
}
type MenuRoleMenuResource struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}
type MenuRoleResource struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}
type MenuRoleRoleBindingResource struct {
	Id         int64                `json:"id"`
	Role       MenuRoleResource     `json:"role"`
	Menu       MenuRoleMenuResource `json:"menu"`
	CreateTime time.Time            `json:"createTime"`
	UpdateTime time.Time            `json:"updateTime"`
}

type ModelOrmBuilder

type ModelOrmBuilder struct {
	Model      interface{}
	ResourceId interface{}
	TableName  string
	Preload    []PreloadCondition
	Order      []string
}

type ModelOrmEngine

type ModelOrmEngine interface {
	Builder() *ModelOrmBuilder
}

type NetIp

type NetIp struct {
	Id          int64     `json:"id"`
	IpRangeId   int64     `gorm:"column:ip_range_id" json:"ipRangeId"`
	Ip          string    `gorm:"column:ip" json:"ip"`
	Netmask     string    `gorm:"column:netmask" json:"netmask"`
	Gateway     string    `json:"gateway"`
	IpRange     IpRange   `gorm:"foreignKey:ip_range_id" json:"ipRange"`
	Type        int64     `json:"type"`
	Version     int64     `json:"version"`
	Operator    int64     `json:"operator"`
	Env         int64     `json:"env"`
	Status      int64     `json:"status"`
	Creator     string    `json:"creator"`
	Description string    `json:"description"`
	CreateTime  time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*NetIp) Builder

func (c *NetIp) Builder() *ModelOrmBuilder

func (*NetIp) TableName

func (*NetIp) TableName() string

type NetIpRelResource

type NetIpRelResource struct {
	Id         int64     `json:"id"`
	Type       int64     `json:"type"`
	ResourceId int64     `gorm:"column:resource_id" json:"ResourceId"`
	IpNetId    int64     `gorm:"column:ip_net_id" json:"ipNetId"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*NetIpRelResource) Builder

func (c *NetIpRelResource) Builder() *ModelOrmBuilder

func (*NetIpRelResource) TableName

func (*NetIpRelResource) TableName() string

type NetRouter

type NetRouter struct {
	Id          int64       `json:"id"`
	Name        string      `json:"name"`
	Status      int64       `json:"status"`
	Sn          string      `json:"sn"`
	RackSlotId  int64       `gorm:"column:idc_rack_slot_id" json:"rackSlotId"`
	RackSlot    IdcRackSlot `gorm:"foreignKey:idc_rack_slot_id" json:"rackSlot"`
	FactoryId   int64       `gorm:"column:factory_id" json:"factoryId"`
	Factory     Factory     `gorm:"foreignKey:factory_id" json:"factory"`
	IP          NetIp       `gorm:"foreignKey:ip_net_id" json:"ip"`
	IpNetId     int64       `gorm:"column:ip_net_id" json:"ipNetId"`
	NodeId      int64       `gorm:"column:node_id" json:"nodeId"`
	Node        Node        `gorm:"foreignKey:node_id" json:"node"`
	Creator     string      `json:"creator"`
	Username    string      `json:"username"`
	Password    string      `json:"password"`
	Description string      `json:"description"`
	CreateTime  time.Time   `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time   `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*NetRouter) Builder

func (c *NetRouter) Builder() *ModelOrmBuilder

func (*NetRouter) TableName

func (*NetRouter) TableName() string

type NetSwitch

type NetSwitch struct {
	Id          int64       `json:"id"`
	Status      int64       `json:"status"`
	Sn          string      `json:"sn"`
	Name        string      `json:"name"`
	RackSlotId  int64       `gorm:"column:idc_rack_slot_id" json:"rackSlotId"`
	RackSlot    IdcRackSlot `gorm:"foreignKey:idc_rack_slot_id" json:"rackSlot"`
	FactoryId   int64       `gorm:"column:factory_id" json:"factoryId"`
	Factory     Factory     `gorm:"foreignKey:factory_id" json:"factory"`
	IpNetId     int64       `gorm:"column:ip_net_id" json:"ipNetId"`
	IP          NetIp       `gorm:"foreignKey:ip_net_id" json:"ip"`
	NodeId      int64       `gorm:"column:node_id" json:"nodeId"`
	Node        Node        `gorm:"foreignKey:node_id" json:"node"`
	MutualRelIp string      `gorm:"column:mutual_rel_ip" json:"mutualRelIp"`
	UpRelPort   string      `gorm:"column:up_rel_port" json:"upRelPort"`
	UpIpRelPort string      `gorm:"column:up_ip_rel_port" json:"upIpRelPort"`
	Type        int64       `json:"type"`
	Username    string      `json:"username"`
	Password    string      `json:"password"`
	Creator     string      `json:"creator"`
	Description string      `json:"description"`
	CreateTime  time.Time   `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time   `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*NetSwitch) Builder

func (c *NetSwitch) Builder() *ModelOrmBuilder

func (*NetSwitch) TableName

func (*NetSwitch) TableName() string

type Node

type Node struct {
	Id           int64     `json:"id"`
	Name         string    `json:"name"`
	CnName       string    `gorm:"column:cn_name" json:"cnName"`
	Operator     int64     `json:"operator"`
	Bandwidth    string    `json:"bandwidth"`
	Region       string    `json:"region"`
	Province     string    `json:"province"`
	Status       int64     `json:"status"`
	Creator      string    `json:"creator"`
	Attribute    int64     `json:"attribute"`
	Grade        int64     `json:"grade"`
	Comment      string    `json:"comment"`
	Contract     int64     `json:"contract"`
	ProductLines []*Tree   `gorm:"many2many:tree_resource_mapping;joinForeignKey:resource_id;joinReferences:tree_id" json:"productLines"`
	CreateTime   time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime   time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
	IsDeleted    int64     `gorm:"column:is_deleted" json:"isDeleted"`
}

func (*Node) Builder

func (c *Node) Builder() *ModelOrmBuilder

func (*Node) TableName

func (*Node) TableName() string

type OperateLog

type OperateLog struct {
	Id           int64     `json:"id"`
	Username     string    `gorm:"column:username" json:"username"`
	Type         int64     `json:"type"`
	ResourceName string    `gorm:"column:resource_name" json:"resourceName"`
	ResourcePk   string    `gorm:"column:resource_pk" json:"resourcePk"`
	SrcData      string    `gorm:"column:src_data" json:"srcData"`
	TargetData   string    `gorm:"column:target_data" json:"targetData"`
	DiffData     string    `gorm:"column:diff_data" json:"diffData"`
	Datetime     time.Time `json:"datetime"`
	CreateTime   time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime   time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*OperateLog) TableName

func (*OperateLog) TableName() string

type OrmManager

type OrmManager struct{}
var Orm *OrmManager

func (*OrmManager) Add

func (*OrmManager) Add(engine ModelOrmEngine, m interface{}, username string) error

func (*OrmManager) AddOderBy

func (*OrmManager) AddOderBy(tx *gorm.DB, orders []string) *gorm.DB

func (*OrmManager) AddPreload

func (c *OrmManager) AddPreload(tx *gorm.DB, preload []PreloadCondition) *gorm.DB

func (*OrmManager) Delete

func (c *OrmManager) Delete(engine ModelOrmEngine, condition map[string]interface{}, pk interface{}, username string) error

func (*OrmManager) DeleteById

func (c *OrmManager) DeleteById(engine ModelOrmEngine, id int64, username string) error

func (*OrmManager) FilterIdsByStr

func (c *OrmManager) FilterIdsByStr(ids string, result interface{}) (interface{}, error)

func (*OrmManager) Find

func (c *OrmManager) Find(model interface{}, condition map[string]interface{}) error

func (*OrmManager) FindAll

func (*OrmManager) FindAll(model interface{}) error

func (*OrmManager) Get

func (c *OrmManager) Get(model ModelOrmEngine, condition map[string]interface{}) error

func (*OrmManager) GetById

func (*OrmManager) GetById(model interface{}, id int64) error

func (*OrmManager) GetOrmQueryKeyCondition

func (*OrmManager) GetOrmQueryKeyCondition(m map[string]interface{}) (string, []interface{})

func (*OrmManager) GetRelPreloadById

func (c *OrmManager) GetRelPreloadById(model ModelOrmEngine, id int64) error

func (*OrmManager) InByIds

func (c *OrmManager) InByIds(tableName string, ids []int64, condition map[string]interface{}, result interface{}) error

func (*OrmManager) IsValidIdsByStr

func (c *OrmManager) IsValidIdsByStr(model ModelOrmEngine, ids string) bool

func (*OrmManager) ListByIds

func (*OrmManager) ListByIds(tableName string, ids []int64, result interface{}) error

func (*OrmManager) ParseIdsByStr

func (c *OrmManager) ParseIdsByStr(ids string) ([]int64, error)

func (*OrmManager) Scalars

func (c *OrmManager) Scalars(model ModelOrmEngine, result interface{}, condition map[string]interface{}) error

func (*OrmManager) SoftDeleteById

func (c *OrmManager) SoftDeleteById(engine ModelOrmEngine, id int64, username string) error

func (*OrmManager) Updates

func (*OrmManager) Updates(engine ModelOrmEngine, payload map[string]interface{}, username string) error

type PermissionsAction

type PermissionsAction struct {
	Read   bool `gorm:"column:read" json:"read"`
	Create bool `gorm:"column:create" json:"create"`
	Update bool `gorm:"column:update" json:"update"`
	Delete bool `gorm:"column:delete" json:"delete"`
}

func AllPermissionsAction

func AllPermissionsAction() PermissionsAction

func ReadOnlyPermissionAction

func ReadOnlyPermissionAction() PermissionsAction

type PreloadCondition

type PreloadCondition struct {
	Rel       string
	Condition string
	Value     interface{}
}

type Provider

type Provider struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Alias      string    `json:"alias"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Provider) Builder

func (c *Provider) Builder() *ModelOrmBuilder

func (*Provider) TableName

func (*Provider) TableName() string

type RBACMenuCollection

type RBACMenuCollection struct {
	Menu
	Children []Menu `json:"children"`
}

type RequestBlacklist

type RequestBlacklist struct {
	Id           int64     `json:"id"`
	IpCollection string    `gorm:"column:ip_collection" json:"ipCollection"`
	Type         int       `json:"type"`
	Description  string    `json:"description"`
	CreateTime   time.Time `json:"createTime"`
	UpdateTime   time.Time `json:"updateTime"`
}

func (*RequestBlacklist) TableName

func (*RequestBlacklist) TableName() string

type RequestWhitelist

type RequestWhitelist struct {
	Id          int64     `gorm:"primaryKey" json:"id"`
	URI         string    `gorm:"size(256);not null" json:"uri"`
	Method      string    `json:"method"`
	Description string    `gorm:"size(256)" json:"description"`
	CreateUser  string    `gorm:"column:create_user"`
	CreatedAt   time.Time `gorm:"column:create_time" json:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:update_time" json:"updatedAt"`
}

func (*RequestWhitelist) TableName

func (*RequestWhitelist) TableName() string

type Server

type Server struct {
	Id            int64        `json:"id"`
	Sn            string       `json:"sn"`
	Hostname      string       `json:"hostname"`
	Type          int64        `json:"type"`
	Suit          Suit         `gorm:"foreignKey:suit_id" json:"suit"`
	SuitId        int64        `gorm:"column:suit_id" json:"suitId"`
	PowerInfo     string       `gorm:"column:power_info" json:"powerInfo"`
	PowerCost     string       `gorm:"column:power_cost" json:"powerCost"`
	Role          int64        `json:"role"`
	Operator      int64        `json:"operator"`
	ProviderId    int64        `gorm:"column:provider_id" json:"providerId"`
	Provider      Provider     `gorm:"foreignKey:provider_id" json:"provider"`
	FactoryId     int64        `gorm:"column:factory_id" json:"factoryId"`
	Factory       Factory      `gorm:"foreignKey:factory_id" json:"factory"`
	NodeId        int64        `gorm:"column:node_id" json:"nodeId"`
	Node          Node         `gorm:"foreignKey:node_id" json:"node"`
	IdcRackSlotId int64        `gorm:"column:idc_rack_slot_id" json:"idcRackSlotId"`
	IdcRackSlot   IdcRackSlot  `gorm:"foreignKey:idc_rack_slot_id" json:"idcRackSlot"`
	Status        int64        `json:"status"`
	AppEnv        string       `gorm:"column:app_env" json:"appEnv"`
	AppEnvDesc    string       `gorm:"column:app_env_desc" json:"appEnvDesc"`
	SystemType    string       `gorm:"column:system_type" json:"systemType"`
	SystemVersion string       `gorm:"column:system_version" json:"systemVersion"`
	SystemArch    string       `gorm:"column:system_arch" json:"systemArch"`
	BelongTo      string       `gorm:"column:belong_to" json:"belongTo"`
	BelongToDesc  string       `gorm:"column:belong_to_desc" json:"belongToDesc"`
	ArrivalTime   string       `gorm:"column:arrival_time" json:"arrivalTime"`
	OverdueTime   string       `gorm:"column:overdue_time" json:"overdueTime"`
	PrivNetIp     string       `gorm:"column:priv_net_ip" json:"privNetIp"`
	PrivNetMask   string       `gorm:"column:priv_net_mask" json:"privNetMask"`
	PrivNetGw     string       `gorm:"column:priv_net_gw" json:"privNetGw"`
	PubNetIp      string       `gorm:"column:pub_net_ip" json:"pubNetIp"`
	PubNetMask    string       `gorm:"column:pub_net_mask" json:"pubNetMask"`
	PubNetGw      string       `gorm:"column:pub_net_gw" json:"pubNetGw"`
	MgmtPortIp    string       `gorm:"column:mgmt_port_ip" json:"mgmtPortIp"`
	MgmtPortMask  string       `gorm:"column:mgmt_port_mask" json:"mgmtPortMask"`
	MgmtPortGw    string       `gorm:"column:mgmt_port_gw" json:"mgmtPortGw"`
	Comment       string       `json:"comment"`
	Creator       string       `json:"creator"`
	Tags          []*ServerTag `gorm:"many2many:server_rel_tag;joinForeignKey:server_id;joinReferences:tag_id" json:"tags"`
	ProductLines  []*Tree      `gorm:"many2many:tree_resource_mapping;joinForeignKey:resource_id;joinReferences:tree_id" json:"productLines"`
	IsDeleted     int64        `gorm:"column:is_deleted" json:"isDeleted"`
	CreateTime    time.Time    `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime    time.Time    `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Server) Builder

func (c *Server) Builder() *ModelOrmBuilder

func (*Server) TableName

func (*Server) TableName() string

type ServerRelTag

type ServerRelTag struct {
	Id         int64     `json:"id"`
	ServerId   int64     `gorm:"column:server_id" json:"serverId"`
	TagId      int64     `gorm:"column:tag_id" json:"tagId"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*ServerRelTag) Builder

func (c *ServerRelTag) Builder() *ModelOrmBuilder

func (*ServerRelTag) TableName

func (*ServerRelTag) TableName() string

type ServerTag

type ServerTag struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*ServerTag) Builder

func (c *ServerTag) Builder() *ModelOrmBuilder

func (*ServerTag) TableName

func (*ServerTag) TableName() string

type Suit

type Suit struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Season     string    `json:"season"`
	Type       string    `json:"type"`
	Cpu        string    `json:"cpu"`
	Memory     string    `json:"memory"`
	Storage    string    `json:"storage"`
	Gpu        string    `json:"gpu"`
	Raid       string    `json:"raid"`
	Psu        string    `json:"psu"`
	Nic        string    `json:"nic"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Suit) Builder

func (c *Suit) Builder() *ModelOrmBuilder

func (*Suit) TableName

func (*Suit) TableName() string

type SuitSeason

type SuitSeason struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*SuitSeason) Builder

func (c *SuitSeason) Builder() *ModelOrmBuilder

func (*SuitSeason) TableName

func (*SuitSeason) TableName() string

type SuitType

type SuitType struct {
	Id         int64     `json:"id"`
	Name       string    `json:"name"`
	Creator    string    `json:"creator"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*SuitType) Builder

func (c *SuitType) Builder() *ModelOrmBuilder

func (*SuitType) TableName

func (*SuitType) TableName() string

type TicketCategory

type TicketCategory struct {
	Id                      int64         `json:"id"`
	Name                    string        `json:"name"`
	Icon                    string        `json:"icon"`
	AllowedVisibilityGroups string        `gorm:"column:allowed_visibility_groups" json:"allowedVisibilityGroups"`
	ProductId               int64         `gorm:"column:product_id" json:"productId"`
	Product                 TicketProduct `gorm:"foreignKey:product_id" json:"product"`
	SnRuleIdentifier        string        `gorm:"column:sn_rule_identifier" json:"snRuleIdentifier"`
	Layout                  string        `json:"layout"`
	Webhook                 string        `gorm:"column:webhook" json:"webhook"`
	Creator                 string        `json:"creator"`
	Description             string        `json:"description"`
	CreateTime              time.Time     `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime              time.Time     `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketCategory) Builder

func (c *TicketCategory) Builder() *ModelOrmBuilder

func (*TicketCategory) TableName

func (*TicketCategory) TableName() string

type TicketCategoryDocument

type TicketCategoryDocument struct {
	Id          int64          `json:"id"`
	Name        string         `json:"name"`
	URL         string         `gorm:"column:url" json:"url"`
	CategoryId  int64          `gorm:"column:category_id" json:"categoryId"`
	Category    TicketCategory `gorm:"foreignKey:category_id" json:"category"`
	Creator     string         `json:"creator"`
	Description string         `json:"description"`
	CreateTime  time.Time      `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time      `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketCategoryDocument) Builder

func (*TicketCategoryDocument) TableName

func (*TicketCategoryDocument) TableName() string

type TicketProduct

type TicketProduct struct {
	Id                      int64     `json:"id"`
	Name                    string    `json:"name"`
	Icon                    string    `json:"icon"`
	AllowedVisibilityGroups string    `gorm:"column:allowed_visibility_groups" json:"allowedVisibilityGroups"`
	Creator                 string    `json:"creator"`
	Description             string    `json:"description"`
	CreateTime              time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime              time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketProduct) Builder

func (c *TicketProduct) Builder() *ModelOrmBuilder

func (*TicketProduct) TableName

func (*TicketProduct) TableName() string

type TicketRecordNodeUrge

type TicketRecordNodeUrge struct {
	Id          int64                `json:"id"`
	RecordId    int64                `gorm:"column:record_id" json:"recordId"`
	Record      TicketWorkflowRecord `gorm:"foreignKey:record_id" json:"record"`
	NodeStateId int64                `gorm:"column:node_state_id" json:"nodeStateId"`
	NodeState   TicketWorkflowState  `gorm:"foreignKey:node_state_id" json:"nodeState"`
	Creator     string               `json:"creator"`
	CreateTime  time.Time            `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime  time.Time            `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketRecordNodeUrge) Builder

func (c *TicketRecordNodeUrge) Builder() *ModelOrmBuilder

func (*TicketRecordNodeUrge) TableName

func (*TicketRecordNodeUrge) TableName() string

type TicketWorkflowCustomFormField

type TicketWorkflowCustomFormField struct {
	Id           int64          `json:"id"`
	CategoryId   int64          `gorm:"column:category_id" json:"categoryId"`
	Category     TicketCategory `gorm:"foreignKey:category_id" json:"category"`
	FieldType    int64          `gorm:"column:field_type" json:"fieldType"`
	FieldKey     string         `gorm:"column:field_key" json:"fieldKey"`
	FieldLabel   string         `gorm:"column:field_label" json:"fieldLabel"`
	Placeholder  string         `json:"placeholder"`
	Required     int            `json:"required"`
	DefaultValue string         `gorm:"column:default_value" json:"defaultValue"`
	RemoteURL    string         `gorm:"column:remote_url" json:"remoteURL"`
	FieldOptions string         `gorm:"column:field_options" json:"fieldOptions"`
	Priority     int64          `gorm:"column:priority" json:"priority"`
	Width        string         `json:"width"`
	RowMargin    int64          `gorm:"column:row_margin" json:"rowMargin"`
	Creator      string         `json:"creator"`
	CreateTime   time.Time      `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime   time.Time      `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowCustomFormField) Builder

func (*TicketWorkflowCustomFormField) TableName

type TicketWorkflowRecord

type TicketWorkflowRecord struct {
	Id         int64               `json:"id"`
	SN         string              `gorm:"column:sn" json:"sn"`
	StateId    int64               `gorm:"column:state_id" json:"stateId"`
	State      TicketWorkflowState `gorm:"foreignKey:state_id" json:"state"`
	CategoryId int64               `gorm:"column:category_id" json:"categoryId"`
	Category   TicketCategory      `gorm:"foreignKey:category_id" json:"category"`
	Status     int                 `json:"status"`
	Creator    string              `json:"creator"`
	CreateTime time.Time           `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time           `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowRecord) Builder

func (c *TicketWorkflowRecord) Builder() *ModelOrmBuilder

func (*TicketWorkflowRecord) TableName

func (*TicketWorkflowRecord) TableName() string

type TicketWorkflowRecordComment

type TicketWorkflowRecordComment struct {
	Id           int64                `json:"id"`
	RecordId     int64                `gorm:"column:ticket_workflow_record_id" json:"recordId"`
	Record       TicketWorkflowRecord `gorm:"foreignKey:ticket_workflow_record_id" json:"record"`
	UserId       int64                `gorm:"column:user_id" json:"userId"`
	User         User                 `gorm:"references:Id" json:"user"`
	Content      string               `json:"content"`
	CurrentState string               `gorm:"column:current_state" json:"currentState"`
	CreateTime   time.Time            `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime   time.Time            `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowRecordComment) Builder

func (*TicketWorkflowRecordComment) TableName

func (*TicketWorkflowRecordComment) TableName() string

type TicketWorkflowRecordFlowLog

type TicketWorkflowRecordFlowLog struct {
	Id             int64                `json:"id"`
	Approver       string               `json:"approver"`
	RecordId       int64                `gorm:"column:ticket_workflow_record_id" json:"recordId"`
	Record         TicketWorkflowRecord `gorm:"foreignKey:ticket_workflow_record_id" json:"record"`
	NodePriority   int64                `gorm:"column:node_priority" json:"nodePriority"`
	Status         string               `gorm:"column:status" json:"status"`
	WorkflowNode   string               `gorm:"column:workflow_node" json:"workflowNode"`
	HandleDuration string               `gorm:"column:handle_duration" json:"handleDuration"`
	Suggestion     string               `json:"suggestion"`
	ApprovalStatus string               `gorm:"column:approval_status" json:"approvalStatus"`
	CreateTime     time.Time            `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime     time.Time            `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowRecordFlowLog) Builder

func (*TicketWorkflowRecordFlowLog) TableName

func (*TicketWorkflowRecordFlowLog) TableName() string

type TicketWorkflowRecordFormField

type TicketWorkflowRecordFormField struct {
	Id         int64                `json:"id"`
	RecordId   int64                `gorm:"column:ticket_workflow_record_id" json:"recordId"`
	Record     TicketWorkflowRecord `gorm:"foreignKey:ticket_workflow_record_id" json:"record"`
	FieldType  int64                `gorm:"column:field_type" json:"fieldType"`
	FieldKey   string               `gorm:"column:field_key" json:"fieldKey"`
	FieldLabel string               `gorm:"column:field_label" json:"fieldLabel"`
	FieldValue string               `gorm:"column:field_value" json:"fieldValue"`
	Creator    string               `json:"creator"`
	CreateTime time.Time            `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime time.Time            `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowRecordFormField) Builder

func (*TicketWorkflowRecordFormField) TableName

type TicketWorkflowState

type TicketWorkflowState struct {
	Id                       int64          `json:"id"`
	StateName                string         `gorm:"column:state_name" json:"stateName"`
	Priority                 int64          `gorm:"column:priority" json:"priority"`
	CurrentFormFieldStateSet string         `gorm:"column:current_form_field_state_set" json:"currentFormFieldStateSet"`
	HiddenState              int64          `gorm:"column:hidden_state" json:"hiddenState"`
	ApprovalType             int64          `gorm:"column:approval_type" json:"approvalType"`
	ParticipantType          int64          `gorm:"column:participant_type" json:"participantType"`
	Participant              string         `gorm:"column:participant" json:"participant"`
	Webhook                  string         `gorm:"column:webhook" json:"webhook"`
	CategoryId               int64          `gorm:"column:category_id" json:"categoryId"`
	Category                 TicketCategory `gorm:"foreignKey:category_id" json:"category"`
	Creator                  string         `json:"creator"`
	CreateTime               time.Time      `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime               time.Time      `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowState) Builder

func (c *TicketWorkflowState) Builder() *ModelOrmBuilder

func (*TicketWorkflowState) TableName

func (*TicketWorkflowState) TableName() string

type TicketWorkflowTransition

type TicketWorkflowTransition struct {
	Id                     int64               `json:"id"`
	ButtonName             string              `gorm:"column:button_name" json:"buttonName"`
	ButtonType             string              `gorm:"column:button_type" json:"buttonType"`
	CurrentWorkflowStateId int64               `gorm:"column:current_workflow_state_id" json:"currentWorkflowStateId"`
	TargetWorkflowStateId  int64               `gorm:"column:target_workflow_state_id" json:"targetWorkflowStateId"`
	SrcState               TicketWorkflowState `gorm:"foreignKey:current_workflow_state_id" json:"srcState"`
	TargetState            TicketWorkflowState `gorm:"foreignKey:target_workflow_state_id" json:"targetState"`
	CategoryId             int64               `gorm:"column:category_id" json:"categoryId"`
	Category               TicketCategory      `gorm:"foreignKey:category_id" json:"category"`
	Creator                string              `json:"creator"`
	CreateTime             time.Time           `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime             time.Time           `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*TicketWorkflowTransition) Builder

func (*TicketWorkflowTransition) TableName

func (*TicketWorkflowTransition) TableName() string

type Tree

type Tree struct {
	Id           int64     `json:"id"`
	Name         string    `gorm:"column:name" json:"name"`
	Level        int64     `json:"level"`
	ParentId     int64     `gorm:"column:parent_id" json:"parentId"`
	FullNamePath string    `gorm:"column:full_name_path" json:"fullNamePath"`
	FullIdPath   string    `gorm:"column:full_id_path" json:"fullIdPath"`
	CreateTime   time.Time `gorm:"column:create_time;type:datetime(0)" json:"createTime"`
	UpdateTime   time.Time `gorm:"column:update_time;type:datetime(0)" json:"updateTime"`
}

func (*Tree) BeforeCreate

func (c *Tree) BeforeCreate(tx *gorm.DB) (err error)

func (*Tree) BeforeUpdate

func (c *Tree) BeforeUpdate(tx *gorm.DB) (err error)

func (*Tree) TableName

func (*Tree) TableName() string

type TreeResourceMapping

type TreeResourceMapping struct {
	Id         int64     `json:"id"`
	TreeId     int64     `gorm:"column:tree_id" json:"treeId"`
	ResourceId int64     `gorm:"column:resource_id" json:"resourceId"`
	Type       int64     `json:"type"`
	CreateTime time.Time `gorm:"column:create_time;type:datetime(0);autoUpdateTime" json:"createTime"`
	UpdateTime time.Time `gorm:"column:update_time;type:datetime(0);autoUpdateTime" json:"updateTime"`
}

func (*TreeResourceMapping) Builder

func (c *TreeResourceMapping) Builder() *ModelOrmBuilder

func (*TreeResourceMapping) TableName

func (*TreeResourceMapping) TableName() string

type UpSetResponse

type UpSetResponse struct {
	Id            int64    `json:"id"`
	Users         []string `json:"users"`
	UserIds       string   `json:"userIds"`
	DutyType      string   `json:"dutyType"`
	EffectiveTime string   `json:"effectiveTime"`
	CreateTime    string   `json:"createTime"`
	UpdateTime    string   `json:"updateTime"`
}

type User

type User struct {
	Id               int64              `json:"id"`
	UserId           string             `gorm:"column:user_id; not null; unique; size:255" json:"userId"`
	Username         string             `gorm:"column:username; not null; unique; size:255" json:"username"`
	Password         string             `gorm:"column:password; not null; size:255" json:"password"`
	Name             string             `gorm:"column:name; not null; size:255" json:"name"`
	Email            string             `gorm:"column:email; not null; size:255; unique" json:"email"`
	Photo            string             `gorm:"column:photo" json:"photo"`
	LastLoginTime    time.Time          `gorm:"column:last_login_time" json:"lastLoginTime"`
	LastLoginIp      string             `gorm:"column:last_login_ip" json:"lastLoginIp"`
	GroupId          int64              `json:"-"`
	Group            Group              `gorm:"foreignKey:GroupId" json:"group"`
	MenuRoleBindings []*MenuRoleBinding `gorm:"many2many:rbac_menu_role_binding_user;joinForeignKey:user_id;joinReferences:role_binding_id" json:"-"`
	IsAdmin          bool               `json:"isAdmin"`
	IsActive         bool               `json:"isActive"`
	IsDelete         bool               `gorm:"column:photo" json:"isDeleted"`
	CreateTime       time.Time          `json:"createTime"`
	UpdateTime       time.Time          `json:"updateTime"`
}

func (*User) BeforeCreate

func (c *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) BeforeUpdate

func (c *User) BeforeUpdate(tx *gorm.DB) (err error)

func (*User) Builder

func (c *User) Builder() *ModelOrmBuilder

func (*User) TableName

func (*User) TableName() string

Jump to

Keyboard shortcuts

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