mirror of
https://github.com/versia-pub/versia-go.git
synced 2025-12-06 06:28:18 +01:00
chore: remove uses of Lysand
This commit is contained in:
parent
6e59386f60
commit
9cac88861a
|
|
@ -38,5 +38,5 @@ func (Attachment) Edges() []ent.Edge {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Attachment) Mixin() []ent.Mixin {
|
func (Attachment) Mixin() []ent.Mixin {
|
||||||
return []ent.Mixin{LysandEntityMixin{}}
|
return []ent.Mixin{VersiaEntityMixin{}}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,5 @@ func (Follow) Indexes() []ent.Index {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Follow) Mixin() []ent.Mixin {
|
func (Follow) Mixin() []ent.Mixin {
|
||||||
return []ent.Mixin{LysandEntityMixin{}}
|
return []ent.Mixin{VersiaEntityMixin{}}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,5 +67,5 @@ func (InstanceMetadata) Edges() []ent.Edge {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (InstanceMetadata) Mixin() []ent.Mixin {
|
func (InstanceMetadata) Mixin() []ent.Mixin {
|
||||||
return []ent.Mixin{LysandEntityMixin{}}
|
return []ent.Mixin{VersiaEntityMixin{}}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LysandEntityMixin struct{ mixin.Schema }
|
type VersiaEntityMixin struct{ mixin.Schema }
|
||||||
|
|
||||||
var _ ent.Mixin = (*LysandEntityMixin)(nil)
|
var _ ent.Mixin = (*VersiaEntityMixin)(nil)
|
||||||
|
|
||||||
func (LysandEntityMixin) Fields() []ent.Field {
|
func (VersiaEntityMixin) Fields() []ent.Field {
|
||||||
return []ent.Field{
|
return []ent.Field{
|
||||||
field.UUID("id", uuid.UUID{}).
|
field.UUID("id", uuid.UUID{}).
|
||||||
Default(uuid.New).
|
Default(uuid.New).
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,5 @@ func (Note) Edges() []ent.Edge {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Note) Mixin() []ent.Mixin {
|
func (Note) Mixin() []ent.Mixin {
|
||||||
return []ent.Mixin{LysandEntityMixin{}}
|
return []ent.Mixin{VersiaEntityMixin{}}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ func (User) Edges() []ent.Edge {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (User) Mixin() []ent.Mixin { return []ent.Mixin{LysandEntityMixin{}} }
|
func (User) Mixin() []ent.Mixin { return []ent.Mixin{VersiaEntityMixin{}} }
|
||||||
|
|
||||||
func ValidateUsername(username string) error {
|
func ValidateUsername(username string) error {
|
||||||
if !usernameRegex.MatchString(username) {
|
if !usernameRegex.MatchString(username) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ type User struct {
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LysandUser versia.User
|
type VersiaUser versia.User
|
||||||
|
|
||||||
type FetchUserResponse = APIResponse[User]
|
type FetchUserResponse = APIResponse[User]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,5 @@ func (i *Handler) SearchUser(c *fiber.Ctx) error {
|
||||||
return api_schema.ErrInternalServerError(nil)
|
return api_schema.ErrInternalServerError(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.JSON((*api_schema.LysandUser)(u.ToLysand()))
|
return c.JSON((*api_schema.VersiaUser)(u.ToLysand()))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue