models

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 6

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 BankCourseBindModel

type BankCourseBindModel struct {
	Model
	BankUUID   string `gorm:"not null; type:char(36); index:bankCourseBind_bankUUID"`
	CourseUUID string `gorm:"not null; type:char(36); index:bankCourseBind_courseUUID"`
}

type BankManagerBindModel

type BankManagerBindModel struct {
	Model
	BankUUID    string `gorm:"not null; type:char(36); index:bankManagerBind_bankUUID"`
	ManagerUUID string `gorm:"not null; type:char(36); index:bankManagerBind_managerUUID"`
}

type BankModel

type BankModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
}

type ChapterCourseBindModel added in v0.5.1

type ChapterCourseBindModel struct {
	Model
	ChapterUUID string `gorm:"not null; type:char(36); index:chapterCourseBindModel_chapterUUID"`
	CourseUUID  string `gorm:"not null; type:char(36); index:chapterCourseBindModel_courseUUID"`
	Index       int    `gorm:"not null; type:int; default:1"`
}

type ChapterManagerBindModel

type ChapterManagerBindModel struct {
	Model
	ChapterUUID string `gorm:"not null; type:char(36); index:chapterManagerBind_chapterUUID"`
	ManagerUUID string `gorm:"not null; type:char(36); index:chapterManagerBind_managerUUID"`
}

type ChapterModel

type ChapterModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
	ContentUUID string `gorm:"not null; type:char(36)"`
}

type ClassManagerBindModel

type ClassManagerBindModel struct {
	Model
	ClassUUID   string `gorm:"not null; type:char(36); index:classManagerBind_classUUID"`
	ManagerUUID string `gorm:"not null; type:char(36); index:classManagerBind_managerUUID"`
}

type ClassModel

type ClassModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
}

type CollegeDisciplineBindModel

type CollegeDisciplineBindModel struct {
	Model
	CollegeUUID    string `gorm:"not null; type:char(36); index:collegeDisciplineBind_collegeUUID"`
	DisciplineUUID string `gorm:"not null; type:char(36); index:collegeDisciplineBind_disciplineUUID"`
}

type CollegeManagerBindModel

type CollegeManagerBindModel struct {
	Model
	CollegeUUID string `gorm:"not null; type:char(36); index:collegeManagerBind_collegeUUID"`
	ManagerUUID string `gorm:"not null; type:char(36); index:collegeManagerBind_managerUUID"`
}

type CollegeModel

type CollegeModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
}

type ContentModel

type ContentModel struct {
	Model
	MarkdownBase64 string `gorm:"not null; type:text; default:''"`
}

type CourseDisciplineBindModel

type CourseDisciplineBindModel struct {
	Model
	CourseUUID     string `gorm:"not null; type:char(36); index:courseDisciplineBind_courseUUID"`
	DisciplineUUID string `gorm:"not null; type:char(36); index:courseDisciplineBind_disciplineUUID"`
}

type CourseManagerBindModel

type CourseManagerBindModel struct {
	Model
	CourseUUID  string `gorm:"not null; type:char(36); index:courseManagerBind_courseUUID"`
	ManagerUUID string `gorm:"not null; type:char(36); index:courseManagerBind_managerUUID"`
}

type CourseModel

type CourseModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
}

type DisciplineClassBindModel

type DisciplineClassBindModel struct {
	Model
	DisciplineUUID string `gorm:"not null; type:char(36); index:disciplineClassBind_disciplineUUID"`
	ClassUUID      string `gorm:"not null; type:char(36); index:disciplineClassBind_classUUID"`
}

type DisciplineManagerBindModel

type DisciplineManagerBindModel struct {
	Model
	DisciplineUUID string `gorm:"not null; type:char(36); index:disciplineManagerBind_disciplineUUID"`
	ManagerUUID    string `gorm:"not null; type:char(36); index:disciplineManagerBind_managerUUID"`
}

type DisciplineModel

type DisciplineModel struct {
	Model
	Name        string `gorm:"not null; type:varchar(32)"`
	Description string `gorm:"not null; type:varchar(99)"`
}

type Model

