feat: add uuid for medias

This commit is contained in:
Rogee
2024-12-04 15:47:48 +08:00
parent 774f8644ab
commit 385c1b1e2f
5 changed files with 14 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import (
"backend/pkg/pg"
. "github.com/go-jet/jet/v2/postgres"
"github.com/google/uuid"
"github.com/samber/lo"
. "github.com/smartystreets/goconvey/convey"
)
@@ -77,6 +78,7 @@ func TestService_List(t *testing.T) {
Convey("insert medias data", func() {
items := []model.Medias{
{
UUID: uuid.New(),
TenantID: 1,
Title: "title1",
Description: "hello",
@@ -84,6 +86,7 @@ func TestService_List(t *testing.T) {
Publish: true,
},
{
UUID: uuid.New(),
TenantID: 1,
Title: "title2",
Description: "hello",
@@ -91,6 +94,7 @@ func TestService_List(t *testing.T) {
Publish: true,
},
{
UUID: uuid.New(),
TenantID: 1,
Title: "title3",
Description: "hello",
@@ -101,6 +105,7 @@ func TestService_List(t *testing.T) {
tbl := table.Medias
stmt := tbl.INSERT(
tbl.UUID,
tbl.TenantID,
tbl.Title,
tbl.Description,