Use ID types

This commit is contained in:
2022-11-20 22:18:24 +01:00
parent ca58aa782d
commit 0cc6e27267
23 changed files with 334 additions and 256 deletions

View File

@@ -15,8 +15,8 @@ const (
)
type Client struct {
ClientID int64
UserID int64
ClientID ClientID
UserID UserID
Type ClientType
FCMToken *string
TimestampCreated time.Time
@@ -37,8 +37,8 @@ func (c Client) JSON() ClientJSON {
}
type ClientJSON struct {
ClientID int64 `json:"client_id"`
UserID int64 `json:"user_id"`
ClientID ClientID `json:"client_id"`
UserID UserID `json:"user_id"`
Type ClientType `json:"type"`
FCMToken *string `json:"fcm_token"`
TimestampCreated string `json:"timestamp_created"`
@@ -47,8 +47,8 @@ type ClientJSON struct {
}
type ClientDB struct {
ClientID int64 `db:"client_id"`
UserID int64 `db:"user_id"`
ClientID ClientID `db:"client_id"`
UserID UserID `db:"user_id"`
Type ClientType `db:"type"`
FCMToken *string `db:"fcm_token"`
TimestampCreated int64 `db:"timestamp_created"`