feat: 更新服务方法,显式接受用户ID参数,简化上下文调用
This commit is contained in:
@@ -50,7 +50,7 @@ func (s *NotificationTestSuite) Test_CRUD() {
|
||||
err := Notification.Send(ctx, uID, "system", "Welcome", "Hello World")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
list, err := Notification.List(ctx, 1, "")
|
||||
list, err := Notification.List(ctx, uID, 1, "")
|
||||
So(err, ShouldBeNil)
|
||||
So(list.Total, ShouldEqual, 1)
|
||||
|
||||
@@ -61,7 +61,7 @@ func (s *NotificationTestSuite) Test_CRUD() {
|
||||
// Mark Read
|
||||
// Need ID
|
||||
n, _ := models.NotificationQuery.WithContext(ctx).Where(models.NotificationQuery.UserID.Eq(uID)).First()
|
||||
err = Notification.MarkRead(ctx, cast.ToString(n.ID))
|
||||
err = Notification.MarkRead(ctx, uID, cast.ToString(n.ID))
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
nReload, _ := models.NotificationQuery.WithContext(ctx).Where(models.NotificationQuery.ID.Eq(n.ID)).First()
|
||||
|
||||
Reference in New Issue
Block a user