usecase

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookmarkUseCase

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

func NewBookmarkUseCase

func NewBookmarkUseCase(bookmarkRepo models.BookmarkRepository) BookmarkUseCase

func (*BookmarkUseCase) CreateBookmark

func (u *BookmarkUseCase) CreateBookmark(ctx context.Context, userId, communityId int64) error

func (*BookmarkUseCase) DeleteBookmark

func (u *BookmarkUseCase) DeleteBookmark(ctx context.Context, userId int64, communityId int64) error

func (*BookmarkUseCase) ListBookmark

func (u *BookmarkUseCase) ListBookmark(ctx context.Context, userId int64) ([]models.Community, error)

type CommentUseCase

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

func NewCommentUseCase

func NewCommentUseCase(commentRepository models.CommentRepository, userRepository models.UserRepository) CommentUseCase

func (*CommentUseCase) GetComment

func (c *CommentUseCase) GetComment(ctx context.Context, userId, communityId, restaurantId int64) (string, error)

func (*CommentUseCase) SetComment

func (c *CommentUseCase) SetComment(ctx context.Context, userId, communityId, restaurantId int64, comment string) error

type CommunityUseCase

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

func NewCommunityUseCase

func NewCommunityUseCase(
	store session.Store,
	config *config.ServerConfig,
	communityRepository models.CommunityRepository,
	affiliationRepository models.AffiliationRepository,
	communityRestaurantsRepository models.CommunityRestaurantsRepository,
	inviteTokenRepository models.InviteTokenRepository,
	userRepository models.UserRepository,
) CommunityUseCase

func (*CommunityUseCase) GetCommunity

func (u *CommunityUseCase) GetCommunity(ctx context.Context, id int64) (*models.Community, error)

func (*CommunityUseCase) IssueInviteToken

func (u *CommunityUseCase) IssueInviteToken(ctx context.Context, issuerId int64, communityId int64) (*models.InviteToken, error)

func (*CommunityUseCase) ListRestaurants

func (u *CommunityUseCase) ListRestaurants(ctx context.Context, communityId int64) ([]*models.Restaurant, error)

func (*CommunityUseCase) ListUsers

func (u *CommunityUseCase) ListUsers(ctx context.Context, communityId int64) ([]*models.User, error)

func (*CommunityUseCase) NewCommunity

func (u *CommunityUseCase) NewCommunity(ctx context.Context, userId int64, name string, description string, loc models.Location) (*models.Community, error)

func (*CommunityUseCase) SearchCommunity

func (u *CommunityUseCase) SearchCommunity(ctx context.Context, keyword string) ([]*models.Community, error)

func (*CommunityUseCase) UpdateCommunity

func (u *CommunityUseCase) UpdateCommunity(ctx context.Context, userId, communityId int64, name string, description string, loc models.Location) (*models.Community, error)

type RestaurantUseCase

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

func NewRestaurantUseCase

func NewRestaurantUseCase(
	restaurantSearch restaurant_search.SearchApi, restaurantRepository models.RestaurantRepository,
	userRepository models.UserRepository, communityRestaurantsRepository models.CommunityRestaurantsRepository) RestaurantUseCase

func (RestaurantUseCase) AddRestaurantToCommunity

func (r RestaurantUseCase) AddRestaurantToCommunity(ctx context.Context, userId int64, communityId int64, restaurantId int64) error

func (RestaurantUseCase) GetOtherCommunitiesWithSameRestaurants

func (r RestaurantUseCase) GetOtherCommunitiesWithSameRestaurants(ctx context.Context, restaurantId, communityId int64) ([]*models.Community, error)

func (RestaurantUseCase) GetRestaurantById

func (r RestaurantUseCase) GetRestaurantById(ctx context.Context, id int64) (*models.Restaurant, error)

func (RestaurantUseCase) RemoveRestaurantFromCommunity

func (r RestaurantUseCase) RemoveRestaurantFromCommunity(ctx context.Context, userId int64, communityId int64, restaurantId int64) error

func (RestaurantUseCase) SearchRestaurant

func (r RestaurantUseCase) SearchRestaurant(ctx context.Context, keyword string, loc *models.Location) ([]*models.Restaurant, error)

type UserUseCase

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

func NewUserUseCase

func NewUserUseCase(
	store session.Store,
	userRepo models.UserRepository,
	affiliationRepo models.AffiliationRepository,
	inviteTokenRepository models.InviteTokenRepository,
	config *config.ServerConfig,
) UserUseCase

func (*UserUseCase) JoinCommunity

func (u *UserUseCase) JoinCommunity(ctx context.Context, userId int64, token string) error

func (*UserUseCase) LeaveCommunity

func (u *UserUseCase) LeaveCommunity(ctx context.Context, userId int64, communityId int64) error

func (*UserUseCase) ListUserCommunities

func (u *UserUseCase) ListUserCommunities(ctx context.Context, userId int64) ([]*models.Community, error)

func (*UserUseCase) MyUser

func (u *UserUseCase) MyUser(ctx context.Context, userId int64) (*models.UserDetail, error)

func (*UserUseCase) NewUser

func (u *UserUseCase) NewUser(ctx context.Context, name string, authVendor models.AuthVendor) (*models.User, *models.AuthInfo, error)

func (*UserUseCase) UpdateMe

func (u *UserUseCase) UpdateMe(ctx context.Context, userId int64, userName *string) (*models.User, error)

func (*UserUseCase) UpdateUserProfileImage

func (u *UserUseCase) UpdateUserProfileImage(ctx context.Context, userId int64, imageData []byte) (imageUrl string, e error)

Jump to

Keyboard shortcuts

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