star.go 601 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package models
  2. import "errors"
  3. var ErrCommandValidationFailed = errors.New("Command missing required fields")
  4. type Star struct {
  5. Id int64
  6. UserId int64
  7. DashboardId int64
  8. }
  9. // ----------------------
  10. // COMMANDS
  11. type StarDashboardCommand struct {
  12. UserId int64
  13. DashboardId int64
  14. }
  15. type UnstarDashboardCommand struct {
  16. UserId int64
  17. DashboardId int64
  18. }
  19. // ---------------------
  20. // QUERIES
  21. type GetUserStarsQuery struct {
  22. UserId int64
  23. Result map[int64]bool // dashboard ids
  24. }
  25. type IsStarredByUserQuery struct {
  26. UserId int64
  27. DashboardId int64
  28. Result bool
  29. }