devicemngmt_old/model.go

72 lines
1.9 KiB
Go
Raw Permalink Normal View History

2021-08-17 04:03:50 +00:00
package devicemngt
2021-08-21 12:49:54 +00:00
import (
"time"
"github.com/lib/pq"
)
2021-08-17 04:03:50 +00:00
// Device ...
type Device struct {
ID string `db:"id"`
DeviceID string `db:"device_id"`
IP string `db:"ip"`
Platform string `db:"platform"`
OSName string `db:"os_name"`
OSVersion string `db:"os_version"`
AppVersion string `db:"app_version"`
AppVersionCode string `db:"app_version_code"`
2021-08-17 04:03:50 +00:00
BrowserName string `db:"browser_name"`
BrowserVersion string `db:"browser_version"`
AuthToken string `db:"auth_token"`
FCMToken string `db:"fcm_token"`
OwnerID string `db:"owner_id"`
OwnerType string `db:"owner_type"`
FirstSignInAt time.Time `db:"first_sign_in_at"`
LastActivityAt time.Time `db:"last_activity_at"`
}
// ResponseDevice ...
type ResponseDevice struct {
ID string `json:"id"`
IP string `json:"ip"`
Platform string `json:"platform"`
OS ResponseOS `json:"os"`
Browser ResponseBrowser `json:"browser"`
FCMToken string `json:"fcmToken"`
FirstSignInAt string `json:"firstSignInAt"`
}
// ResponseOS ...
type ResponseOS struct {
Name string `json:"name"`
Version string `json:"version"`
}
// ResponseBrowser ...
type ResponseBrowser struct {
Name string `json:"name"`
Version string `json:"version"`
}
2021-08-19 08:06:39 +00:00
// HeaderData ...
type HeaderData struct {
UserAgent string
DeviceID string
AppVersion string
AppVersionCode string
OSName string
OSVersion string
2021-08-19 08:51:09 +00:00
AuthToken string
2021-08-19 08:06:39 +00:00
}
2021-08-21 12:28:09 +00:00
2021-08-21 12:38:43 +00:00
// StaffPermissions ...
type StaffPermissions struct {
2021-08-21 12:49:54 +00:00
ID string `db:"id"`
Name string `db:"name"`
Permissions pq.StringArray `db:"permissions"`
AccountType string `db:"account_type"`
Active bool `db:"active"`
DeviceID string `db:"device_id"`
2021-08-21 12:28:09 +00:00
}