mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Playlist: update service so it supports both read+write (#55959)
This commit is contained in:
@@ -22,20 +22,17 @@ type Playlist struct {
|
||||
OrgId int64 `json:"-" db:"org_id"`
|
||||
}
|
||||
|
||||
type PlaylistDTO struct {
|
||||
playlist.Model
|
||||
OrgId int64 `json:"-"`
|
||||
}
|
||||
|
||||
type PlaylistDTO = playlist.Model
|
||||
type PlaylistItemDTO = playlist.PlaylistItem
|
||||
type PlaylistItemType = playlist.PlaylistItemType
|
||||
|
||||
type PlaylistItem struct {
|
||||
Id int64 `db:"id"`
|
||||
PlaylistId int64 `db:"playlist_id"`
|
||||
Type string `db:"type"`
|
||||
Value string `db:"value"`
|
||||
Order int `db:"order"`
|
||||
Title string `db:"title"`
|
||||
Type string `json:"type" db:"type"`
|
||||
Value string `json:"value" db:"value"`
|
||||
Order int `json:"order" db:"order"`
|
||||
Title string `json:"title" db:"title"`
|
||||
}
|
||||
|
||||
type Playlists []*Playlist
|
||||
@@ -45,18 +42,18 @@ type Playlists []*Playlist
|
||||
//
|
||||
|
||||
type UpdatePlaylistCommand struct {
|
||||
OrgId int64 `json:"-"`
|
||||
UID string `json:"uid"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Interval string `json:"interval"`
|
||||
Items []PlaylistItemDTO `json:"items"`
|
||||
OrgId int64 `json:"-"`
|
||||
UID string `json:"uid"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Interval string `json:"interval"`
|
||||
Items []PlaylistItem `json:"items"`
|
||||
}
|
||||
|
||||
type CreatePlaylistCommand struct {
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Interval string `json:"interval"`
|
||||
Items []PlaylistItemDTO `json:"items"`
|
||||
OrgId int64 `json:"-"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Interval string `json:"interval"`
|
||||
Items []PlaylistItem `json:"items"`
|
||||
OrgId int64 `json:"-"`
|
||||
}
|
||||
|
||||
type DeletePlaylistCommand struct {
|
||||
@@ -69,6 +66,7 @@ type DeletePlaylistCommand struct {
|
||||
//
|
||||
|
||||
type GetPlaylistsQuery struct {
|
||||
// NOTE: the frontend never sends this query
|
||||
Name string
|
||||
Limit int
|
||||
OrgId int64
|
||||
|
||||
Reference in New Issue
Block a user