follow

package
v0.0.0-...-75e0a89 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

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

func NewDelivery

func NewDelivery(db *gorm.DB, uc *Usecase) *Delivery

func (Delivery) Follow

func (d Delivery) Follow(ctx *gin.Context)

@Summary Follow User @Description Follow User @Accept json @Produce json @Tags Follow @Param data body FollowRequest true "data" @Success 200 {object} string @Router /follow/ [post]

func (Delivery) Followers

func (d Delivery) Followers(ctx *gin.Context)

@Summary Followers list @Description Followers list @Accept json @Produce json @Tags Follow @Param user_id path int true "user_id" @Success 200 {object} []models.Follow @Router /follow/followers/{user_id} [get]

func (Delivery) Leaders

func (d Delivery) Leaders(ctx *gin.Context)

@Summary Leaders list @Description Leaders list @Accept json @Produce json @Tags Follow @Param user_id path int true "user_id" @Success 200 {object} []models.Follow @Router /follow/leaders/{user_id} [get]

func (Delivery) UnFollow

func (d Delivery) UnFollow(ctx *gin.Context)

@Summary UnFollow User @Description UnFollow User @Accept json @Produce json @Tags Follow @Param data body FollowRequest true "data" @Success 200 {object} string @Router /follow/ [delete]

type FollowRequest

type FollowRequest struct {
	LeaderID   uint `json:"leader_id" binding:"required"`
	FollowerID uint `json:"follower_id" binding:"required"`
}

type Module

type Module struct {
	Usecase *Usecase
	// contains filtered or unexported fields
}

func NewModule

func NewModule(db *gorm.DB) *Module

func (*Module) SetupRoutes

func (m *Module) SetupRoutes(router *gin.RouterGroup)

type Usecase

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

func NewUsecase

func NewUsecase(db *gorm.DB) *Usecase

func (Usecase) Follow

func (u Usecase) Follow(leaderID, followerID uint) error

func (Usecase) Followers

func (u Usecase) Followers(leaderID uint, offset, limit int) []models.Follow

func (Usecase) IsFollow

func (u Usecase) IsFollow(followerID, leaderID uint) bool

func (Usecase) Leaders

func (u Usecase) Leaders(followerID uint, offset, limit int) []models.Follow

func (Usecase) UnFollow

func (u Usecase) UnFollow(leaderID, followerID uint) error

Jump to

Keyboard shortcuts

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