service

package
v0.0.0-...-b0ec221 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTService

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

func NewJWTService

func NewJWTService(cfg config.JWT) *JWTService

func (*JWTService) GenerateToken

func (j *JWTService) GenerateToken(user models.UserRole) (string, error)

func (*JWTService) ParseToken

func (j *JWTService) ParseToken(tok string) (*models.UserRole, error)

type Service

type Service struct {
	UserService    *UserService
	StudentService *StudentService
	JWTService     *JWTService
}

func NewService

func NewService(st *store.Store, jwtConfig config.JWT) *Service

type StudentService

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

func NewStudentService

func NewStudentService(repo *store.StudentRepository, us *UserService) *StudentService

func (*StudentService) AttachStudent

func (ss *StudentService) AttachStudent(userID int64, student models.StudentInsert) error

func (*StudentService) CountAll

func (ss *StudentService) CountAll() (int64, error)

func (*StudentService) DetachStudent

func (ss *StudentService) DetachStudent(userID int64) error

func (*StudentService) GetAll

func (ss *StudentService) GetAll() ([]models.StudentResponse, error)

func (*StudentService) GetPage

func (*StudentService) GetStudentInfoFromUserID

func (ss *StudentService) GetStudentInfoFromUserID(userID int64) (models.StudentResponse, error)

func (*StudentService) UpdateStudent

func (ss *StudentService) UpdateStudent(student models.StudentUpdate) error

type UserService

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

func NewUserService

func NewUserService(repo *store.UserRepository) *UserService

func (*UserService) Attach

func (us *UserService) Attach(userAtatchID models.UserAttach) error

func (*UserService) Delete

func (us *UserService) Delete(userID int64) error

func (*UserService) Detach

func (us *UserService) Detach(userDetachID int64) (int64, error)

func (*UserService) GetProfile

func (us *UserService) GetProfile(userID int64) (models.UserResponse, error)

func (*UserService) Login

func (us *UserService) Login(user models.UserAuth) (models.UserRole, error)

func (*UserService) Promote

func (us *UserService) Promote(userRole models.UserRole) error

func (*UserService) Register

func (us *UserService) Register(user models.UserAuth) error

func (*UserService) Update

func (us *UserService) Update(user models.UserUpdate) error

Jump to

Keyboard shortcuts

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