domain

package
v0.0.0-...-9eaf9d2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Lang2Len = 2
View Source
const StudyMaxLevel = 10
View Source
const StudyMinLevel = 0

Variables

View Source
var ErrPluginError = errors.New("plugin error")
View Source
var ErrorTypeClient = "client"
View Source
var PrivilegeRead = userD.RBACAction("read")
View Source
var PrivilegeRemove = userD.RBACAction("remove")
View Source
var PrivilegeUpdate = userD.RBACAction("update")
View Source
var WorkbookObjectPrefix = "workbook_"

Functions

func NewWorkbookObject

func NewWorkbookObject(workbookID WorkbookID) userD.RBACObject

func NewWorkbookReader

func NewWorkbookReader(workbookID WorkbookID) userD.RBACRole

func NewWorkbookWriter

func NewWorkbookWriter(workbookID WorkbookID) userD.RBACRole

Types

type AudioID

type AudioID uint

type AudioModel

type AudioModel interface {
	GetID() uint
	GetLang2() Lang2
	GetText() string
	GetContent() string
}

func NewAudioModel

func NewAudioModel(id uint, lang2 Lang2, text, content string) (AudioModel, error)

type ErrorType

type ErrorType string

type GuestModel

type GuestModel interface {
	userD.AppUserModel
}

func NewGuestModel

func NewGuestModel(appUser userD.AppUserModel) (GuestModel, error)

type Lang2

type Lang2 interface {
	String() string
}
var (
	Lang2EN      Lang2
	Lang2ES      Lang2
	Lang2JA      Lang2
	Lang2KO      Lang2
	Lang2Unknown Lang2
)

func NewLang2

func NewLang2(lang string) (Lang2, error)

type PluginError

type PluginError struct {
	ErrorType     ErrorType
	ErrorCode     string
	ErrorMessages []string
	OrgError      error
}

func NewPluginError

func NewPluginError(errorType ErrorType, errorCode string, errorMessages []string, err error) *PluginError

func (*PluginError) Error

func (e *PluginError) Error() string

type ProblemID

type ProblemID uint

type ProblemModel

type ProblemModel interface {
	userD.Model
	GetNumber() int
	GetProblemType() string
	GetProperties(ctx context.Context) map[string]interface{}
}

func NewProblemModel

func NewProblemModel(model userD.Model, number int, problemType string, properties map[string]interface{}) (ProblemModel, error)

type ProblemType

type ProblemType interface {
	GetID() uint
	GetName() string
}

func NewProblemType

func NewProblemType(id uint, name string) (ProblemType, error)

type StudentModel

type StudentModel interface {
	userD.AppUserModel
}

func NewStudentModel

func NewStudentModel(appUserModel userD.AppUserModel) (StudentModel, error)

type StudyRecord

type StudyRecord struct {
	Level          int
	ResultPrev1    bool
	Memorized      bool
	LastAnsweredAt *time.Time
}

type StudyRecordWithProblemID

type StudyRecordWithProblemID struct {
	ProblemID   ProblemID
	StudyRecord StudyRecord
}

type StudyResultParameter

type StudyResultParameter struct {
	Result bool
}

type StudyType

type StudyType interface {
	GetID() uint
	GetName() string
}

func NewStudyType

func NewStudyType(id uint, name string) (StudyType, error)

type SystemStudentModel

type SystemStudentModel interface {
	userD.AppUserModel
}

func NewSystemStudentModel

func NewSystemStudentModel(appUser userD.AppUserModel) (SystemStudentModel, error)

type WorkbookID

type WorkbookID uint

type WorkbookModel

type WorkbookModel interface {
	userD.Model
	GetSpaceID() userD.SpaceID
	GetOwnerID() userD.AppUserID
	GetName() string
	GetLang2() Lang2
	GetProblemType() string
	GetQuestionText() string
	GetProperties() map[string]string
	HasPrivilege(privilege userD.RBACAction) bool
}

func NewWorkbookModel

func NewWorkbookModel(model userD.Model, spaceID userD.SpaceID, ownerID userD.AppUserID, privileges userD.Privileges, name string, lang2 Lang2, problemType string, questsionText string, properties map[string]string) (WorkbookModel, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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