Protected POST /account and fixed with JWT stuff in general
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
)
|
||||
|
||||
// Account is an account as represented in the database
|
||||
type Account struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Created time.Time `json:"created"`
|
||||
Fields map[string][]string `json:"fields"`
|
||||
Name string `json:"name"`
|
||||
Password string `json:"-"`
|
||||
}
|
||||
|
||||
// CreatedAccount is a newly created account in the system
|
||||
type CreatedAccount struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
AccountName string `json:"accountName"`
|
||||
APIKey string `json:"apiKey"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
APIKey string `json:"apiKey"`
|
||||
}
|
||||
|
||||
// AccountCreateInputFields yes
|
||||
@@ -20,11 +31,11 @@ type AccountCreateInputFields struct {
|
||||
|
||||
// AccountCreateInput is used as input struct for database creation of account
|
||||
type AccountCreateInput struct {
|
||||
ID uuid.UUID
|
||||
AccountName string
|
||||
APIKey string
|
||||
Fields []AccountCreateInputFields
|
||||
Password string
|
||||
ID uuid.UUID
|
||||
Name string
|
||||
APIKey string
|
||||
Fields []AccountCreateInputFields
|
||||
Password string
|
||||
}
|
||||
|
||||
// Db struct
|
||||
|
||||
Reference in New Issue
Block a user