Documentation
¶
Index ¶
- type JWTService
- type Service
- type StudentService
- func (ss *StudentService) AttachStudent(userID int64, student models.StudentInsert) error
- func (ss *StudentService) CountAll() (int64, error)
- func (ss *StudentService) DetachStudent(userID int64) error
- func (ss *StudentService) GetAll() ([]models.StudentResponse, error)
- func (ss *StudentService) GetPage(pageInfo models.StudentPageRequest) ([]models.StudentResponse, error)
- func (ss *StudentService) GetStudentInfoFromUserID(userID int64) (models.StudentResponse, error)
- func (ss *StudentService) UpdateStudent(student models.StudentUpdate) error
- type UserService
- func (us *UserService) Attach(userAtatchID models.UserAttach) error
- func (us *UserService) Delete(userID int64) error
- func (us *UserService) Detach(userDetachID int64) (int64, error)
- func (us *UserService) GetProfile(userID int64) (models.UserResponse, error)
- func (us *UserService) Login(user models.UserAuth) (models.UserRole, error)
- func (us *UserService) Promote(userRole models.UserRole) error
- func (us *UserService) Register(user models.UserAuth) error
- func (us *UserService) Update(user models.UserUpdate) error
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 }
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 (ss *StudentService) GetPage(pageInfo models.StudentPageRequest) ([]models.StudentResponse, error)
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) GetProfile ¶
func (us *UserService) GetProfile(userID int64) (models.UserResponse, error)
func (*UserService) Update ¶
func (us *UserService) Update(user models.UserUpdate) error
Click to show internal directories.
Click to hide internal directories.