feat(docker): Add Dockerfile and compose file
This commit is contained in:
24
app/models/endpoint_group.go
Normal file
24
app/models/endpoint_group.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type EndpointGroup struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
GroupID uuid.UUID `gorm:"not null;uniqueIndex:idx_endpoint_group_group_id_endpoint_id" json:"group_id"`
|
||||
EndpointID uuid.UUID `gorm:"not null;uniqueIndex:idx_endpoint_group_group_id_endpoint_id" json:"endpoint_id"`
|
||||
CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
|
||||
|
||||
Group Group `gorm:"foreignKey:GroupID" json:"-"`
|
||||
Endpoint Endpoint `gorm:"foreignKey:EndpointID" json:"-"`
|
||||
}
|
||||
|
||||
func (EndpointGroup) TableName() string {
|
||||
return "endpoint_groups"
|
||||
}
|
||||
Reference in New Issue
Block a user