internal

package
v0.0.0-...-b4acfce Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NormalType string = "normal"
	PuzzleType string = "puzzle"
)
View Source
const (
	StartedPhase  string = "started"
	FinishedPhase string = "finished"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Course

type Course struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time

	UserID          uint
	Name            string
	Description     string
	Image           string
	Task            []Task
	Language        string
	DifficultyLevel string
	Rate            float32
	RateCounter     int

	Type      string
	MaxPoints int
}

type CourseDTO

type CourseDTO struct {
	CourseID string `json:"id"`
	UserID   uint   `json:"userId"`

	Name        string    `json:"name" validate:"required"`
	Description string    `json:"description"`
	Image       string    `json:"image"`
	Data        []TaskDTO `json:"data,omitempty"`

	Language        string  `json:"language"`
	DifficultyLevel string  `json:"difficultyLevel"`
	Rate            float32 `json:"rate"`
	MaxPoints       int     `json:"maxPoints"`

	BestPoints int `json:"bestPoints"`

	Type string `json:"type" validate:"required"`
}

type CourseResult

type CourseResult struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time

	UserID   uint
	CourseID uint

	Points uint
	Phase  string
	Passed bool
}

type CourseResultDTO

type CourseResultDTO struct {
	Phase    string `json:"phase" validate:"required"`
	CourseID string `json:"courseId" validate:"required"`
	UserID   uint   `json:"userId"`

	Points uint `json:"points"`
	Passed bool `json:"passed"`
}

type Task

type Task struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time

	CourseID  uint
	Word      string
	Translate string
	Image     string
}

type TaskDTO

type TaskDTO struct {
	ID        string `json:"id"`
	CourseID  string `json:"courseId"`
	Word      string `json:"word" validate:"required"`
	Translate string `json:"translate" validate:"required"`
	Image     string `json:"image"`
}

type User

type User struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time

	Email     string
	FirstName string
	LastName  string
	Password  string
	Avatar    string

	Level     int
	NextLevel string
	Points    int
}

type UserDTO

type UserDTO struct {
	Email     string `json:"email" validate:"required,email,max=250"`
	FirstName string `json:"firstName" validate:"max=250"`
	LastName  string `json:"lastName" validate:"max=250"`
	Password  string `json:"password,omitempty" validate:"required,min=8,max=250"`
	Avatar    string `json:"avatar"`

	Token        string `json:"token"`
	RefreshToken string `json:"refreshToken"`

	ID int `json:"id"`

	Level     int    `json:"level"`
	NextLevel string `json:"nextLevel"`
	Points    int    `json:"points"`
}

type UserStatDTO

type UserStatDTO struct {
	UserID uint   `json:"user_id"`
	Email  string `json:"username"`
	Avatar string `json:"avatar"`
	Points int    `json:"points"`
	Level  int    `json:"level"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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