-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package repository | ||
|
||
import "github.com/hananloser/rest-fiber-mongo-2/entity" | ||
|
||
type ProductRepository interface { | ||
Insert(product entity.Product) | ||
|
||
GetProduct(products []entity.Product) | ||
|
||
Find(id int) | ||
|
||
DeleteAll() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package repository | ||
|
||
import ( | ||
"github.com/hananloser/rest-fiber-mongo-2/entity" | ||
"go.mongodb.org/mongo-driver/mongo" | ||
) | ||
|
||
type ProductRepositoryImpl struct { | ||
Collection *mongo.Collection | ||
} | ||
|
||
func (p ProductRepositoryImpl) Insert(product entity.Product) { | ||
panic("implement me") | ||
} | ||
|
||
func (p ProductRepositoryImpl) GetProduct(products []entity.Product) { | ||
panic("implement me") | ||
} | ||
|
||
func (p ProductRepositoryImpl) Find(id int) { | ||
panic("implement me") | ||
} | ||
|
||
func (p ProductRepositoryImpl) DeleteAll() { | ||
panic("implement me") | ||
} | ||
|
||
func NewProductRepository(database *mongo.Database) ProductRepository { | ||
return &ProductRepositoryImpl{Collection: database.Collection("product")} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package product | ||
|
||
import "github.com/hananloser/rest-fiber-mongo-2/model" | ||
|
||
// In Must Implements As Interface | ||
|
||
type ServiceProduct interface { | ||
// Inserting Product | ||
// return model.CreateProductResponse | ||
CreateProduct(product model.CreateProductRequest) model.CreateProductResponse | ||
|
||
FindProduct() | ||
|
||
DeleteProduct(id int) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters