user

package
v0.0.0-...-5d940fb Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Api

func Api(e *echo.Echo, userHandler Handler)

Types

type CreateUserRequest

type CreateUserRequest struct {
	FirstName  string `json:"first_name"`
	LastName   string `json:"last_name"`
	NationalID string `json:"national_id"`
}

type Handler

type Handler struct {
	Service
}

func MakeUserHandler

func MakeUserHandler(db *gorm.DB) Handler

func (Handler) CancelSignup

func (h Handler) CancelSignup(c echo.Context) error

func (Handler) Create

func (h Handler) Create(c echo.Context) error

func (Handler) DELETE

func (h Handler) DELETE(c echo.Context) error

func (Handler) List

func (h Handler) List(c echo.Context) error

func (Handler) Signup

func (h Handler) Signup(c echo.Context) error

type SQLUserRepo

type SQLUserRepo interface {
	Create(user *model.User) error
	ListAllWithFilter(page int, cancelled bool) ([]model.User, error)
	ListAll(page int) ([]model.User, error)
	FindUserByNationalID(nationalID string) (*model.User, error)
	DeleteUserByID(userID string) error
	SetUserCancelledToTrue(userID string) error
}

type Service

type Service struct {
	Repo SQLUserRepo
}

func (Service) CancelUserSignup

func (s Service) CancelUserSignup(UserID string) error

func (Service) CreateUser

func (s Service) CreateUser(req CreateUserRequest) (*model.User, error)

func (Service) DeleteUser

func (s Service) DeleteUser(userID string) error

func (Service) ListUsers

func (s Service) ListUsers(pageStr string, cancelledSubStr string) ([]model.User, error)

Jump to

Keyboard shortcuts

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