models

package
v0.0.0-...-d8ec886 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTaskScheme

type CreateTaskScheme struct {
	User      string `json:"user" bson:"user" binding:"required"`
	Text      string `json:"text" bson:"text" binding:"required"`
	VoiceType string `json:"voice_type,omitempty" bson:"voice_type"`
	IsSSML    bool   `json:"is_ssml,omitempty" bson:"is_ssml"`
}

func NewTask

func NewTask(user string, text string, voiceType string, isSSML bool, taskUuid uuid.UUID) *CreateTaskScheme

type DBTaskScheme

type DBTaskScheme struct {
	// CreateTaskScheme
	User      string    `bson:"user"`
	Text      string    `bson:"text"`
	VoiceType string    `bson:"voice_type"`
	IsSSML    bool      `bson:"is_ssml"`
	TaskUuid  uuid.UUID `bson:"task_uuid"`
	// InsertTaskScheme
	CreatedAt   time.Time `bson:"created_at"`
	UpdatedAt   time.Time `bson:"updated_at"`
	Completed   bool      `bson:"completed"`
	DownloadUrl string    `bson:"download_url"`
	// new fields
	ID primitive.ObjectID `bson:"_id"`
}

func (*DBTaskScheme) ToTaskResponse

func (t *DBTaskScheme) ToTaskResponse() *GetTaskSchemeResponse

type DBUserResponse

type DBUserResponse struct {
	ID                 primitive.ObjectID `json:"id" bson:"_id"`
	Name               string             `json:"name" bson:"name"`
	Email              string             `json:"email" bson:"email"`
	Password           string             `json:"password" bson:"password"`
	PasswordConfirm    string             `json:"passwordConfirm,omitempty" bson:"passwordConfirm,omitempty"`
	Role               string             `json:"role" bson:"role"`
	VerificationCode   string             `json:"verificationCode,omitempty" bson:"verificationCode"`
	ResetPasswordToken string             `json:"resetPasswordToken,omitempty" bson:"resetPasswordToken,omitempty"`
	ResetPasswordAt    time.Time          `json:"resetPasswordAt,omitempty" bson:"resetPasswordAt,omitempty"`
	Verified           bool               `json:"verified" bson:"verified"`
	CreatedAt          time.Time          `json:"created_at" bson:"created_at"`
	UpdatedAt          time.Time          `json:"updated_at" bson:"updated_at"`
	LastAttemptAt      time.Time          `json:"last_attempt_at" bson:"last_attempt_at"`
}

👈 DBUserResponse struct

type ForgotPasswordInput

type ForgotPasswordInput struct {
	Email string `json:"email" bson:"email" binding:"required"`
}

👈 ForgotPasswordInput struct

type GetTaskSchemeResponse

type GetTaskSchemeResponse struct {
	TaskUuid    uuid.UUID          `bson:"task_uuid" json:"task_uuid,omitempty"`
	Completed   bool               `bson:"completed" json:"completed,omitempty"`
	DownloadUrl string             `bson:"download_url" json:"download_url,omitempty"`
	ID          primitive.ObjectID `bson:"_id" json:"id,omitempty"`
}

func DbTaskToTaskResponse

func DbTaskToTaskResponse(t []*DBTaskScheme) []*GetTaskSchemeResponse

type InsertTaskScheme

type InsertTaskScheme struct {
	// CreateTaskScheme
	User      string `bson:"user"`
	Text      string `bson:"text"`
	VoiceType string `bson:"voice_type"`
	IsSSML    bool   `bson:"is_ssml"`

	// new fields
	TaskUuid    uuid.UUID `bson:"task_uuid"`
	CreatedAt   time.Time `bson:"created_at"`
	UpdatedAt   time.Time `bson:"updated_at"`
	Completed   bool      `bson:"completed"`
	DownloadUrl string    `bson:"download_url"`
}

type ResetPasswordInput

type ResetPasswordInput struct {
	Password        string `json:"password" bson:"password"`
	PasswordConfirm string `json:"passwordConfirm,omitempty" bson:"passwordConfirm,omitempty"`
}

👈 ResetPasswordInput struct

type SignInInput

type SignInInput struct {
	Email    string `json:"email" bson:"email" binding:"required"`
	Password string `json:"password" bson:"password" binding:"required"`
}

👈 SignInInput struct

type SignUpInput

type SignUpInput struct {
	Name               string    `json:"name" bson:"name" binding:"required"`
	Email              string    `json:"email" bson:"email" binding:"required"`
	Password           string    `json:"password" bson:"password" binding:"required,min=8"`
	PasswordConfirm    string    `json:"passwordConfirm" bson:"passwordConfirm,omitempty" binding:"required"`
	Role               string    `json:"role" bson:"role"`
	VerificationCode   string    `json:"verificationCode,omitempty" bson:"verificationCode,omitempty"`
	ResetPasswordToken string    `json:"resetPasswordToken,omitempty" bson:"resetPasswordToken,omitempty"`
	ResetPasswordAt    time.Time `json:"resetPasswordAt,omitempty" bson:"resetPasswordAt,omitempty"`
	Verified           bool      `json:"verified" bson:"verified"`
	CreatedAt          time.Time `json:"created_at" bson:"created_at"`
	UpdatedAt          time.Time `json:"updated_at" bson:"updated_at"`
	LastAttemptAt      time.Time `json:"last_attempt_at" bson:"last_attempt_at"`
}

👈 SignUpInput struct

type UpdateInput

type UpdateInput struct {
	Name               string    `json:"name,omitempty" bson:"name,omitempty"`
	Email              string    `json:"email,omitempty" bson:"email,omitempty"`
	Password           string    `json:"password,omitempty" bson:"password,omitempty"`
	Role               string    `json:"role,omitempty" bson:"role,omitempty"`
	VerificationCode   string    `json:"verificationCode,omitempty" bson:"verificationCode,omitempty"`
	ResetPasswordToken string    `json:"resetPasswordToken,omitempty" bson:"resetPasswordToken,omitempty"`
	ResetPasswordAt    time.Time `json:"resetPasswordAt,omitempty" bson:"resetPasswordAt,omitempty"`
	Verified           bool      `json:"verified,omitempty" bson:"verified,omitempty"`
	CreatedAt          time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"`
	UpdatedAt          time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"`
}

type UserResponse

type UserResponse struct {
	ID            primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"`
	Name          string             `json:"name,omitempty" bson:"name,omitempty"`
	Email         string             `json:"email,omitempty" bson:"email,omitempty"`
	Role          string             `json:"role,omitempty" bson:"role,omitempty"`
	CreatedAt     time.Time          `json:"created_at" bson:"created_at"`
	UpdatedAt     time.Time          `json:"updated_at" bson:"updated_at"`
	LastAttemptAt time.Time          `json:"last_attempt_at" bson:"last_attempt_at"`
}

👈 UserResponse struct

func FilteredResponse

func FilteredResponse(user *DBUserResponse) UserResponse

Jump to

Keyboard shortcuts

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