pick

package
v0.0.0-...-b37d542 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrUpdateThemePicksForOwner

func AddOrUpdateThemePicksForOwner(ent *Entity) error

func GetThemePicks

func GetThemePicks(themeID primitive.ObjectID) (*[]Entity, error)

func GetThemePicksForOwner

func GetThemePicksForOwner(themeID, ownerID primitive.ObjectID) (*[]Entity, error)

Types

type DTO

type DTO struct {
	ThemeID primitive.ObjectID `json:"theme"`
	OwnerID primitive.ObjectID `json:"owner"`
	Tracks  []DTOTrack         `json:"tracks,omitempty"`
}

func (DTO) ToEntity

func (dto DTO) ToEntity() *Entity

type DTOReview

type DTOReview struct {
	OwnerID primitive.ObjectID `json:"owner_id"`
	Review  string             `json:"review,omitempty"`
}

type DTOTrack

type DTOTrack struct {
	ID      string      `json:"id"`
	Title   string      `json:"title,omitempty"`
	Artist  string      `json:"artist,omitempty"`
	Reason  string      `json:reason,omitempty`
	Reviews []DTOReview `json:"reviews,omitempty"`
}

type Entity

type Entity struct {
	ThemeID primitive.ObjectID `bson:"theme"`
	OwnerID primitive.ObjectID `bson:"owner"`
	Tracks  []EntityTrack      `bson:"tracks,omitempty"`
}

func (Entity) ToDTO

func (ent Entity) ToDTO() *DTO

type EntityReview

type EntityReview struct {
	OwnerID primitive.ObjectID `bson:"owner_id"`
	Review  string             `bson:"review,omitempty"`
}

type EntityTrack

type EntityTrack struct {
	ID      string         `bson:"id"`
	Title   string         `bson:"title,omitempty"`
	Artist  string         `bson:"artist,omitempty"`
	Reason  string         `bson:"reason,omitempty"`
	Reviews []EntityReview `bson:"reviews,omitempty"`
}

Jump to

Keyboard shortcuts

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