pg_order_repository.go
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package repository
import (
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
type OrderRepository struct {
transactionContext *transaction.TransactionContext
}
var (
_ domain.OrderRepository = (*OrderRepository)(nil)
)
func NewOrderRepository(transactionContext *transaction.TransactionContext) (*OrderRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
}
return &OrderRepository{transactionContext: transactionContext}, nil
}
func (reponsitory OrderRepository) transformPgModelToDomainModel(adminuserModel *models.Order) (domain.Order, error) {
result := domain.Order{}
return result, nil
}
func (repository OrderRepository) Save(orderInfo *domain.Order) error {
return nil
}
func (repository OrderRepository) Find() (*domain.Order, error) {
return nil, nil
}
func (repository OrderRepository) FindOne() ([]domain.Order, error) {
return nil, nil
}