vocabulary

package
v0.0.0-...-f926c12 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteWithListID

func DeleteWithListID(listID primitive.ObjectID) error

func Init

func Init(r *gin.Engine)

func InsertVocabularies

func InsertVocabularies(vocabularies []Vocabulary) error

Types

type CheckTestRequest

type CheckTestRequest struct {
	Vocabularies     []Vocabulary `json:"vocabularies"`
	FirstValueField  string       `json:"firstValueField"`
	SecondValueField string       `json:"secondValueField"`
}

type Error

type Error struct {
	ErrorText string
}

func (Error) Error

func (error Error) Error() string

type GenerateTestRequest

type GenerateTestRequest struct {
	ListIDs          []primitive.ObjectID `json:"listIds"`
	Limit            int8                 `json:"limit"`
	FirstValueField  string               `json:"firstValueField"`
	SecondValueField string               `json:"secondValueField"`
}

type TestResult

type TestResult struct {
	Vocabs  []UserDBVocabs `json:"vocabs"`
	Correct int8           `json:"correct"`
}

type UserDBVocabs

type UserDBVocabs struct {
	ID         primitive.ObjectID `json:"id"`
	UserFirst  Values             `json:"userFirst"`
	UserSecond Values             `json:"userSecond"`
	DBFirst    Values             `json:"dbFirst"`
	DBSecond   Values             `json:"dbSecond"`
}

type Values

type Values struct {
	Key    string   `bson:"key, omitempty" json:"key"`
	Values []string `bson:"values, omitempty" json:"values"`
}

type Vocabulary

type Vocabulary struct {
	ID     primitive.ObjectID `bson:"_id, omitempty" json:"id"`
	ListID primitive.ObjectID `bson:"listID, omitempty" json:"listId"`
	Values []Values           `bson:"values, omitempty" json:"values"`
}

func GetRandomVocabularyByListIds

func GetRandomVocabularyByListIds(ids []primitive.ObjectID, limit int8) ([]Vocabulary, error)

func GetVocabularyByIDs

func GetVocabularyByIDs(ids []primitive.ObjectID) ([]Vocabulary, error)

func GetVocabularyByListID

func GetVocabularyByListID(listID string) ([]Vocabulary, error)

func (Vocabulary) Delete

func (vocabulary Vocabulary) Delete() error

func (*Vocabulary) GetValueByKey

func (vocabulary *Vocabulary) GetValueByKey(key string) Values

func (*Vocabulary) InsertVocab

func (vocabulary *Vocabulary) InsertVocab() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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