Skip to content

Commit 91e99c4

Browse files
committed
add product use case implementation
1 parent 2b6c442 commit 91e99c4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

controller/product_controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import (
77
"github.com/gin-gonic/gin"
88
)
99

10-
type productController struct{}
10+
type productController struct {
11+
productUseCase usecase.ProductUseCase
12+
}
1113

1214
func NewProductController() *productController {
1315
return &productController{}

usecase/product_usecase.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package usecase
2+
3+
import "api-go/model"
4+
5+
type ProductUseCase struct {
6+
}
7+
8+
func NewProductuUseCase() *productUseCase {
9+
return &productUseCase{}
10+
}
11+
12+
func (pu *productUseCase) GetProducts([]model.Product, error) {
13+
return []model.Product{}, nil
14+
}

0 commit comments

Comments
 (0)