predict

package
v0.0.0-...-cc18f3c Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoute

func RegisterRoute(s server.Server, c IController)

Types

type History

type History struct {
	Id        string `json:"id" db:"id"`
	CreatedAt string `json:"created_at" db:"created_at"`
	Result    `json:"result"`
	UserId    string `json:"user_id"`
}

type IController

type IController interface {
	DetectFood(ctx echo.Context) error
}

func NewController

func NewController(s IService, l *logrus.Logger) IController

type IRepository

type IRepository interface {
	InsertHistory(ctx context.Context, history History) error
	GetFoodDetailByCategory(ctx context.Context, category string) (foods.Food, error)
}

func NewRepository

func NewRepository(db *sqlx.DB, l *logrus.Logger) IRepository

type IService

type IService interface {
	DetectFoodUsingExternal(ctx echo.Context) (PredictResponse, error)
}

func NewService

func NewService(r IRepository, l *logrus.Logger) IService

type Predict

type Predict struct {
	Id          string `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	Category    string `json:"category" db:"category"`
	CreatedAt   string `json:"created_at" db:"created_at"`
	Description string `json:"description" db:"description"`
	Image       string `json:"image" db:"image"`
}

type PredictResponse

type PredictResponse struct {
	Category    string `json:"category"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Image       string `json:"image"`
}

type Result

type Result struct {
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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