type Model struct {
	ID           int64  `gorm:"not null; auto_increment"`
	UUID         string `gorm:"not null; type:char(36); unique_index"`
	Deleted      bool   `gorm:"not null; type:bool; default:false"`
	CreationTime int64  `gorm:"not null; type:bigint; default:-1"`
	UpdateTime   int64  `gorm:"not null; type:bigint; default:-1"`
	DeleteTime   int64  `gorm:"not null; type:bigint; default:-1"`
}

func NewModel added in v0.4.10

func NewModel() Model

type QuestionBankBindModel

type QuestionBankBindModel struct {
	Model
	BankUUID     string `gorm:"not null; type:char(36); index:QuestionBankBind_bankUUID"`
	QuestionUUID string `gorm:"not null; type:char(36); index:QuestionBankBind_questionUUID"`
}

type QuestionModel

type QuestionModel struct {
	Model
	QuestionBase64 string `gorm:"not null; type:varchar(512)"`
	AnalysisBase64 string `gorm:"not null; type:varchar(2048)"`
	AnswerBase64A  string `gorm:"not null; type:varchar(512)"`
	AnswerBase64B  string `gorm:"not null; type:varchar(512)"`
	AnswerBase64C  string `gorm:"not null; type:varchar(512)"`
	AnswerBase64D  string `gorm:"not null; type:varchar(512)"`
	IsA            bool   `gorm:"not null; type:bool"`
	IsB            bool   `gorm:"not null; type:bool"`
	IsC            bool   `gorm:"not null; type:bool"`
	IsD            bool   `gorm:"not null; type:bool"`
	IsTrue         bool   `gorm:"not null; type:bool"`
	Type           int    `gorm:"not null; type:int; default:0"`
	Level          int    `gorm:"not null; type:int; default:0"`
}

type ResourceChapterBindModel added in v0.5.0

type ResourceChapterBindModel struct {
	Model
	ResourceUUID string `gorm:"not null; type:char(36); index:resourceChapterBind_resourceUUID"`
	ChapterUUID  string `gorm:"not null; type:char(36); index:resourceChapterBind_courseUUID"`
}

type ResourceModel added in v0.5.0

type ResourceModel struct {
	Model
	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:int"`
	PutUserUUID string `gorm:"not null; type:varchar(36)"`
}

type UserClassBindModel

type UserClassBindModel struct {
	Model
	UserUUID  string `gorm:"not null; type:char(36); index:userClassBindModel_userUUID"`
	ClassUUID string `gorm:"not null; type:char(36); index:userClassBindModel_classUUID"`
}

type UserCollegeBindModel

type UserCollegeBindModel struct {
	Model
	UserUUID    string `gorm:"not null; type:char(36); index:userCollegeBindModel_userUUID"`
	CollegeUUID string `gorm:"not null; type:char(36); index:userCollegeBindModel_collegeUUID"`
}

type UserDisciplineBindModel

type UserDisciplineBindModel struct {
	Model
	UserUUID       string `gorm:"not null; type:char(36); index:userDisciplineBindModel_userUUID"`
	DisciplineUUID string `gorm:"not null; type:char(36); index:userDisciplineBindModel_disciplineUUID"`
}

type UserModel

type UserModel struct {
	Model
	Type         int    `gorm:"not null; type:int; default:0"`
	AccountID    int    `gorm:"not null; type:int; unique_index:UserModel_accountID"`
	Name         string `gorm:"not null; type:varchar(32)"`
	Gender       int    `gorm:"not null; type:int; default:0"`
	PasswordSSHA string `gorm:"not null; type:char(64)"`
	PasswordSalt string `gorm:"not null; type:char(64)"`
}

func (*UserModel) Check

func (u *UserModel) Check(passwordMD5 string) bool

func (*UserModel) ComputePasswordSSHA

func (u *UserModel) ComputePasswordSSHA(passwordMD5 string, passwordSalt string) string

func (*UserModel) GenSalt

func (u *UserModel) GenSalt() string

func (*UserModel) ResetPassword

func (u *UserModel) ResetPassword(defaultPasswordMD5 string)

func (*UserModel) SetGender

func (u *UserModel) SetGender(gender int) bool

func (*UserModel) SetType

func (u *UserModel) SetType(userType int) bool

Jump to

Keyboard shortcuts

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