Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPgSQLConf ¶ added in v0.3.0
func GetPgSQLConf() string
Types ¶
type Chapter ¶ added in v0.7.5
type Chapter struct {
UUID string `gorm:"not null; primaryKey; type:uuid; default:gen_random_uuid()"`
Name sql.NullString `gorm:"not null; type:varchar(32)"`
Description sql.NullString `gorm:"not null; type:varchar(99); default:''"`
CourseUUID sql.NullString `gorm:"not null; uniqueIndex:uk_chapter_courseUUID_index"`
Course Course `gorm:"foreignKey:CourseUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
Index sql.NullInt32 `gorm:"not null; type:integer; uniqueIndex:uk_chapter_courseUUID_index"`
Content sql.NullString `gorm:"not null; type:text; default:''"`
Questions []Question `gorm:"foreignKey:ChapterUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
type ClassModel ¶
type ClassModel struct {
UUID string `gorm:"not null; primaryKey; type:uuid; default:gen_random_uuid()"`
Name sql.NullString `gorm:"not null; type:varchar(32); uniqueIndex:uk_class_name"`
Description sql.NullString `gorm:"not null; type:varchar(99); default:''"`
CourseUUID sql.NullString `gorm:"not null"`
Course Course `gorm:"foreignKey:CourseUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` // Belongs to
CreatorID sql.NullInt32 `gorm:"not null"`
Creator User `gorm:"foreignKey:CreatorID; references:AccountID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
Students []User `` /* 172-byte string literal not displayed */
}
type ContentReading ¶ added in v0.6.8
type Course ¶ added in v0.7.5
type Course struct {
UUID string `gorm:"not null; primaryKey; type:uuid; default:gen_random_uuid()"`
Name sql.NullString `gorm:"not null; type:varchar(32); uniqueIndex:uk_course_name"`
Description sql.NullString `gorm:"not null; type:varchar(99); default:''"`
Chapters []Chapter `gorm:"foreignKey:CourseUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
type Question ¶ added in v0.7.5
type Question struct {
UUID string `gorm:"not null; primaryKey; type:uuid; default:gen_random_uuid()"`
Question sql.NullString `gorm:"not null; type:text; uniqueIndex:uk_question"`
Analysis sql.NullString `gorm:"not null; type:text; default:''"`
AnswerA sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerB sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerC sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerD sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerE sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerF sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerG sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
AnswerH sql.NullString `gorm:"not null; type:text; default:''; uniqueIndex:uk_question"`
IsA sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsB sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsC sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsD sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsE sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsF sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsG sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsH sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
IsTrue sql.NullBool `gorm:"not null; type:bool; default:false; uniqueIndex:uk_question"`
Type sql.NullInt32 `gorm:"not null; type:integer; uniqueIndex:uk_question"`
Level sql.NullInt32 `gorm:"not null; type:integer; default:0"`
AnswerCount sql.NullInt32 `gorm:"not null; type:integer; default:0"`
CorrectCount sql.NullInt32 `gorm:"not null; type:integer; default:0"`
ChapterUUID sql.NullString `gorm:"not null; index:idx_question_chapterUUID; uniqueIndex:uk_question"`
Chapter Chapter `gorm:"foreignKey:ChapterUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
IsExamQuestion sql.NullBool `gorm:"not null; type:bool; default:false"`
}
type QuestionAnswer ¶ added in v0.7.0
type QuestionAnswer struct {
StudentID int32 `gorm:"not null; index:idx_questionAnswer_studentID"`
Student User `gorm:"foreignKey:StudentID; references:AccountID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
QuestionUUID string `gorm:"not null"`
Question Question `gorm:"foreignKey:QuestionUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
UsedTime int32 `gorm:"not null; integer"`
IsCorrect bool `gorm:"not null; type:bool"`
}
type Resource ¶ added in v0.7.5
type Resource struct {
UUID string `gorm:"not null; primaryKey; type:uuid; default:gen_random_uuid()"`
ChapterUUID string `gorm:"not null"`
Chapter Chapter `gorm:"foreignKey:ChapterUUID; references:UUID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
Prefix string `gorm:"not null; type:char(3)"`
StoreName string `gorm:"not null; type:char(40)"`
FileName string `gorm:"not null; type:varchar(99)"`
FileType int `gorm:"not null; type:integer"`
PutUserUUID string `gorm:"not null"`
PutUser User `gorm:"foreignKey:PutUserUUID; references:AccountID; constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
type User ¶ added in v0.7.5
type User struct {
AccountID int32 `gorm:"primaryKey; type:integer; uniqueIndex:uk_user_accountID"`
Name sql.NullString `gorm:"not null; type:varchar(32)"`
Gender sql.NullInt32 `gorm:"not null; type:integer; default:0"`
Type sql.NullInt32 `gorm:"not null; type:integer"`
IsManager sql.NullBool `gorm:"not null; type:bool; default:false"`
PasswordSSHA sql.NullString `gorm:"not null; type:char(64)"`
PasswordSalt sql.NullString `gorm:"not null; type:char(64)"`
Classes []ClassModel `` /* 172-byte string literal not displayed */
WrongAnswerQuestions []Question `` /* 184-byte string literal not displayed */
}
func (*User) ComputePasswordSSHA ¶ added in v0.7.5
func (*User) SetPassword ¶ added in v0.7.5
Click to show internal directories.
Click to hide internal directories.