You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
settings/model.go

45 lines
1.3 KiB
Go

package settings
import (
"encoding/json"
"time"
"github.com/google/uuid"
)
type Setting struct {
Id uuid.UUID `json:"id,omitempty"`
Service string `json:"service,omitempty"`
OwnerID uuid.UUID `json:"ownerId,omitempty"`
Name string `json:"name,omitempty"`
Content json.RawMessage `json:"content,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
type CreateRequest struct {
Service string `json:"service,omitempty"`
OwnerId string `json:"ownerId,omitempty"`
Name string `json:"name,omitempty"`
Content []byte `json:"content,omitempty"`
RolesRead []string `json:"rolesRead,omitempty"`
RolesUpdate []string `json:"rolesUpdate,omitempty"`
}
type UpdateRequest struct {
Id uuid.UUID `json:"id,omitempty"`
Content []byte `json:"content,omitempty"`
}
type UpsertRequest struct {
// For the Update Selector only
Id uuid.UUID `json:"id,omitempty"`
OwnerId uuid.UUID `json:"ownerId,omitempty"`
Service string `json:"service,omitempty"`
Name string `json:"name,omitempty"`
// Upsert content
Content []byte `json:"content,omitempty"`
RolesRead []string `json:"rolesRead,omitempty"`
RolesUpdate []string `json:"rolesUpdate,omitempty"`
}