service

package
v0.0.0-...-256c714 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FriendServe

type FriendServe struct {
	Repo     repository.FriendRepository
	UserRepo repository.UserRepository
}

FriendServe

func NewFriendService

func NewFriendService(friendRepo repository.FriendRepository, userRepo repository.UserRepository) FriendServe

func (*FriendServe) AddFriend

func (FS *FriendServe) AddFriend(user, friend int64, ctx context.Context) error

func (*FriendServe) GetFriends

func (FS *FriendServe) GetFriends(user int64, ctx context.Context) ([]model.User, error)

func (*FriendServe) RemoveFriend

func (FS *FriendServe) RemoveFriend(user, friend int64, ctx context.Context) error

type FriendshipService

type FriendshipService interface {
	AddFriend(user, friend int64, ctx context.Context) error
	RemoveFriend(user, friend int64, ctx context.Context) error
	GetFriends(user int64, ctx context.Context) ([]model.User, error)
}

type UserServe

type UserServe struct {
	Repo repository.UserRepository
}

UserServe

func NewUserService

func NewUserService(userRepo repository.UserRepository) UserServe

func (*UserServe) CreateUser

func (US *UserServe) CreateUser(user *model.User, ctx context.Context) error

func (*UserServe) DeleteUser

func (US *UserServe) DeleteUser(id int64, ctx context.Context) error

func (*UserServe) GetUserByID

func (US *UserServe) GetUserByID(id int64, ctx context.Context) (*model.User, error)

func (*UserServe) ListUsers

func (US *UserServe) ListUsers(ctx context.Context) ([]model.User, error)

func (*UserServe) UpdateUser

func (US *UserServe) UpdateUser(user *model.User, ctx context.Context) error

type UserService

type UserService interface {
	CreateUser(user *model.User, ctx context.Context) error
	GetUserByID(id int64, ctx context.Context) (*model.User, error)
	ListUsers(ctx context.Context) ([]model.User, error)
	DeleteUser(id int64, ctx context.Context) error
	UpdateUser(user *model.User, ctx context.Context) error
}

Jump to

Keyboard shortcuts

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