2015-02-02 04:32:32 -06:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "errors"
|
|
|
|
|
|
|
|
var ErrCommandValidationFailed = errors.New("Command missing required fields")
|
|
|
|
|
|
|
|
type Star struct {
|
|
|
|
Id int64
|
|
|
|
UserId int64
|
|
|
|
DashboardId int64
|
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------
|
|
|
|
// COMMANDS
|
|
|
|
|
|
|
|
type StarDashboardCommand struct {
|
|
|
|
UserId int64
|
|
|
|
DashboardId int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type UnstarDashboardCommand struct {
|
|
|
|
UserId int64
|
|
|
|
DashboardId int64
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------
|
|
|
|
// QUERIES
|
|
|
|
|
|
|
|
type GetUserStarsQuery struct {
|
|
|
|
UserId int64
|
|
|
|
|
2015-02-05 02:49:00 -06:00
|
|
|
Result map[int64]bool // dashboard ids
|
2015-02-02 04:32:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
type IsStarredByUserQuery struct {
|
|
|
|
UserId int64
|
|
|
|
DashboardId int64
|
|
|
|
|
|
|
|
Result bool
|
|
|
|
}
|