Documentation
¶
Index ¶
- Variables
- type BaseModel
- type BlockoutConfig
- type DBClient
- func (client *DBClient) CreateOrg(org *Org) error
- func (client *DBClient) CreateOrgClusterRelation(relation *OrgClusterRelation) error
- func (client *DBClient) DeleteOrg(orgID int64) error
- func (client *DBClient) DeleteOrgClusterRelationByCluster(clusterName string) error
- func (client *DBClient) DeleteOrgClusterRelationByClusterAndOrg(clusterName string, orgID int64) error
- func (client *DBClient) GetOrg(orgID int64) (Org, error)
- func (client *DBClient) GetOrgByName(orgName string) (*Org, error)
- func (client *DBClient) GetOrgClusterRelationByOrgAndCluster(orgID, clusterID int64) (*OrgClusterRelation, error)
- func (client *DBClient) GetOrgClusterRelationsByCluster(clusterName string) ([]OrgClusterRelation, error)
- func (client *DBClient) GetOrgClusterRelationsByOrg(orgID int64) ([]OrgClusterRelation, error)
- func (client *DBClient) GetOrgList() ([]Org, error)
- func (client *DBClient) GetOrgsByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) (int, []Org, error)
- func (client *DBClient) GetOrgsByParam(name string, pageNum, pageSize int) (int, []Org, error)
- func (client *DBClient) GetOrgsByUserID(userID string) ([]Org, error)
- func (client *DBClient) GetPublicOrgsByParam(name string, pageNum, pageSize int) (int, []Org, error)
- func (client *DBClient) ListAllOrgClusterRelations() ([]OrgClusterRelation, error)
- func (client *DBClient) UpdateOrg(org *Org) error
- type Org
- type OrgClusterRelation
- type OrgConfig
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFoundOrg = errors.New("org not found")
)
Functions ¶
This section is empty.
Types ¶
type BaseModel ¶
type BaseModel struct {
ID int64 `json:"id" gorm:"primary_key"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
BaseModel common info for all models
type BlockoutConfig ¶
type BlockoutConfig struct {
BlockDEV bool `json:"blockDev"`
BlockTEST bool `json:"blockTest"`
BlockStage bool `json:"blockStage"`
BlockProd bool `json:"blockProd"`
}
func (*BlockoutConfig) Scan ¶
func (cfg *BlockoutConfig) Scan(value interface{}) error
type DBClient ¶
func (*DBClient) CreateOrgClusterRelation ¶
func (client *DBClient) CreateOrgClusterRelation(relation *OrgClusterRelation) error
CreateOrgClusterRelation 创建企业集群关系
func (*DBClient) DeleteOrgClusterRelationByCluster ¶
DeleteOrgClusterRelationByCluster 根据 clusterName 删除企业集群关联关系
func (*DBClient) DeleteOrgClusterRelationByClusterAndOrg ¶
func (client *DBClient) DeleteOrgClusterRelationByClusterAndOrg(clusterName string, orgID int64) error
DeleteOrgClusterRelationByClusterAndOrg 根据 clusterName、orgID 删除企业集群关联关系
func (*DBClient) GetOrgByName ¶
GetOrgByName 根据 orgName 获取企业信息
func (*DBClient) GetOrgClusterRelationByOrgAndCluster ¶
func (client *DBClient) GetOrgClusterRelationByOrgAndCluster(orgID, clusterID int64) (*OrgClusterRelation, error)
GetOrgClusterRelationByOrgAndCluster 获取企业集群关系
func (*DBClient) GetOrgClusterRelationsByCluster ¶
func (client *DBClient) GetOrgClusterRelationsByCluster(clusterName string) ([]OrgClusterRelation, error)
GetOrgClusterRelationsByCluster 根据 cluster_name 获取企业对应集群关系
func (*DBClient) GetOrgClusterRelationsByOrg ¶
func (client *DBClient) GetOrgClusterRelationsByOrg(orgID int64) ([]OrgClusterRelation, error)
GetOrgClusterRelationsByOrg 根据 orgID 获取企业对应集群关系
func (*DBClient) GetOrgList ¶
GetOrgList 获取所有企业列表(仅供内部用户使用)
func (*DBClient) GetOrgsByIDsAndName ¶
func (client *DBClient) GetOrgsByIDsAndName(orgIDs []int64, name string, pageNo, pageSize int) ( int, []Org, error)
GetOrgsByIDsAndName 根据企业ID列表 & 企业名称获取企业列表
func (*DBClient) GetOrgsByParam ¶
GetOrgsByParam 获取企业列表
func (*DBClient) GetOrgsByUserID ¶
GetOrgsByUserID 根据userID获取企业列表
func (*DBClient) GetPublicOrgsByParam ¶
func (client *DBClient) GetPublicOrgsByParam(name string, pageNum, pageSize int) (int, []Org, error)
GetPublicOrgsByParam Get public orgs list
func (*DBClient) ListAllOrgClusterRelations ¶
func (client *DBClient) ListAllOrgClusterRelations() ([]OrgClusterRelation, error)
ListAllOrgClusterRelations 获取所有企业对应集群关系
type Org ¶
type Org struct {
BaseModel
Name string
DisplayName string
Desc string
Logo string
Locale string
OpenFdp bool `json:"openFdp"`
UserID string `gorm:"column:creator"` // 所属用户Id
Config OrgConfig
BlockoutConfig BlockoutConfig
Type string
Status string // TODO deprecated 待admin下线后删除
IsPublic bool
}
Org 企业资源模型
type OrgClusterRelation ¶
type OrgClusterRelation struct {
BaseModel
OrgID uint64 `gorm:"unique_index:idx_org_cluster_id"`
OrgName string
ClusterID uint64 `gorm:"unique_index:idx_org_cluster_id"`
ClusterName string
Creator string
}
OrgClusterRelation 企业集群关联关系
func (OrgClusterRelation) TableName ¶
func (OrgClusterRelation) TableName() string
TableName 设置模型对应数据库表名称
type OrgConfig ¶
type OrgConfig struct {
EnablePersonalMessageEmail bool `json:"enablePersonalMessageEmail"`
EnableMS bool `json:"enableMs"`
SMTPHost string `json:"smtpHost"`
SMTPUser string `json:"smtpUser"`
SMTPPassword string `json:"smtpPassword"`
SMTPPort int64 `json:"smtpPort"`
SMTPIsSSL bool `json:"smtpIsSSL"`
SMSKeyID string `json:"smsKeyID"`
SMSKeySecret string `json:"smsKeySecret"`
SMSSignName string `json:"smsSignName"`
SMSMonitorTemplateCode string `json:"smsMonitorTemplateCode"` // 监控单独的短信模版
VMSKeyID string `json:"vmsKeyID"`
VMSKeySecret string `json:"vmsKeySecret"`
VMSMonitorTtsCode string `json:"vmsMonitorTtsCode"` // 监控单独的语音模版
VMSMonitorCalledShowNumber string `json:"vmsMonitorCalledShowNumber"` // 监控单独的被叫显号
AuditInterval int64 `json:"auditInterval"`
// 开关:制品是否可以跨集群部署
EnableReleaseCrossCluster bool `json:"enableReleaseCrossCluster"`
EnableAI bool `json:"enableAI"`
}