repository

package
v0.0.0-...-8674a3e Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 NewStudentDB(db *sqlx.DB) *StudentDB

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 (s *StudentDB) GetAllRegisteredWebinar(id string) ([]entity.Webinar, error)

func (*StudentDB) GetProfile

func (s *StudentDB) GetProfile(id string) (entity.Student, error)

func (*StudentDB) InsertNewUser

func (s *StudentDB) InsertNewUser(student entity.Student) error

func (*StudentDB) IsUserExist

func (s *StudentDB) IsUserExist(id string) error

type TeacherDB

type TeacherDB struct {
	// contains filtered or unexported fields
}

func NewTeacherDB

func NewTeacherDB(db *sqlx.DB) *TeacherDB

func (*TeacherDB) ApproveWaitingList

func (t *TeacherDB) ApproveWaitingList(id string, studentID string, webinarID int64) error

func (*TeacherDB) GetProfile

func (t *TeacherDB) GetProfile(id string) (entity.Teacher, error)

func (*TeacherDB) InsertNewUser

func (t *TeacherDB) InsertNewUser(teacher entity.Teacher) error

func (*TeacherDB) IsUserExist

func (t *TeacherDB) IsUserExist(id string) error

func (*TeacherDB) RejectWaitingList

func (t *TeacherDB) RejectWaitingList(id string, studentID string, webinarID int64) error

type WebinarDB

type WebinarDB struct {
	// contains filtered or unexported fields
}

func NewWebinarDB

func NewWebinarDB(db *sqlx.DB) *WebinarDB

func (*WebinarDB) DeleteWebinar

func (w *WebinarDB) DeleteWebinar(id string, param entity.DeleteWebinarParam) error

func (*WebinarDB) GetAllWebinar

func (w *WebinarDB) GetAllWebinar(id string) ([]entity.Webinar, error)

func (*WebinarDB) GetWebinarByID

func (w *WebinarDB) GetWebinarByID(id int64) (entity.Webinar, error)

func (*WebinarDB) GetWebinarBySlug

func (w *WebinarDB) GetWebinarBySlug(slug string) ([]entity.Webinar, error)

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

Jump to

Keyboard shortcuts

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