refactor(backend/domain): get rid of pgx types
This commit is contained in:
@@ -3,8 +3,6 @@ package domain
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@@ -29,17 +27,17 @@ type (
|
||||
}
|
||||
CategoryFull struct {
|
||||
CategoryCore
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes pgtype.Text `json:"notes"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes *string `json:"notes"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
FileCore struct {
|
||||
ID string `json:"id"`
|
||||
Name pgtype.Text `json:"name"`
|
||||
MIME MIME `json:"mime"`
|
||||
ID string `json:"id"`
|
||||
Name *string `json:"name"`
|
||||
MIME MIME `json:"mime"`
|
||||
}
|
||||
FileItem struct {
|
||||
FileCore
|
||||
@@ -50,7 +48,7 @@ type (
|
||||
FileCore
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes pgtype.Text `json:"notes"`
|
||||
Notes *string `json:"notes"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
Viewed int `json:"viewed"`
|
||||
}
|
||||
@@ -58,9 +56,9 @@ type (
|
||||
|
||||
type (
|
||||
TagCore struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Color pgtype.Text `json:"color"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Color *string `json:"color"`
|
||||
}
|
||||
TagItem struct {
|
||||
TagCore
|
||||
@@ -71,7 +69,7 @@ type (
|
||||
Category CategoryCore `json:"category"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes pgtype.Text `json:"notes"`
|
||||
Notes *string `json:"notes"`
|
||||
UsedIncl int `json:"usedIncl"`
|
||||
UsedExcl int `json:"usedExcl"`
|
||||
}
|
||||
@@ -93,10 +91,10 @@ type (
|
||||
}
|
||||
PoolFull struct {
|
||||
PoolCore
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes pgtype.Text `json:"notes"`
|
||||
Viewed int `json:"viewed"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Creator User `json:"creator"`
|
||||
Notes *string `json:"notes"`
|
||||
Viewed int `json:"viewed"`
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user