interest

package
v0.0.0-...-9a83fbb Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterestModule

func InterestModule(sb *server.ServerBuiler)

Types

type CreateInput

type CreateInput struct {
	UserId     string `json:"userId" binding:"required"`
	TargetId   string `json:"targetId" binding:"required"`
	TargetType string `json:"targetType" binding:"required"`
}

func (*CreateInput) ToEntity

func (c *CreateInput) ToEntity() *Interest

type Interest

type Interest struct {
	UserId     primitive.ObjectID `bson:"userId" json:"userId"`
	TargetId   string             `bson:"targetId" json:"targetId"`
	TargetType string             `bson:"targetType" json:"targetType"`
	CreatedAt  time.Time          `bson:"createdAt"`
}

type Repository

type Repository interface {
	ddd.Repository[Interest]

	SetInterest(ctx context.Context, ins *Interest) int
	GetManyByUsers(ctx context.Context, userIds []primitive.ObjectID, targetType string) []Interest
	GetUsers(ctx context.Context, targetId []string, targetType string) []Interest

	DeleteBy(ctx context.Context, userId primitive.ObjectID, targetId, targetType string) int
	CheckMany(ctx context.Context, userId []primitive.ObjectID, targetId []string, targetType string) []Interest
}

Jump to

Keyboard shortcuts

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