Documentation ¶
Index ¶
- func AddArticle(data map[string]interface{}) error
- func AddArticleTrans(tx *gorm.DB, data map[string]interface{}) error
- func AddBrand(brand *Brand) error
- func AddClasslesson(classLesson *Classlesson) error
- func AddClasslessonTrans(tx *gorm.DB, classLesson *Classlesson) error
- func AddCourse(course *Course) error
- func AddCourseTrans(tx *gorm.DB, course *Course) error
- func AddLesson(lesson *Lesson) error
- func AddLessonSection(lessonSection *Lessonsection) error
- func AddLessonSectionTrans(tx *gorm.DB, lessonSection *Lessonsection) error
- func AddLessonTrans(tx *gorm.DB, lesson *Lesson) error
- func AddOrUpdateClasslesson(classLesson *Classlesson) error
- func AddOrUpdateCourse(course *Course) error
- func AddOrUpdateLesson(lesson *Lesson) error
- func AddOrUpdateLessonSection(lessonSection *Lessonsection) error
- func AddOrUpdateStudent(model *Student) error
- func AddStudent(model *Student) error
- func AddStudentTrans(tx *gorm.DB, model *Student) error
- func AddTag(name string, state int, createdBy string) error
- func AddTagTrans(tx *gorm.DB, name string, state int, createdBy string) error
- func CheckAuth(username, password string) (bool, error)
- func CleanAllArticle() error
- func CleanAllTag() (bool, error)
- func CloseDB()
- func DeleteArticle(id int) error
- func DeleteBrand(brand *Brand) error
- func DeleteClasslesson(id int64) error
- func DeleteCourse(id int64) error
- func DeleteLesson(id int64) error
- func DeleteLessonSection(id int64) error
- func DeleteStudent(id int64) error
- func DeleteTag(id int) error
- func EditArticle(id int, data interface{}) error
- func EditTag(id int, data interface{}) error
- func ExistArticleByID(id int) (bool, error)
- func ExistClasslessonByID(id int64) (bool, error)
- func ExistCourseByID(id int64) (bool, error)
- func ExistLessonByID(id int64) (bool, error)
- func ExistLessonSectionByID(id int64) (bool, error)
- func ExistStudentByID(id int64) (bool, error)
- func ExistTagByID(id int) (bool, error)
- func ExistTagByName(name string) (bool, error)
- func GetArticleTotal(maps interface{}) (int, error)
- func GetClasslessonTotal(maps interface{}) (int, error)
- func GetCourseTotal(maps interface{}) (int, error)
- func GetLessonSectionTotal(maps interface{}) (int, error)
- func GetLessonTotal(maps interface{}) (int, error)
- func GetStudentTotal(maps interface{}) (int, error)
- func GetTagTotal(maps interface{}) (int, error)
- func Setup()
- func WriteDB() *gorm.DB
- type Article
- type Articles
- type Auth
- type Brand
- type Classlesson
- type Course
- type Lesson
- type Lessonsection
- type Model
- type Student
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddArticle ¶
func AddClasslesson ¶
func AddClasslesson(classLesson *Classlesson) error
func AddClasslessonTrans ¶
func AddClasslessonTrans(tx *gorm.DB, classLesson *Classlesson) error
func AddLessonSection ¶
func AddLessonSection(lessonSection *Lessonsection) error
func AddLessonSectionTrans ¶
func AddLessonSectionTrans(tx *gorm.DB, lessonSection *Lessonsection) error
func AddOrUpdateClasslesson ¶
func AddOrUpdateClasslesson(classLesson *Classlesson) error
func AddOrUpdateLesson ¶
func AddOrUpdateLessonSection ¶
func AddOrUpdateLessonSection(lessonSection *Lessonsection) error
func AddStudent ¶
func CleanAllArticle ¶
func CleanAllArticle() error
func CleanAllTag ¶
func DeleteArticle ¶
func DeleteBrand ¶
func DeleteClasslesson ¶
func DeleteCourse ¶
func DeleteLesson ¶
func DeleteLessonSection ¶
func DeleteStudent ¶
func EditArticle ¶
func ExistArticleByID ¶
func ExistClasslessonByID ¶
func ExistCourseByID ¶
func ExistLessonByID ¶
func ExistLessonSectionByID ¶
func ExistStudentByID ¶
func ExistTagByID ¶
func ExistTagByName ¶
func GetArticleTotal ¶
func GetClasslessonTotal ¶
func GetCourseTotal ¶
func GetLessonSectionTotal ¶
func GetLessonTotal ¶
func GetStudentTotal ¶
func GetTagTotal ¶
Types ¶
type Article ¶
type Article struct { Model TagID int `gorm:"column:tag_id"` Title string `gorm:"column:title"` Tag Tag Desc string `gorm:"column:desc"` Content string `gorm:"column:content"` CoverImageURL string `gorm:"column:cover_image_url"` CreatedBy string `gorm:"column:created_by"` ModifiedBy string `gorm:"column:modified_by"` State int `gorm:"column:state"` }
Article 文章
func GetArticle ¶
type Brand ¶
type Brand struct { ID int64 `gorm:"primary_key;column:id" json:"id"` Name string `gorm:"column:name" json:"name"` AddTime time.Time `gorm:"column:addTime" json:"addTime"` }
func GetBrandList ¶
type Classlesson ¶
type Classlesson struct { ID int64 `gorm:"primary_key;column:id"` //关联查询,以ForeignKey作为外键 从Course表中以AssociationForeignKey 为references进行查询 Course Course `gorm:"ForeignKey:courseId;AssociationForeignKey:courseId"` CourseID int64 `gorm:"column:courseId"` Lesson Lesson `gorm:"ForeignKey:lessonId;AssociationForeignKey:lessonId"` LessonID int64 `gorm:"column:lessonId"` PhaseID int64 `gorm:"column:phaseId"` StartTime time.Time `gorm:"column:startTime"` }
func GetClasslesson ¶
func GetClasslesson(id int64) (*Classlesson, error)
func GetClasslessons ¶
func GetClasslessons(pageNum int, pageSize int, maps interface{}) ([]Classlesson, error)
func GetClasslessonsByPhase ¶
func GetClasslessonsByPhase(phaseID int64) ([]Classlesson, error)
获取phaseId的班级信息
type Course ¶
type Course struct { CourseID int64 `gorm:"primary_key;column:courseId"` CourseName string `gorm:"column:courseName"` //一对多,指定的是多的一方的外键以及对于一的一方的reference Lessons []Lesson `gorm:"ForeignKey:lessonId"` LessonSections []Lessonsection `gorm:"ForeignKey:courseId"` CourseImage string `gorm:"column:courseImage"` Stage string `gorm:"column:stage"` LessonNum int `gorm:"column:lessonNum"` OriginalPrice float64 `gorm:"column:originalPrice"` Price float64 `gorm:"column:price"` LimitNum int `gorm:"column:limitNum"` BuyNum int `gorm:"column:buyNum"` MallProductID int `gorm:"column:mallProductId"` Status int8 `gorm:"column:status"` TeacherID int64 `gorm:"column:teacherId"` AssistantTeacherID int64 `gorm:"column:assistantTeacherId"` AddTime time.Time `gorm:"column:addTime"` StartTime time.Time `gorm:"column:startTime"` EndTime time.Time `gorm:"column:endTime"` CourseType int8 `gorm:"column:courseType"` IsExperienceCourse int8 `gorm:"column:isExperienceCourse"` ListImage string `gorm:"column:listImage"` ScratchFile string `gorm:"column:scratchFile"` PrizeName string `gorm:"column:prizeName"` PrizeImage string `gorm:"column:prizeImage"` PrizeDetail string `gorm:"column:prizeDetail"` NeedBuyCourse int8 `gorm:"column:needBuyCourse"` Summary string `gorm:"column:summary"` AnswerFile string `gorm:"column:answerFile"` OpenSectionID int64 `gorm:"column:openSectionId"` }
type Lesson ¶
type Lesson struct { LessonID int64 `gorm:"primary_key;column:lessonId"` //关联查询,以ForeignKey作为外键 从Course表中以AssociationForeignKey 为references进行查询 //一对一,指定的是本方的外键以及对于另一方的reference Course Course `gorm:"ForeignKey:courseId;AssociationForeignKey:courseId"` CourseID int64 `gorm:"column:courseId"` Duration int `gorm:"column:duration"` StartTime time.Time `gorm:"column:startTime"` AddTime time.Time `gorm:"column:addTime"` LessonNum int `gorm:"column:lessonNum"` Brief string `gorm:"column:brief"` LessonName string `gorm:"column:lessonName"` }
type Lessonsection ¶
type Lessonsection struct { SectionID int64 `gorm:"primary_key;column:sectionId"` LessonID int64 `gorm:"column:lessonId"` Lesson Lesson `gorm:"ForeignKey:lessonId"` //关联查询,以ForeignKey作为外键 从Course表中以AssociationForeignKey 为references进行查询 Course Course `gorm:"ForeignKey:courseId"` CourseID int64 `gorm:"column:courseId"` SectionNum int `gorm:"column:sectionNum"` Brief string `gorm:"column:brief"` SectionName string `gorm:"column:sectionName"` VideoURL string `gorm:"column:videoUrl"` VideoTimes int `gorm:"column:videoTimes"` Courseware string `gorm:"column:courseware"` ParentID int64 `gorm:"column:parentId"` AddTime time.Time `gorm:"column:addTime"` AnswerFile string `gorm:"column:answerFile"` WorksCover string `gorm:"column:worksCover"` IsChallenge int8 `gorm:"column:isChallenge"` IsClockIn int8 `gorm:"column:isClockIn"` SectionImage string `gorm:"column:sectionImage"` }
func GetLessonSection ¶
func GetLessonSection(id int64) (*Lessonsection, error)
func GetLessonSections ¶
func GetLessonSections(pageNum int, pageSize int, maps interface{}) ([]Lessonsection, error)
type Student ¶
type Student struct { StudentID int64 `gorm:"primary_key;column:studentId"` Mobile string `gorm:"column:mobile"` HealthPoint int `gorm:"column:healthPoint"` MaxHealthPoint int `gorm:"column:maxHealthPoint"` LifeCount int `gorm:"column:lifeCount"` HealthPointUpdateTime time.Time `gorm:"column:healthPointUpdateTime"` AddTime time.Time `gorm:"column:addTime"` LifeCountUpdateTime time.Time `gorm:"column:lifeCountUpdateTime"` UserId int64 `gorm:"column:userId"` UserName string `gorm:"column:userName"` Channel string `gorm:"column:channel"` Platform string `gorm:"column:platform"` SystemInfo string `gorm:"column:systemInfo"` Version int `gorm:"column:version"` LearningCard int `gorm:"column:learningCard"` LastOpenTime time.Time `gorm:"column:lastOpenTime"` Coin int `gorm:"column:coin"` AbilityValue int `gorm:"column:abilityValue"` AbilityLevel int `gorm:"column:abilityLevel"` HeadPhoto string `gorm:"column:headPhoto"` Sex int `gorm:"column:sex"` IsEdit int `gorm:"column:isEdit"` ThroughCount int `gorm:"column:throughCount"` ThroughTimes int `gorm:"column:throughTimes"` TotalCodeRows int `gorm:"column:totalCodeRows"` TotalCodeTime int `gorm:"column:totalCodeTime"` GuideProgress string `gorm:"column:guideProgress"` LinkMobile string `gorm:"column:linkMobile"` Age int `gorm:"column:age"` Source string `gorm:"column:source"` }
func GetStudent ¶
Click to show internal directories.
Click to hide internal directories.