mirror of
https://github.com/versia-pub/versia-go.git
synced 2026-03-13 04:29:15 +01:00
refactor!: add missing fields and docs
This commit is contained in:
parent
61891d891a
commit
6e59386f60
73 changed files with 726 additions and 580 deletions
|
|
@ -1,14 +1,13 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/mixin"
|
||||
"github.com/google/uuid"
|
||||
"github.com/lysand-org/versia-go/pkg/lysand"
|
||||
"github.com/lysand-org/versia-go/pkg/versia"
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
type LysandEntityMixin struct{ mixin.Schema }
|
||||
|
|
@ -23,7 +22,7 @@ func (LysandEntityMixin) Fields() []ent.Field {
|
|||
field.Bool("isRemote"),
|
||||
field.String("uri").Validate(ValidateURI),
|
||||
|
||||
field.JSON("extensions", lysand.Extensions{}).Default(lysand.Extensions{}),
|
||||
field.JSON("extensions", versia.Extensions{}).Default(versia.Extensions{}),
|
||||
|
||||
field.Time("created_at").
|
||||
Immutable().
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"regexp"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/lysand-org/versia-go/pkg/lysand"
|
||||
"errors"
|
||||
"github.com/lysand-org/versia-go/pkg/versia"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -45,7 +44,7 @@ func (User) Fields() []ent.Field {
|
|||
Values("public", "restricted", "private").
|
||||
Default("public"),
|
||||
|
||||
field.JSON("fields", []lysand.Field{}).Default([]lysand.Field{}),
|
||||
field.JSON("fields", []versia.UserField{}).Default([]versia.UserField{}),
|
||||
|
||||
field.String("inbox").Validate(ValidateURI),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue