databasus--databasus
75f3dd141c
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CI and Release / lint-frontend (push) Has been cancelled
CI and Release / dockerfile-scan (push) Has been cancelled
CI and Release / test-frontend (push) Has been cancelled
CI and Release / lint-verification-agent (push) Has been cancelled
CI and Release / test-verification-agent (push) Has been cancelled
CI and Release / e2e-verification-agent (push) Has been cancelled
CI and Release / test-backend (push) Has been cancelled
CI and Release / build-dev-image (push) Has been cancelled
CI and Release / push-dev-image (push) Has been cancelled
CI and Release / build-image (push) Has been cancelled
CI and Release / build-verification-image (push) Has been cancelled
CI and Release / determine-version (push) Has been cancelled
CI and Release / push-image (push) Has been cancelled
CI and Release / push-verification-image (12) (push) Has been cancelled
CI and Release / lint-backend (push) Has been cancelled
CI and Release / push-verification-image (17) (push) Has been cancelled
CI and Release / push-verification-image (18) (push) Has been cancelled
CI and Release / release (push) Has been cancelled
CI and Release / publish-helm-chart (push) Has been cancelled
CI and Release / push-verification-image (13) (push) Has been cancelled
CI and Release / push-verification-image (14) (push) Has been cancelled
CI and Release / push-verification-image (15) (push) Has been cancelled
CI and Release / push-verification-image (16) (push) Has been cancelled
108 行
3.6 KiB
Go
108 行
3.6 KiB
Go
package users_dto
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
users_enums "databasus-backend/internal/features/users/enums"
|
|
)
|
|
|
|
type SignUpRequestDTO struct {
|
|
Email string `json:"email" binding:"required"`
|
|
Password string `json:"password" binding:"required,min=8"`
|
|
Name string `json:"name" binding:"required"`
|
|
CloudflareTurnstileToken *string `json:"cloudflareTurnstileToken"`
|
|
}
|
|
|
|
type SignInRequestDTO struct {
|
|
Email string `json:"email" binding:"required"`
|
|
Password string `json:"password" binding:"required"`
|
|
CloudflareTurnstileToken *string `json:"cloudflareTurnstileToken"`
|
|
}
|
|
|
|
type SignInResponseDTO struct {
|
|
UserID uuid.UUID `json:"userId"`
|
|
Email string `json:"email"`
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type SetAdminPasswordRequestDTO struct {
|
|
Password string `json:"password" binding:"required,min=8"`
|
|
}
|
|
|
|
type IsAdminHasPasswordResponseDTO struct {
|
|
HasPassword bool `json:"hasPassword"`
|
|
}
|
|
|
|
type ChangePasswordRequestDTO struct {
|
|
NewPassword string `json:"newPassword" binding:"required,min=8"`
|
|
}
|
|
|
|
type UpdateUserInfoRequestDTO struct {
|
|
Name *string `json:"name"`
|
|
Email *string `json:"email" binding:"omitempty,email"`
|
|
}
|
|
|
|
type InviteUserRequestDTO struct {
|
|
Email string `json:"email" binding:"required,email"`
|
|
IntendedWorkspaceID *uuid.UUID `json:"intendedWorkspaceId"`
|
|
IntendedWorkspaceRole *users_enums.WorkspaceRole `json:"intendedWorkspaceRole"`
|
|
}
|
|
|
|
type InviteUserResponseDTO struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Email string `json:"email"`
|
|
IntendedWorkspaceID *uuid.UUID `json:"intendedWorkspaceId"`
|
|
IntendedWorkspaceRole *users_enums.WorkspaceRole `json:"intendedWorkspaceRole"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type UserProfileResponseDTO struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
Role users_enums.UserRole `json:"role"`
|
|
IsActive bool `json:"isActive"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type ListUsersResponseDTO struct {
|
|
Users []UserProfileResponseDTO `json:"users"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
|
|
type ChangeUserRoleRequestDTO struct {
|
|
Role users_enums.UserRole `json:"role" binding:"required"`
|
|
}
|
|
|
|
type ListUsersRequestDTO struct {
|
|
Limit int `form:"limit" json:"limit"`
|
|
Offset int `form:"offset" json:"offset"`
|
|
BeforeDate *time.Time `form:"beforeDate" json:"beforeDate"`
|
|
Query string `form:"query" json:"query"`
|
|
}
|
|
|
|
type OAuthCallbackRequestDTO struct {
|
|
Code string `json:"code" binding:"required"`
|
|
RedirectUri string `json:"redirectUri" binding:"required"`
|
|
}
|
|
|
|
type OAuthCallbackResponseDTO struct {
|
|
UserID uuid.UUID `json:"userId"`
|
|
Email string `json:"email"`
|
|
Token string `json:"token"`
|
|
IsNewUser bool `json:"isNewUser"`
|
|
}
|
|
|
|
type SendResetPasswordCodeRequestDTO struct {
|
|
Email string `json:"email" binding:"required,email"`
|
|
CloudflareTurnstileToken *string `json:"cloudflareTurnstileToken"`
|
|
}
|
|
|
|
type ResetPasswordRequestDTO struct {
|
|
Email string `json:"email" binding:"required,email"`
|
|
Code string `json:"code" binding:"required"`
|
|
NewPassword string `json:"newPassword" binding:"required,min=8"`
|
|
}
|