domain

package
v0.0.0-...-2c51fd6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        string    `gorm:"primaryKey; type:varchar(36); not null"`
	CreatedAt time.Time `gorm:"type:datetime; not null; comment:创建时间"`
	UpdatedAt time.Time `gorm:"type:datetime; not null; comment:更新时间"`
}

func (*BaseModel) BeforeCreate

func (m *BaseModel) BeforeCreate(tx *gorm.DB) (err error)

type Component

type Component struct {
	BaseModel
	Name        string                 `gorm:"type:varchar(100); not null; comment:名称"`
	Description string                 `gorm:"type:text; comment:描述"`
	Lifecycle   Lifecycle              `gorm:"type:varchar(20); not null; comment:生命周期"`
	Type        ComponentType          `gorm:"type:varchar(20); not null; comment:类型"`
	Tier        Tier                   `gorm:"type:varchar(20); not null; comment:等级"`
	OwnerID     string                 `gorm:"type:varchar(36); not null; comment:拥有者ID"`
	Tags        []string               `gorm:"column:tags; type:json; serializer:json; comment:标签"`
	Links       []Link                 `gorm:"column:links; type:json; serializer:json; comment:链接"`
	Annotations map[string]interface{} `gorm:"column:annotations; type:json; serializer:json; comment:注释"`
}

func (Component) TableName

func (Component) TableName() string

type ComponentComponent

type ComponentComponent struct {
	BaseModel
	SourceID string `gorm:"type:varchar(36); not null; comment:来源组件ID"`
	TargetID string `gorm:"type:varchar(36); not null; comment:目标组件ID"`
}

func (ComponentComponent) TableName

func (ComponentComponent) TableName() string

type ComponentFilter

type ComponentFilter struct {
	ComponentIDs []string      `json:"componentIDs,omitempty"`
	Keywords     string        `json:"keywords,omitempty"`
	Type         ComponentType `json:"type,omitempty"`
	Lifecycle    Lifecycle     `json:"lifecycle,omitempty"`
	TeamID       string        `json:"teamID,omitempty"`
	Tier         Tier          `json:"tier,omitempty"`
	Tags         []string      `json:"tags,omitempty"`
}

type ComponentType

type ComponentType string
const (
	// Service 服务
	Service ComponentType = "service"
	// Library 库
	Library ComponentType = "library"
	// Website 网站
	Website ComponentType = "website"
)

type Direction

type Direction string
const (
	Asc  Direction = "ASC"
	Desc Direction = "DESC"
)

type Lifecycle

type Lifecycle string
const (
	// Stable 稳定
	Stable Lifecycle = "stable"
	// Alpha 实验
	Alpha Lifecycle = "alpha"
	// Destroy 销毁
	Destroy Lifecycle = "destroy"
)
type Link struct {
	URL   string
	Type  LinkType
	Title string
}

type LinkType

type LinkType string
const (
	// Doc 文档
	Doc LinkType = "doc"
	// Home 网站
	Home LinkType = "home"
	// Repository 仓库
	Repository LinkType = "repository"
)

type PageQuery

type PageQuery struct {
	Page int32 `json:"page"`
	Size int32 `json:"size"`
}

func (*PageQuery) GetLimit

func (pagination *PageQuery) GetLimit() int

func (*PageQuery) GetOffset

func (pagination *PageQuery) GetOffset() int

type Role

type Role string
const (
	Admin  Role = "admin"
	Member Role = "member"
)

type SortQuery

type SortQuery struct {
	Field     string    `json:"field"`
	Direction Direction `json:"direction"`
}

type Team

type Team struct {
	BaseModel
	Name        string `gorm:"type:varchar(100); not null; comment:名称"`
	Description string `gorm:"type:text; comment:描述"`
}

func (Team) TableName

func (Team) TableName() string

type TeamFilter

type TeamFilter struct {
}

type TeamUser

type TeamUser struct {
	BaseModel
	TeamID string `gorm:"type:varchar(36); not null; comment:团队ID"`
	UserID string `gorm:"type:varchar(36); not null; comment:用户ID"`
}

func (TeamUser) TableName

func (TeamUser) TableName() string

type Tier

type Tier string
const (
	Tier1 Tier = "tier1"
	Tier2 Tier = "tier2"
	Tier3 Tier = "tier3"
	Tier4 Tier = "tier4"
)

type User

type User struct {
	BaseModel
	Name        string `gorm:"type:varchar(100); not null; comment:名称"`
	Description string `gorm:"type:text; comment:描述"`
	Avatar      string `gorm:"type: varchar(255); comment:头像"`
	GithubID    string `gorm:"type:varchar(100); comment:githubID"`
	Role        Role   `gorm:"type:varchar(20); not null; comment:角色"`
}

func (User) TableName

func (User) TableName() string

type UserFilter

type UserFilter struct {
}

Jump to

Keyboard shortcuts

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