dto

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminActionResponse

type AdminActionResponse struct {
	Success    bool   `json:"success"`
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
}

Admin Management DTOs

type ApologyEmailRequest

type ApologyEmailRequest struct {
	Users []map[string]string `json:"users" binding:"required"`
}

type AuthErrorResponse

type AuthErrorResponse struct {
	Error        string      `json:"error,omitempty"`
	Success      bool        `json:"success"`
	StatusCode   int         `json:"status_code"`
	ErrorMessage string      `json:"error_message,omitempty"`
	Errors       interface{} `json:"errors,omitempty"`
}

Generic Auth Error Response

type BulkEmailRequest

type BulkEmailRequest struct {
	UserIDs []string `json:"user_ids" binding:"required"`
	Subject string   `json:"subject" binding:"required"`
	Content string   `json:"content" binding:"required"`
}

type ChangePasswordRequest

type ChangePasswordRequest struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required,min=8"`
}

Change Password DTOs (Django's ChangeUserPasswordSerializer equivalent)

type ChangePasswordResponse

type ChangePasswordResponse struct {
	Success      bool        `json:"success"`
	StatusCode   int         `json:"status_code"`
	Message      string      `json:"message,omitempty"`
	ErrorMessage string      `json:"error_message,omitempty"`
	Data         interface{} `json:"data,omitempty"`
}

type DeleteAccountResponse

type DeleteAccountResponse struct {
	Detail string `json:"detail"`
}

Delete Account Response

type ErrorResponse added in v0.2.4

type ErrorResponse struct {
	Code    string      `json:"code"`
	Message string      `json:"message"`
	Meta    interface{} `json:"meta,omitempty"`
}

type GetUsersResponse

type GetUsersResponse struct {
	Success    bool        `json:"success"`
	StatusCode int         `json:"status_code"`
	Data       []*UserData `json:"data"`
	Count      int         `json:"count"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" binding:"required,email"`
	Password string `json:"password" binding:"required"`
}

Login DTOs (Django's UserLoginSerializer equivalent)

type LoginResponse

type LoginResponse struct {
	Message      string `json:"message,omitempty"`
	UserID       string `json:"user_id,omitempty"`
	UserEmail    string `json:"user_email,omitempty"`
	Token        string `json:"token,omitempty"`
	StatusCode   int    `json:"status_code"`
	Success      bool   `json:"success,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
}

type LogoutResponse

type LogoutResponse struct {
	Message    string `json:"message"`
	Success    bool   `json:"success"`
	StatusCode int    `json:"status_code"`
}

Logout Response

type PasswordResetConfirmRequest

type PasswordResetConfirmRequest struct {
	Token       string `json:"token" binding:"required"`
	NewPassword string `json:"new_password" binding:"required,min=8"`
}

type PasswordResetConfirmResponse

type PasswordResetConfirmResponse struct {
	Message    string      `json:"message"`
	Success    bool        `json:"success"`
	StatusCode int         `json:"status_code"`
	Data       interface{} `json:"data,omitempty"`
}

type PasswordResetRequest

type PasswordResetRequest struct {
	Email string `json:"email" binding:"required,email"`
}

Password Reset DTOs

type PasswordResetResponse

type PasswordResetResponse struct {
	Message    string      `json:"message"`
	Success    bool        `json:"success"`
	StatusCode int         `json:"status_code"`
	Data       interface{} `json:"data,omitempty"`
}

type RegistrationRequest

type RegistrationRequest struct {
	Username  string `json:"username" binding:"required"`
	Email     string `json:"email" binding:"required,email"`
	FirstName string `json:"first_name" binding:"required"`
	LastName  string `json:"last_name" binding:"required"`
	Password  string `json:"password" binding:"required,min=8"`
}

Registration DTOs (Django's RegistrationSerializer equivalent)

type RegistrationResponse

type RegistrationResponse struct {
	Response     string    `json:"response"`
	Success      bool      `json:"success"`
	StatusCode   int       `json:"status_code"`
	Data         *UserData `json:"data,omitempty"`
	UserID       string    `json:"user_id,omitempty"`
	Token        string    `json:"token,omitempty"`
	DateJoined   time.Time `json:"date_joined,omitempty"`
	IsVerified   bool      `json:"is_verified,omitempty"`
	ErrorMessage string    `json:"error_message,omitempty"`
}

type ResendOTPRequest

type ResendOTPRequest struct {
	Email string `json:"email" binding:"required,email"`
}

Resend OTP DTOs (Django's ResendOTPSerializer equivalent)

type ResendOTPResponse

type ResendOTPResponse struct {
	Message    string      `json:"message"`
	Sent       bool        `json:"sent"`
	StatusCode int         `json:"status_code"`
	Data       interface{} `json:"data"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	Username  string  `json:"username,omitempty"`
	FirstName string  `json:"first_name,omitempty"`
	LastName  string  `json:"last_name,omitempty"`
	Height    float64 `json:"height,omitempty" binding:"min=0"`
	Weight    float64 `json:"weight,omitempty" binding:"min=0"`
}

User Management DTOs

type UpdateUserResponse

type UpdateUserResponse struct {
	Success    bool      `json:"success"`
	StatusCode int       `json:"status_code"`
	Message    string    `json:"message"`
	Data       *UserData `json:"data"`
}

type UserData

type UserData struct {
	ID              string     `json:"id"`
	Username        string     `json:"username"`
	Email           string     `json:"email"`
	FirstName       string     `json:"first_name"`
	LastName        string     `json:"last_name"`
	IsActive        bool       `json:"is_active"`
	IsVerified      bool       `json:"is_verified"`
	DateJoined      time.Time  `json:"date_joined"`
	LastLogin       *time.Time `json:"last_login"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
	ProfileImageURL string     `json:"profile_image_url,omitempty"`
}

User Data DTOs (Django's UserSerializer equivalent)

type UserProfileResponse

type UserProfileResponse struct {
	Success    bool      `json:"success"`
	StatusCode int       `json:"status_code"`
	Data       *UserData `json:"data"`
}

type UserResponse added in v0.2.4

type UserResponse struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Email    string `json:"email"`
	FullName string `json:"full_name,omitempty"`
}

type UserStatsResponse

type UserStatsResponse struct {
	Success    bool                   `json:"success"`
	StatusCode int                    `json:"status_code"`
	Data       map[string]interface{} `json:"data"`
}

type VerifyOTPRequest

type VerifyOTPRequest struct {
	Email string `json:"email" binding:"required,email"`
	OTP   string `json:"otp" binding:"required,len=6"`
}

OTP Verification DTOs (Django's VerifyUserSerializer equivalent)

type VerifyOTPResponse

type VerifyOTPResponse struct {
	Success      bool        `json:"success"`
	Code         int         `json:"code"`
	Message      string      `json:"message,omitempty"`
	Extra        string      `json:"extra,omitempty"`
	Data         interface{} `json:"data,omitempty"`
	ErrorMessage string      `json:"error_message,omitempty"`
	Status       int         `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL