pg_order_log_repository.go
1.2 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
41
42
43
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 OrderLogRepository struct {
transactionContext *transaction.TransactionContext
}
func NewOrderInfoRepository(transactionContext *transaction.TransactionContext) (*OrderLogRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
}
return &OrderLogRepository{transactionContext: transactionContext}, nil
}
func (reponsitory OrderLogRepository) transformPgModelToDomainModel(m *models.OrderLog) (data domain.OrderLog, err error) {
return domain.OrderLog{
OrderId: m.OrderId,
Operator: m.Operator,
OperatorId: m.OperatorId,
OperatorType: m.OperatorType,
AlterTime: m.AlterTime,
LogAction: m.LogAction,
Descript: m.Descript,
DataFrom: m.DataFrom,
Content: m.Content,
}, nil
}
func (reponsitory OrderLogRepository) Add(data domain.OrderLog) error {
return nil
}
func (reponsitory OrderLogRepository) Find(data domain.OrderLog) ([]domain.OrderLog, int, error) {
return nil, 0, nil
}