feat(playlist): renames timespan to interval

This commit is contained in:
bergquist
2016-01-12 13:56:47 +01:00
parent d0bcd1d87c
commit e8786b0747
8 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ func GetPlaylist(c *middleware.Context) Response {
dto := &m.PlaylistDTO{
Id: cmd.Result.Id,
Title: cmd.Result.Title,
Timespan: cmd.Result.Timespan,
Interval: cmd.Result.Interval,
OrgId: cmd.Result.OrgId,
Items: playlistDTOs,
}
+4 -4
View File
@@ -14,14 +14,14 @@ var (
type Playlist struct {
Id int64 `json:"id"`
Title string `json:"title"`
Timespan string `json:"timespan"`
Interval string `json:"interval"`
OrgId int64 `json:"-"`
}
type PlaylistDTO struct {
Id int64 `json:"id"`
Title string `json:"title"`
Timespan string `json:"timespan"`
Interval string `json:"interval"`
OrgId int64 `json:"-"`
Items []PlaylistItemDTO `json:"items"`
}
@@ -83,7 +83,7 @@ type UpdatePlaylistQuery struct {
Id int64
Title string
Type string
Timespan string
Interval string
Items []PlaylistItemDTO
Result *PlaylistDTO
@@ -92,7 +92,7 @@ type UpdatePlaylistQuery struct {
type CreatePlaylistQuery struct {
Title string
Type string
Timespan string
Interval string
Data []int64
OrgId int64
Items []PlaylistItemDTO
@@ -8,7 +8,7 @@ func addPlaylistMigrations(mg *Migrator) {
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "timespan", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "interval", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
},
}
+3 -3
View File
@@ -23,7 +23,7 @@ func CreatePlaylist(query *m.CreatePlaylistQuery) error {
playlist := m.Playlist{
Title: query.Title,
Timespan: query.Timespan,
Interval: query.Interval,
OrgId: query.OrgId,
}
@@ -54,7 +54,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error {
playlist := m.Playlist{
Id: query.Id,
Title: query.Title,
Timespan: query.Timespan,
Interval: query.Interval,
}
existingPlaylist := x.Where("id = ?", query.Id).Find(m.Playlist{})
@@ -67,7 +67,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error {
Id: playlist.Id,
OrgId: playlist.OrgId,
Title: playlist.Title,
Timespan: playlist.Timespan,
Interval: playlist.Interval,
}
_, err = x.Id(query.Id).Cols("id", "title", "timespan").Update(&playlist)