service

package
v0.0.0-...-a9a82f6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(db *db.DB, cfg *config.Config, user repository.IUser, password repository.IPassword,
	session repository.ISession) *Auth

func (*Auth) GenerateCookie

func (s *Auth) GenerateCookie(ctx context.Context, userID int32) (*entity.Session, error)

func (*Auth) GetUserInfo

func (s *Auth) GetUserInfo(ctx context.Context, userID int32) (*entity.User, error)

func (*Auth) Login

func (s *Auth) Login(ctx context.Context, req *dto.LoginDTO) (*entity.User, error)

func (*Auth) Logout

func (s *Auth) Logout(ctx context.Context, sessionID int32) error

func (*Auth) Register

func (s *Auth) Register(ctx context.Context, req *dto.RegisterDTO) (*entity.User, error)

func (*Auth) ValidateCookie

func (s *Auth) ValidateCookie(ctx context.Context, sessionToken string) (*entity.Session, error)

type Event

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

func NewEvent

func NewEvent(db *db.DB, repository repository.IEvent) *Event

func (*Event) CreateEvent

func (s *Event) CreateEvent(ctx context.Context, userID int32, req *dto.CreateEventDTO) (*entity.Event, error)

func (*Event) CreateType

func (s *Event) CreateType(ctx context.Context, userID int32, req *dto.CreateEventTypeDTO) (*entity.EventType, error)

func (*Event) DeleteEvent

func (s *Event) DeleteEvent(ctx context.Context, userID int32, id int32) error

func (*Event) DeleteType

func (s *Event) DeleteType(ctx context.Context, userID int32, id int32) error

func (*Event) EditType

func (s *Event) EditType(ctx context.Context, userID int32, req *dto.EditEventTypeDTO) (*entity.EventType, error)

func (*Event) FriendsFeed

func (s *Event) FriendsFeed(ctx context.Context, userID int32) ([]*dto.FeedResponseDTO, int32, error)

func (*Event) ListEvent

func (s *Event) ListEvent(ctx context.Context, userID int32, req *dto.ListEventDTO) ([]*entity.Event, int32, error)

func (*Event) ListType

func (s *Event) ListType(ctx context.Context, userID int32) ([]*entity.EventType, int32, error)

type Friend

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

func NewFriend

func NewFriend(db *db.DB, repository repository.IFriend, user repository.IUser) *Friend

func (*Friend) AcceptFriendship

func (s *Friend) AcceptFriendship(ctx context.Context, userID, inviteID int32) error

func (*Friend) InviteFriend

func (s *Friend) InviteFriend(ctx context.Context, req *dto.InviteFriendDTO) error

func (*Friend) InviteListPending

func (s *Friend) InviteListPending(ctx context.Context, userID int32) ([]*dto.InviteListResponseDTO, int32, error)

func (*Friend) ListOfFriends

func (s *Friend) ListOfFriends(ctx context.Context, userID int32) ([]*entity.User, int32, error)

func (*Friend) RejectFriendship

func (s *Friend) RejectFriendship(ctx context.Context, userID, inviteID int32) error

type IAuth

type IAuth interface {
	Register(ctx context.Context, req *dto.RegisterDTO) (*entity.User, error)
	Login(ctx context.Context, req *dto.LoginDTO) (*entity.User, error)
	Logout(ctx context.Context, sessionID int32) error
	GenerateCookie(ctx context.Context, userID int32) (*entity.Session, error)
	ValidateCookie(ctx context.Context, session string) (*entity.Session, error)
	GetUserInfo(ctx context.Context, userID int32) (*entity.User, error)
}

type IEvent

type IEvent interface {
	CreateType(ctx context.Context, userID int32, req *dto.CreateEventTypeDTO) (*entity.EventType, error)
	DeleteType(ctx context.Context, userID int32, id int32) error
	ListType(ctx context.Context, userID int32) ([]*entity.EventType, int32, error)
	EditType(ctx context.Context, userID int32, req *dto.EditEventTypeDTO) (*entity.EventType, error)

	CreateEvent(ctx context.Context, userID int32, req *dto.CreateEventDTO) (*entity.Event, error)
	DeleteEvent(ctx context.Context, userID int32, id int32) error
	ListEvent(ctx context.Context, userId int32, req *dto.ListEventDTO) ([]*entity.Event, int32, error)

	FriendsFeed(ctx context.Context, userID int32) ([]*dto.FeedResponseDTO, int32, error)
}

type IFriend

type IFriend interface {
	InviteFriend(ctx context.Context, req *dto.InviteFriendDTO) error
	InviteListPending(ctx context.Context, userID int32) ([]*dto.InviteListResponseDTO, int32, error)
	AcceptFriendship(ctx context.Context, userID, inviteID int32) error
	RejectFriendship(ctx context.Context, userID, inviteID int32) error
	ListOfFriends(ctx context.Context, userID int32) ([]*entity.User, int32, error)
}

type ISystem

type ISystem interface {
	GetSwagger() ([]byte, error)
}

type IUser

type IUser interface {
	Get(ctx context.Context, id, userID int32) (*entity.User, error)

	Password(ctx context.Context, req *dto.UpdatePasswordDTO, userID int32) error
	UpdateProfile(ctx context.Context, req *dto.UpdateProfileDTO) (*entity.User, error)
	UpdateImage(ctx context.Context, req *dto.UpdateProfileImageDTO) (*entity.User, error)
}

type System

type System struct {
}

func NewSystem

func NewSystem() *System

func (*System) GetSwagger

func (s *System) GetSwagger() ([]byte, error)

type User

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

func NewUser

func NewUser(db *db.DB, repository repository.IUser, password repository.IPassword) *User

func (*User) Get

func (s *User) Get(ctx context.Context, id, userID int32) (*entity.User, error)

func (*User) Password

func (s *User) Password(ctx context.Context, req *dto.UpdatePasswordDTO, userID int32) error

func (*User) UpdateImage

func (s *User) UpdateImage(ctx context.Context, req *dto.UpdateProfileImageDTO) (*entity.User, error)

func (*User) UpdateProfile

func (s *User) UpdateProfile(ctx context.Context, req *dto.UpdateProfileDTO) (*entity.User, error)

Jump to

Keyboard shortcuts

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