store

package
v0.0.0-...-73eed44 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IStoreRepository

type IStoreRepository interface {
	Create(store *Store) (*Store, error)
	GetStore(id string) (*Store, error)
	GetStores(filter interface{}) (*[]Store, error)
	GetStoresByUser(userId string) (*[]Store, error)
	GetStoreByToken(token string) (*Store, error)
	UpdateStore(store *Store) (*Store, error)
}

type Store

type Store struct {
	Id          primitive.ObjectID `bson:"_id"`
	Name        string
	OwnerId     primitive.ObjectID
	Token       string
	Description string
	AvatarId    string
}

type StoreController

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

func NewStoreController

func NewStoreController(auth auth.Auth, sr StoreRepository, ur user.UserRepository) StoreController

func (StoreController) CreateStore

func (sc StoreController) CreateStore(c *gin.Context)

func (StoreController) GetStore

func (sc StoreController) GetStore(c *gin.Context)

func (StoreController) GetStores

func (sc StoreController) GetStores(c *gin.Context)

func (StoreController) GetStoresByUser

func (sc StoreController) GetStoresByUser(c *gin.Context)

type StoreCreateRequest

type StoreCreateRequest struct {
	Name        string
	Description string
	AvatarId    string
}

type StoreCreateResponse

type StoreCreateResponse struct {
	Id          string
	Name        string
	Description string
	AvatarId    string
}

type StoreGetRequest

type StoreGetRequest struct {
	Id string `json:"Id"`
}

type StoreGetResponse

type StoreGetResponse struct {
	Id          primitive.ObjectID
	Name        string
	Description string
	AvatarId    string
}

type StoreRepository

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

func NewStoreRepository

func NewStoreRepository(client *mongo.Client) StoreRepository

func (StoreRepository) Create

func (sr StoreRepository) Create(store *Store) (*Store, error)

func (StoreRepository) GetStore

func (sr StoreRepository) GetStore(id string) (*Store, error)

func (StoreRepository) GetStoreByToken

func (sr StoreRepository) GetStoreByToken(token string) (*Store, error)

func (StoreRepository) GetStores

func (sr StoreRepository) GetStores(filter interface{}) (*[]Store, error)

func (StoreRepository) GetStoresByUser

func (sr StoreRepository) GetStoresByUser(userId string) (*[]Store, error)

func (StoreRepository) UpdateStore

func (sr StoreRepository) UpdateStore(store *Store) (*Store, error)

type StoresGetRequest

type StoresGetRequest struct {
	UserId string
}

Jump to

Keyboard shortcuts

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