fix: stabilize backend tests

This commit is contained in:
2026-01-08 14:07:58 +08:00
parent 7f1d2e7cb3
commit edbb62449b
18 changed files with 281 additions and 147 deletions

View File

@@ -3,6 +3,7 @@ package services
import (
"context"
"errors"
"quyun/v2/app/errorx"
"quyun/v2/app/http/v1/dto"
"quyun/v2/app/requests"
@@ -62,7 +63,7 @@ func (s *tenant) List(ctx context.Context, filter *dto.TenantListFilter) (*reque
}, nil
}
func (s *tenant) GetPublicProfile(ctx context.Context, userID int64, id int64) (*dto.TenantProfile, error) {
func (s *tenant) GetPublicProfile(ctx context.Context, userID, id int64) (*dto.TenantProfile, error) {
t, err := models.TenantQuery.WithContext(ctx).Where(models.TenantQuery.ID.Eq(id)).First()
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
@@ -102,7 +103,7 @@ func (s *tenant) GetPublicProfile(ctx context.Context, userID int64, id int64) (
}, nil
}
func (s *tenant) Follow(ctx context.Context, userID int64, id int64) error {
func (s *tenant) Follow(ctx context.Context, userID, id int64) error {
if userID == 0 {
return errorx.ErrUnauthorized
}
@@ -131,7 +132,7 @@ func (s *tenant) Follow(ctx context.Context, userID int64, id int64) error {
return nil
}
func (s *tenant) Unfollow(ctx context.Context, userID int64, id int64) error {
func (s *tenant) Unfollow(ctx context.Context, userID, id int64) error {
if userID == 0 {
return errorx.ErrUnauthorized
}