Documentation ¶
Index ¶
- Constants
- type StudentDB
- func (s *StudentDB) CancelEnrollmentWebinar(id string, param entity.CancelEnrollmentWebinarParam) error
- func (s *StudentDB) EnrollWebinar(id string, param entity.EnrollWebinarParam) error
- func (s *StudentDB) GetAllRegisteredWebinar(id string) ([]entity.Webinar, error)
- func (s *StudentDB) GetProfile(id string) (entity.Student, error)
- func (s *StudentDB) InsertNewUser(student entity.Student) error
- func (s *StudentDB) IsUserExist(id string) error
- type TeacherDB
- func (t *TeacherDB) ApproveWaitingList(id string, studentID string, webinarID int64) error
- func (t *TeacherDB) GetProfile(id string) (entity.Teacher, error)
- func (t *TeacherDB) InsertNewUser(teacher entity.Teacher) error
- func (t *TeacherDB) IsUserExist(id string) error
- func (t *TeacherDB) RejectWaitingList(id string, studentID string, webinarID int64) error
- type WebinarDB
- func (w *WebinarDB) DeleteWebinar(id string, param entity.DeleteWebinarParam) error
- func (w *WebinarDB) GetAllWebinar(id string) ([]entity.Webinar, error)
- func (w *WebinarDB) GetWebinarByID(id int64) (entity.Webinar, error)
- func (w *WebinarDB) GetWebinarBySlug(slug string) ([]entity.Webinar, error)
- func (w *WebinarDB) InsertNewWebinar(id string, param entity.CreateWebinarParam) error
- func (w *WebinarDB) UpdateWebinar(id string, param entity.UpdateWebinarParam) error
Constants ¶
View Source
const ( SQLCheckTeacherExist = `SELECT EXISTS(SELECT * FROM teacher_mst WHERE id=$1)` SQLInsertNewTeacher = `INSERT INTO teacher_mst (id, name, email, picture) VALUES ($1, $2, $3, $4)` SQLGetTeacherProfile = `SELECT * FROM teacher_mst WHERE id=$1` SQLApproveStudent = `UPDATE participant_mst SET status=1 WHERE teacher_id=$1 AND webinar_id=$2 AND student_id=$3` SQLRejectStudent = `UPDATE participant_mst SET status=2 WHERE teacher_id=$1 AND webinar_id=$2 AND student_id=$3` )
** TEACHER **
View Source
const ( SQLGetAllWebinarByTeacherID = `SELECT * FROM webinar_mst WHERE teacher_id=$1` SQLInsertNewWebinar = `` /* 175-byte string literal not displayed */ SQLUpdateWebinar = `` /* 150-byte string literal not displayed */ SQLDeleteWebinar = `DELETE FROM webinar_mst WHERE teacher_id=$1 AND id=$2` SQLGetWebinarBySlug = `SELECT * FROM webinar_mst WHERE title ILIKE $1` SQLGetWebinarByID = `SELECT * FROM webinar_mst WHERE id=$1` SQLGetParticipants = `` /* 133-byte string literal not displayed */ )
** WEBINARS **
View Source
const ( SQLCheckStudentExist = `SELECT EXISTS(SELECT * FROM student_mst WHERE id=$1)` SQLInsertNewStudent = `INSERT INTO student_mst (id, name, email, picture) VALUES ($1, $2, $3, $4)` SQLGetStudentProfile = `SELECT * FROM student_mst WHERE id=$1` SQLGetRegisteredWebinars = `SELECT w.* FROM webinar_mst as w INNER JOIN participant_mst as p ON w.id=p.webinar_id WHERE p.student_id=$1` SQLEnrollWebinar = `INSERT INTO participant_mst (student_id, webinar_id, teacher_id, status) VALUES ($1, $2, $3, 0)` SQLCancelEnrollWebinar = `DELETE FROM participant_mst WHERE student_id=$1 AND webinar_id=$2 AND teacher_id=$3` )
** STUDENT **
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StudentDB ¶
type StudentDB struct {
// contains filtered or unexported fields
}
func NewStudentDB ¶
func (*StudentDB) CancelEnrollmentWebinar ¶
func (s *StudentDB) CancelEnrollmentWebinar(id string, param entity.CancelEnrollmentWebinarParam) error
func (*StudentDB) EnrollWebinar ¶
func (s *StudentDB) EnrollWebinar(id string, param entity.EnrollWebinarParam) error
func (*StudentDB) GetAllRegisteredWebinar ¶
func (*StudentDB) IsUserExist ¶
type TeacherDB ¶
type TeacherDB struct {
// contains filtered or unexported fields
}
func NewTeacherDB ¶
func (*TeacherDB) ApproveWaitingList ¶
func (*TeacherDB) IsUserExist ¶
type WebinarDB ¶
type WebinarDB struct {
// contains filtered or unexported fields
}
func NewWebinarDB ¶
func (*WebinarDB) DeleteWebinar ¶
func (w *WebinarDB) DeleteWebinar(id string, param entity.DeleteWebinarParam) error
func (*WebinarDB) GetAllWebinar ¶
func (*WebinarDB) GetWebinarByID ¶
func (*WebinarDB) GetWebinarBySlug ¶
func (*WebinarDB) InsertNewWebinar ¶
func (w *WebinarDB) InsertNewWebinar(id string, param entity.CreateWebinarParam) error
func (*WebinarDB) UpdateWebinar ¶
func (w *WebinarDB) UpdateWebinar(id string, param entity.UpdateWebinarParam) error
Click to show internal directories.
Click to hide internal directories.