feat: update medias

This commit is contained in:
yanghao05
2025-04-09 19:08:35 +08:00
parent f328de00fd
commit 1ef2f9318e
5 changed files with 28 additions and 10 deletions

View File

@@ -167,20 +167,20 @@ func (s *MediasTestSuite) Test_Page() {
Convey("Page", func() {
Convey("page 1", func() {
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 1, Limit: 10})
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 1, Limit: 10}, nil)
So(err, ShouldBeNil)
So(pager.Total, ShouldEqual, 20)
So(pager.Items, ShouldHaveLength, 10)
})
Convey("page 2", func() {
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 2, Limit: 10})
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 2, Limit: 10}, nil)
So(err, ShouldBeNil)
So(pager.Total, ShouldEqual, 20)
So(pager.Items, ShouldHaveLength, 10)
})
Convey("page 3", func() {
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 3, Limit: 10})
pager, err := Medias.List(context.Background(), &requests.Pagination{Page: 3, Limit: 10}, nil)
So(err, ShouldBeNil)
So(pager.Total, ShouldEqual, 20)
So(pager.Items, ShouldBeEmpty)