grafana/pkg/models/preferences.go

55 lines
892 B
Go
Raw Normal View History

2016-03-06 05:15:49 +08:00
package models
import (
"errors"
"time"
2016-03-06 05:15:49 +08:00
)
// Typed errors
var (
ErrPreferencesNotFound = errors.New("Preferences not found")
2016-03-06 05:15:49 +08:00
)
2016-03-06 19:47:39 +08:00
type Preferences struct {
Id int64
OrgId int64
UserId int64
2018-11-13 03:01:53 +08:00
TeamId int64
Version int
HomeDashboardId int64
Timezone string
Theme string
Created time.Time
Updated time.Time
2016-03-06 05:15:49 +08:00
}
2016-03-07 03:42:15 +08:00
// ---------------------
// QUERIES
type GetPreferencesQuery struct {
2016-03-11 22:30:05 +08:00
Id int64
OrgId int64
UserId int64
2018-11-13 03:01:53 +08:00
TeamId int64
2016-03-07 03:42:15 +08:00
Result *Preferences
2016-03-07 03:42:15 +08:00
}
type GetPreferencesWithDefaultsQuery struct {
2018-11-13 03:01:53 +08:00
User *SignedInUser
Result *Preferences
}
2016-03-06 05:15:49 +08:00
// ---------------------
// COMMANDS
2016-03-06 19:47:39 +08:00
type SavePreferencesCommand struct {
UserId int64
OrgId int64
2018-11-13 03:01:53 +08:00
TeamId int64
2016-03-07 03:42:15 +08:00
2016-03-17 14:35:06 +08:00
HomeDashboardId int64 `json:"homeDashboardId"`
Timezone string `json:"timezone"`
Theme string `json:"theme"`
2016-03-07 03:42:15 +08:00
}