online-order/domain/product.go

34 lines
996 B
Go
Raw Normal View History

2023-10-27 22:12:56 +00:00
package domain
import (
"github.com/gin-gonic/gin"
"online-order/entity"
)
type ProductRepository interface {
List() ([]*entity.ProductDisplay, error)
2023-11-10 08:48:14 +00:00
ListProductPerCategory(slug string) ([]*entity.ProductDisplay, error)
2023-10-27 22:12:56 +00:00
Create(p *entity.ProductCreateUpdate) error
GetByID(id int) (*entity.ProductDisplay, error)
SearchProduct(identifier string) (*entity.ProductDisplay, error)
Update(p *entity.ProductCreateUpdate) error
Delete(id int) error
}
type ProductService interface {
List() ([]*entity.ProductDisplay, error)
2023-11-10 08:48:14 +00:00
ListProductPerCategory(slug string) ([]*entity.ProductDisplay, error)
2023-10-27 22:12:56 +00:00
Create(u *entity.ProductCreateUpdate) error
GetByID(id int) (*entity.ProductDisplay, error)
SearchProduct(identifier string) (*entity.ProductDisplay, error)
Update(u *entity.ProductCreateUpdate) error
Delete(id int) error
}
2023-10-29 23:33:40 +00:00
type ProductController interface {
2023-10-27 22:12:56 +00:00
listProduct(ctx *gin.Context)
getProduct(ctx *gin.Context)
updateProduct(ctx *gin.Context)
deleteProduct(ctx *gin.Context)
}