78 lines
3.0 KiB
Go
78 lines
3.0 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"apskel-pos-be/internal/entities"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type UserDevice struct {
|
|
ID uuid.UUID `json:"id"`
|
|
UserID uuid.UUID `json:"user_id"`
|
|
DeviceID string `json:"device_id"`
|
|
DeviceName string `json:"device_name"`
|
|
DeviceType entities.DeviceType `json:"device_type"`
|
|
Platform entities.DevicePlatform `json:"platform"`
|
|
FCMToken string `json:"fcm_token"`
|
|
AppVersion string `json:"app_version"`
|
|
OsVersion string `json:"os_version"`
|
|
IPAddress string `json:"ip_address"`
|
|
LastActiveAt *time.Time `json:"last_active_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type UserDeviceResponse struct {
|
|
ID uuid.UUID `json:"id"`
|
|
UserID uuid.UUID `json:"user_id"`
|
|
DeviceID string `json:"device_id"`
|
|
DeviceName string `json:"device_name"`
|
|
DeviceType entities.DeviceType `json:"device_type"`
|
|
Platform entities.DevicePlatform `json:"platform"`
|
|
FCMToken string `json:"fcm_token"`
|
|
AppVersion string `json:"app_version"`
|
|
OsVersion string `json:"os_version"`
|
|
IPAddress string `json:"ip_address"`
|
|
LastActiveAt *time.Time `json:"last_active_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type RegisterUserDeviceRequest struct {
|
|
UserID uuid.UUID `json:"user_id"`
|
|
DeviceID string `json:"device_id"`
|
|
DeviceName string `json:"device_name"`
|
|
DeviceType entities.DeviceType `json:"device_type"`
|
|
Platform entities.DevicePlatform `json:"platform"`
|
|
FCMToken string `json:"fcm_token"`
|
|
AppVersion string `json:"app_version"`
|
|
OsVersion string `json:"os_version"`
|
|
IPAddress string `json:"ip_address"`
|
|
}
|
|
|
|
type UpdateUserDeviceRequest struct {
|
|
DeviceName string `json:"device_name"`
|
|
DeviceType entities.DeviceType `json:"device_type"`
|
|
Platform entities.DevicePlatform `json:"platform"`
|
|
FCMToken string `json:"fcm_token"`
|
|
AppVersion string `json:"app_version"`
|
|
OsVersion string `json:"os_version"`
|
|
}
|
|
|
|
type ListUserDevicesRequest struct {
|
|
Page int `json:"page"`
|
|
Limit int `json:"limit"`
|
|
UserID string `json:"user_id,omitempty"`
|
|
Platform string `json:"platform,omitempty"`
|
|
}
|
|
|
|
type ListUserDevicesResponse struct {
|
|
Devices []*UserDeviceResponse `json:"devices"`
|
|
TotalCount int `json:"total_count"`
|
|
Page int `json:"page"`
|
|
Limit int `json:"limit"`
|
|
TotalPages int `json:"total_pages"`
|
|
}
|