2020-09-17 15:45:46 +08:00
|
|
|
package model
|
|
|
|
|
2020-10-07 22:00:55 +08:00
|
|
|
const (
|
|
|
|
// GovernanceModeBuildInServiceMesh means the governance mode is BUILD_IN_SERVICE_MESH
|
2020-11-07 10:11:33 +08:00
|
|
|
GovernanceModeBuildInServiceMesh = "BUILD_IN_SERVICE_MESH"
|
2020-10-07 22:00:55 +08:00
|
|
|
// GovernanceModeKubernetesNativeService means the governance mode is KUBERNETES_NATIVE_SERVICE
|
2020-11-07 10:11:33 +08:00
|
|
|
GovernanceModeKubernetesNativeService = "KUBERNETES_NATIVE_SERVICE"
|
2021-11-11 09:55:17 +08:00
|
|
|
// GovernanceModeIstioServiceMesh means the governance mode is ISTIO_SERVICE_MESH
|
|
|
|
GovernanceModeIstioServiceMesh = "ISTIO_SERVICE_MESH"
|
2020-10-07 22:00:55 +08:00
|
|
|
)
|
|
|
|
|
2021-04-19 17:34:56 +08:00
|
|
|
// app type
|
|
|
|
const (
|
|
|
|
AppTypeRainbond = "rainbond"
|
|
|
|
AppTypeHelm = "helm"
|
|
|
|
)
|
|
|
|
|
2020-09-17 15:45:46 +08:00
|
|
|
// Application -
|
|
|
|
type Application struct {
|
|
|
|
Model
|
2021-04-16 10:07:34 +08:00
|
|
|
EID string `gorm:"column:eid" json:"eid"`
|
|
|
|
TenantID string `gorm:"column:tenant_id" json:"tenant_id"`
|
|
|
|
AppName string `gorm:"column:app_name" json:"app_name"`
|
|
|
|
AppID string `gorm:"column:app_id" json:"app_id"`
|
2021-06-30 16:46:39 +08:00
|
|
|
AppType string `gorm:"column:app_type;default:'rainbond'" json:"app_type"`
|
2021-04-16 10:07:34 +08:00
|
|
|
AppStoreName string `gorm:"column:app_store_name" json:"app_store_name"`
|
|
|
|
AppStoreURL string `gorm:"column:app_store_url" json:"app_store_url"`
|
|
|
|
AppTemplateName string `gorm:"column:app_template_name" json:"app_template_name"`
|
2021-04-16 16:27:21 +08:00
|
|
|
Version string `gorm:"column:version" json:"version"`
|
2021-04-16 10:07:34 +08:00
|
|
|
GovernanceMode string `gorm:"column:governance_mode;default:'BUILD_IN_SERVICE_MESH'" json:"governance_mode"`
|
2020-09-17 15:45:46 +08:00
|
|
|
}
|
|
|
|
|
2020-09-21 13:58:08 +08:00
|
|
|
// TableName return tableName "application"
|
2020-09-17 15:45:46 +08:00
|
|
|
func (t *Application) TableName() string {
|
2020-10-07 22:00:55 +08:00
|
|
|
return "applications"
|
2020-09-17 15:45:46 +08:00
|
|
|
}
|
2020-09-21 18:33:10 +08:00
|
|
|
|
2020-11-13 09:42:17 +08:00
|
|
|
// ConfigGroupService -
|
|
|
|
type ConfigGroupService struct {
|
2020-09-22 14:37:52 +08:00
|
|
|
Model
|
2020-09-23 14:48:53 +08:00
|
|
|
AppID string `gorm:"column:app_id" json:"-"`
|
|
|
|
ConfigGroupName string `gorm:"column:config_group_name" json:"-"`
|
2020-09-22 14:37:52 +08:00
|
|
|
ServiceID string `gorm:"column:service_id" json:"service_id"`
|
2020-09-23 14:48:53 +08:00
|
|
|
ServiceAlias string `gorm:"column:service_alias" json:"service_alias"`
|
2020-09-22 14:37:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// TableName return tableName "application"
|
2020-11-13 09:42:17 +08:00
|
|
|
func (t *ConfigGroupService) TableName() string {
|
2020-09-23 14:48:53 +08:00
|
|
|
return "app_config_group_service"
|
2020-09-22 14:37:52 +08:00
|
|
|
}
|
|
|
|
|
2020-10-08 16:10:03 +08:00
|
|
|
// ConfigGroupItem -
|
|
|
|
type ConfigGroupItem struct {
|
2020-09-22 14:37:52 +08:00
|
|
|
Model
|
2020-09-24 10:05:54 +08:00
|
|
|
AppID string `gorm:"column:app_id" json:"-"`
|
|
|
|
ConfigGroupName string `gorm:"column:config_group_name" json:"-"`
|
2020-09-22 14:37:52 +08:00
|
|
|
ItemKey string `gorm:"column:item_key" json:"item_key"`
|
|
|
|
ItemValue string `gorm:"column:item_value" json:"item_value"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// TableName return tableName "application"
|
2020-10-08 16:10:03 +08:00
|
|
|
func (t *ConfigGroupItem) TableName() string {
|
2020-09-23 14:48:53 +08:00
|
|
|
return "app_config_group_item"
|
2020-09-21 18:33:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ApplicationConfigGroup -
|
|
|
|
type ApplicationConfigGroup struct {
|
|
|
|
Model
|
2020-09-22 14:37:52 +08:00
|
|
|
AppID string `gorm:"column:app_id" json:"app_id"`
|
|
|
|
ConfigGroupName string `gorm:"column:config_group_name" json:"config_group_name"`
|
|
|
|
DeployType string `gorm:"column:deploy_type;default:'env'" json:"deploy_type"`
|
2020-11-17 14:07:43 +08:00
|
|
|
Enable bool `gorm:"column:enable" json:"enable"`
|
2020-09-21 18:33:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// TableName return tableName "application"
|
|
|
|
func (t *ApplicationConfigGroup) TableName() string {
|
2020-09-23 14:48:53 +08:00
|
|
|
return "app_config_group"
|
2020-09-21 18:33:10 +08:00
|
|
|
}
|