app_settings.go 799 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package models
  2. import (
  3. "errors"
  4. "time"
  5. )
  6. var (
  7. ErrAppSettingNotFound = errors.New("AppSetting not found")
  8. )
  9. type AppSettings struct {
  10. Id int64
  11. AppId string
  12. OrgId int64
  13. Enabled bool
  14. Pinned bool
  15. JsonData map[string]interface{}
  16. Created time.Time
  17. Updated time.Time
  18. }
  19. // ----------------------
  20. // COMMANDS
  21. // Also acts as api DTO
  22. type UpdateAppSettingsCmd struct {
  23. Enabled bool `json:"enabled"`
  24. Pinned bool `json:"pinned"`
  25. JsonData map[string]interface{} `json:"jsonData"`
  26. AppId string `json:"-"`
  27. OrgId int64 `json:"-"`
  28. }
  29. // ---------------------
  30. // QUERIES
  31. type GetAppSettingsQuery struct {
  32. OrgId int64
  33. Result []*AppSettings
  34. }
  35. type GetAppSettingByAppIdQuery struct {
  36. AppId string
  37. OrgId int64
  38. Result *AppSettings
  39. }