pg_order_repository.go 1.1 KB
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
}