Documentation ¶
Index ¶
- Constants
- Variables
- func NewWorkbookObject(workbookID WorkbookID) userD.RBACObject
- func NewWorkbookReader(workbookID WorkbookID) userD.RBACRole
- func NewWorkbookWriter(workbookID WorkbookID) userD.RBACRole
- type AudioID
- type AudioModel
- type ErrorType
- type GuestModel
- type Lang2
- type PluginError
- type ProblemAddParameter
- type ProblemID
- type ProblemIDsCondition
- type ProblemModel
- type ProblemPropertyUpdateParameter
- type ProblemSearchCondition
- type ProblemSearchResult
- type ProblemSelectParameter1
- type ProblemSelectParameter2
- type ProblemType
- type ProblemTypeName
- type ProblemUpdateParameter
- type StatHistory
- type StatHistoryResult
- type StatModel
- type StudentModel
- type StudyRecord
- type StudyRecordWithProblemID
- type StudyResultParameter
- type StudyType
- type StudyTypeName
- type SystemStudentModel
- type WorkbookAddParameter
- type WorkbookID
- type WorkbookModel
- type WorkbookSearchCondition
- type WorkbookSearchResult
- type WorkbookUpdateParameter
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 AudioModel ¶
func NewAudioModel ¶
func NewAudioModel(id uint, lang2 Lang2, text, content string) (AudioModel, error)
type GuestModel ¶
type GuestModel interface { userD.AppUserModel IsGuestModel() bool }
func NewGuestModel ¶
func NewGuestModel(appUser userD.AppUserModel) (GuestModel, 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 ProblemAddParameter ¶
type ProblemAddParameter interface { GetWorkbookID() WorkbookID GetProperties() map[string]string GetStringProperty(name string) (string, error) GetIntProperty(name string) (int, error) }
func NewProblemAddParameter ¶
func NewProblemAddParameter(workbookID WorkbookID, properties map[string]string) (ProblemAddParameter, error)
type ProblemIDsCondition ¶
type ProblemIDsCondition interface { GetWorkbookID() WorkbookID GetIDs() []ProblemID }
func NewProblemIDsCondition ¶
func NewProblemIDsCondition(workbookID WorkbookID, ids []ProblemID) (ProblemIDsCondition, error)
type ProblemModel ¶
type ProblemModel interface { userD.Model GetNumber() int GetProblemType() ProblemTypeName GetProperties(ctx context.Context) map[string]interface{} }
func NewProblemModel ¶
func NewProblemModel(model userD.Model, number int, problemType ProblemTypeName, properties map[string]interface{}) (ProblemModel, error)
type ProblemPropertyUpdateParameter ¶
func NewProblemPropertyUpdateParameter ¶
func NewProblemPropertyUpdateParameter(key, value string) (ProblemPropertyUpdateParameter, error)
type ProblemSearchCondition ¶
type ProblemSearchCondition interface { GetWorkbookID() WorkbookID GetPageNo() int GetPageSize() int GetKeyword() string }
func NewProblemSearchCondition ¶
func NewProblemSearchCondition(workbookID WorkbookID, pageNo, pageSize int, keyword string) (ProblemSearchCondition, error)
type ProblemSearchResult ¶
type ProblemSearchResult interface { GetTotalCount() int GetResults() []ProblemModel }
func NewProblemSearchResult ¶
func NewProblemSearchResult(totalCount int, results []ProblemModel) (ProblemSearchResult, error)
type ProblemSelectParameter1 ¶
type ProblemSelectParameter1 interface { GetWorkbookID() WorkbookID GetProblemID() ProblemID }
func NewProblemSelectParameter1 ¶
func NewProblemSelectParameter1(WorkbookID WorkbookID, problemID ProblemID) (ProblemSelectParameter1, error)
type ProblemSelectParameter2 ¶
type ProblemSelectParameter2 interface { GetWorkbookID() WorkbookID GetProblemID() ProblemID GetVersion() int }
func NewProblemSelectParameter2 ¶
func NewProblemSelectParameter2(WorkbookID WorkbookID, problemID ProblemID, version int) (ProblemSelectParameter2, error)
type ProblemType ¶
type ProblemType interface { GetID() uint GetName() ProblemTypeName }
func NewProblemType ¶
func NewProblemType(id uint, name string) (ProblemType, error)
type ProblemTypeName ¶
type ProblemTypeName string
type ProblemUpdateParameter ¶
type ProblemUpdateParameter interface { GetProperties() map[string]string GetStringProperty(name string) (string, error) GetIntProperty(name string) (int, error) }
func NewProblemUpdateParameter ¶
func NewProblemUpdateParameter(properties map[string]string) (ProblemUpdateParameter, error)
type StatHistory ¶
type StatHistory struct {
Results []StatHistoryResult
}
type StatModel ¶
type StatModel interface { GetUserID() userD.AppUserID GetHistory() StatHistory }
func NewStatModel ¶
func NewStatModel(userID userD.AppUserID, history StatHistory) (StatModel, error)
type StudentModel ¶
type StudentModel interface { userD.AppUserModel GetAppUserID() userD.AppUserID IsStudentModel() bool }
func NewStudentModel ¶
func NewStudentModel(appUserModel userD.AppUserModel) (StudentModel, error)
type StudyRecord ¶
type StudyRecordWithProblemID ¶
type StudyRecordWithProblemID struct { ProblemID ProblemID StudyRecord StudyRecord }
type StudyResultParameter ¶
type StudyResultParameter struct {
Result bool
}
type StudyType ¶
type StudyType interface { GetID() uint GetName() StudyTypeName }
type StudyTypeName ¶
type StudyTypeName string
type SystemStudentModel ¶
type SystemStudentModel interface { userD.AppUserModel IsSystemStudentModel() bool }
func NewSystemStudentModel ¶
func NewSystemStudentModel(appUser userD.AppUserModel) (SystemStudentModel, error)
type WorkbookAddParameter ¶
type WorkbookAddParameter interface { GetProblemType() ProblemTypeName GetName() string GetLang2() Lang2 GetQuestionText() string GetProperties() map[string]string }
func NewWorkbookAddParameter ¶
func NewWorkbookAddParameter(problemType ProblemTypeName, name string, lang2 Lang2, questionText string, properties map[string]string) (WorkbookAddParameter, error)
type WorkbookID ¶
type WorkbookID uint
type WorkbookModel ¶
type WorkbookModel interface { userD.Model GetWorkbookID() WorkbookID GetSpaceID() userD.SpaceID GetOwnerID() userD.AppUserID GetName() string GetLang2() Lang2 GetProblemType() ProblemTypeName GetQuestionText() string GetProperties() map[string]string HasPrivilege(privilege userD.RBACAction) bool }
func NewWorkbookModel ¶
type WorkbookSearchCondition ¶
type WorkbookSearchCondition interface { GetPageNo() int GetPageSize() int GetSpaceIDs() []userD.SpaceID }
func NewWorkbookSearchCondition ¶
func NewWorkbookSearchCondition(pageNo, pageSize int, spaceIDs []userD.SpaceID) (WorkbookSearchCondition, error)
type WorkbookSearchResult ¶
type WorkbookSearchResult interface { GetTotalCount() int GetResults() []WorkbookModel }
func NewWorkbookSearchResult ¶
func NewWorkbookSearchResult(totalCount int, results []WorkbookModel) (WorkbookSearchResult, error)
type WorkbookUpdateParameter ¶
func NewWorkbookUpdateParameter ¶
func NewWorkbookUpdateParameter(name, questionText string) (WorkbookUpdateParameter, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.