vproductapp

package
v0.0.0-...-99a89de Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package vproductapp maintains the app layer api for the vproduct domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the view product domain.

func NewApp

func NewApp(vproductBus *vproductbus.Business) *App

NewApp constructs a view product app API for use.

func (*App) Query

func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[Product], error)

Query returns a list of products with paging.

type Product

type Product struct {
	ID          string  `json:"id"`
	UserID      string  `json:"userID"`
	Name        string  `json:"name"`
	Cost        float64 `json:"cost"`
	Quantity    int     `json:"quantity"`
	DateCreated string  `json:"dateCreated"`
	DateUpdated string  `json:"dateUpdated"`
	UserName    string  `json:"userName"`
}

Product represents information about an individual product with extended information.

func (Product) Encode

func (app Product) Encode() ([]byte, string, error)

Encode implments the encoder interface.

type QueryParams

type QueryParams struct {
	Page     string
	Rows     string
	OrderBy  string
	ID       string
	Name     string
	Cost     string
	Quantity string
	UserName string
}

QueryParams represents the set of possible query strings.

Jump to

Keyboard shortcuts

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