Dawid Wysokiński
e6d15ac950
All checks were successful
continuous-integration/drone/push Build is passing
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitea.dwysokinski.me/twhelp/dcbot/internal/domain"
|
|
"github.com/google/uuid"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
type Group struct {
|
|
bun.BaseModel `bun:"base_model,table:groups,alias:group"`
|
|
|
|
ID uuid.UUID `bun:"id,pk,nullzero"`
|
|
ServerID string `bun:"server_id,nullzero"`
|
|
ChannelGains string `bun:"channel_gains,nullzero"`
|
|
ChannelLosses string `bun:"channel_losses,nullzero"`
|
|
Internals bool `bun:"internals"`
|
|
Barbarians bool `bun:"barbarians"`
|
|
ServerKey string `bun:"server_key,nullzero"`
|
|
VersionCode string `bun:"version_code,nullzero"`
|
|
CreatedAt time.Time `bun:"created_at,nullzero"`
|
|
}
|
|
|
|
func (g Group) ToDomain() domain.Group {
|
|
return domain.Group{
|
|
ID: g.ID.String(),
|
|
ServerID: g.ServerID,
|
|
ChannelGains: g.ChannelGains,
|
|
ChannelLosses: g.ChannelLosses,
|
|
Internals: g.Internals,
|
|
Barbarians: g.Barbarians,
|
|
ServerKey: g.ServerKey,
|
|
VersionCode: g.VersionCode,
|
|
CreatedAt: g.CreatedAt,
|
|
}
|
|
}
|