student

package
v0.0.0-...-57241a5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMiddlewareStudentRepo

type IMiddlewareStudentRepo interface {
	GetStudent(filter interface{}) (*Student, error)
}

type IStudentRepo

type IStudentRepo interface {
	CreateStudent(student *Student) error
	StudentExists(filter interface{}) (bool, error)
	UpdateStudent(filter interface{}, update interface{}) error
	GetStudent(filter interface{}) (*Student, error)
}

type IStudentService

type IStudentService interface {
	SignUpStudent(student *Student) error
	GetStudent(id primitive.ObjectID) (*Student, error)
	RegisterSubject(subjectId primitive.ObjectID, userId primitive.ObjectID) error
	GetRegisteredSubjects(userId primitive.ObjectID) ([]*subject.Subject, error)
	RegisterTutor(tutorId primitive.ObjectID, userId primitive.ObjectID) error
	GetRegisteredTutors(userId primitive.ObjectID) ([]*utils.StudentRegisteredTutorRes, error)
}

type Student

type Student struct {
	Id primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	*user.User
	Subjects []primitive.ObjectID `json:"subjects" bson:"subjects"`
}

type StudentController

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

func NewStudentController

func NewStudentController(studentService IStudentService) *StudentController

func (*StudentController) GetRegisteredSubjects

func (sc *StudentController) GetRegisteredSubjects(c *gin.Context)

func (*StudentController) GetRegisteredTutors

func (sc *StudentController) GetRegisteredTutors(c *gin.Context)

func (*StudentController) Profile

func (sc *StudentController) Profile(c *gin.Context)

func (*StudentController) RegisterSubject

func (sc *StudentController) RegisterSubject(c *gin.Context)

func (*StudentController) RegisterTutor

func (sc *StudentController) RegisterTutor(c *gin.Context)

func (*StudentController) SignUp

func (sc *StudentController) SignUp(c *gin.Context)

type StudentRepo

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

func NewStudentRepo

func NewStudentRepo(db db.IDatabase) *StudentRepo

func (*StudentRepo) CreateStudent

func (sr *StudentRepo) CreateStudent(Student *Student) error

func (*StudentRepo) GetStudent

func (sr *StudentRepo) GetStudent(filter interface{}) (*Student, error)

func (*StudentRepo) StudentExists

func (sr *StudentRepo) StudentExists(filter interface{}) (bool, error)

func (*StudentRepo) UpdateStudent

func (sr *StudentRepo) UpdateStudent(filter interface{}, update interface{}) error

type StudentService

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

func NewStudentService

func NewStudentService(
	studentRepo IStudentRepo,
	verificationTokenManager utils.IVerificationTokenManager,
	accessTokenManager utils.IAccessTokenManager,
	emailManager utils.IEmailManager,
	subjectRepo subject.IStudentSubjectRepo,
	tutorRepo tutor.IStudentTutorRepo,
	studentSubjectTutorRepo subject.IStudentSubjectTutorRepo,
	baseUrl string,
) *StudentService

func (*StudentService) GetRegisteredSubjects

func (ss *StudentService) GetRegisteredSubjects(userId primitive.ObjectID) ([]*subject.Subject, error)

func (*StudentService) GetRegisteredTutors

func (ss *StudentService) GetRegisteredTutors(userId primitive.ObjectID) ([]*utils.StudentRegisteredTutorRes, error)

func (*StudentService) GetStudent

func (ss *StudentService) GetStudent(id primitive.ObjectID) (*Student, error)

func (*StudentService) RegisterSubject

func (ss *StudentService) RegisterSubject(subjectId primitive.ObjectID, userId primitive.ObjectID) error

func (*StudentService) RegisterTutor

func (ss *StudentService) RegisterTutor(tutorId primitive.ObjectID, userId primitive.ObjectID) error

func (*StudentService) SignUpStudent

func (ss *StudentService) SignUpStudent(student *Student) error

Jump to

Keyboard shortcuts

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