mirror of
https://github.com/twofas/2fas-server.git
synced 2024-12-12 20:20:19 +01:00
35 lines
491 B
Go
35 lines
491 B
Go
|
package domain
|
||
|
|
||
|
import (
|
||
|
"github.com/google/uuid"
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
Light string = "light"
|
||
|
Dark = "dark"
|
||
|
)
|
||
|
|
||
|
type Icon struct {
|
||
|
gorm.Model
|
||
|
|
||
|
Id uuid.UUID `gorm:"primarykey"`
|
||
|
Name string
|
||
|
Type string
|
||
|
Url string
|
||
|
Width int
|
||
|
Height int
|
||
|
}
|
||
|
|
||
|
func (Icon) TableName() string {
|
||
|
return "icons"
|
||
|
}
|
||
|
|
||
|
type IconsRepository interface {
|
||
|
Save(icon *Icon) error
|
||
|
Update(icon *Icon) error
|
||
|
Delete(icon *Icon) error
|
||
|
FindById(id uuid.UUID) (*Icon, error)
|
||
|
FindAll() []*Icon
|
||
|
}
|