22 lines
427 B
Go
22 lines
427 B
Go
package data
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func orderRepo() *OrderRepo {
|
|
db := Conn()
|
|
return NewOrderRepo(db)
|
|
}
|
|
func TestOrderRepo_List(t *testing.T) {
|
|
repo := orderRepo()
|
|
begin := time.Date(2022, 10, 1, 0, 0, 0, 0, time.Local)
|
|
end := time.Date(2022, 12, 1, 0, 0, 0, 0, time.Local)
|
|
orders, err := repo.List(context.Background(), begin, end, 10, "123")
|
|
fmt.Println(err)
|
|
fmt.Printf("%+v\n", orders)
|
|
}
|