2024-08-11 03:51:22 +02:00
|
|
|
package api_schema
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/google/uuid"
|
2024-08-20 22:43:26 +02:00
|
|
|
"github.com/lysand-org/versia-go/pkg/lysand"
|
2024-08-11 03:51:22 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
|
ID uuid.UUID `json:"id,string"`
|
|
|
|
|
Username string `json:"username"`
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-20 22:43:26 +02:00
|
|
|
type LysandUser lysand.User
|
|
|
|
|
|
2024-08-11 03:51:22 +02:00
|
|
|
type FetchUserResponse = APIResponse[User]
|
|
|
|
|
|
|
|
|
|
type CreateUserRequest struct {
|
2024-08-20 22:43:26 +02:00
|
|
|
Username string `json:"username" validate:"required,username_regex,min=1,max=32"`
|
2024-08-11 03:51:22 +02:00
|
|
|
Password string `json:"password" validate:"required,min=8,max=256"`
|
|
|
|
|
}
|
2024-08-20 22:43:26 +02:00
|
|
|
|
|
|
|
|
type SearchUserRequest struct {
|
|
|
|
|
Username string `query:"username" validate:"required,username_regex,min=1,max=32"`
|
|
|
|
|
Domain *string `query:"domain" validate:"domain_regex"`
|
|
|
|
|
}
|