mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
49 lines
799 B
Go
49 lines
799 B
Go
package models
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
ErrAppSettingNotFound = errors.New("AppSetting not found")
|
|
)
|
|
|
|
type AppSettings struct {
|
|
Id int64
|
|
AppId string
|
|
OrgId int64
|
|
Enabled bool
|
|
Pinned bool
|
|
JsonData map[string]interface{}
|
|
|
|
Created time.Time
|
|
Updated time.Time
|
|
}
|
|
|
|
// ----------------------
|
|
// COMMANDS
|
|
|
|
// Also acts as api DTO
|
|
type UpdateAppSettingsCmd struct {
|
|
Enabled bool `json:"enabled"`
|
|
Pinned bool `json:"pinned"`
|
|
JsonData map[string]interface{} `json:"jsonData"`
|
|
|
|
AppId string `json:"-"`
|
|
OrgId int64 `json:"-"`
|
|
}
|
|
|
|
// ---------------------
|
|
// QUERIES
|
|
type GetAppSettingsQuery struct {
|
|
OrgId int64
|
|
Result []*AppSettings
|
|
}
|
|
|
|
type GetAppSettingByAppIdQuery struct {
|
|
AppId string
|
|
OrgId int64
|
|
Result *AppSettings
|
|
}
|