chore: stabilize lint and verify builds

This commit is contained in:
2026-02-06 11:51:32 +08:00
parent edede17880
commit 1782f64417
114 changed files with 3032 additions and 1345 deletions

View File

@@ -92,6 +92,7 @@ func (s *user) ensureTenantMember(ctx context.Context, tenantID, userID int64) e
if errors.Is(err, gorm.ErrRecordNotFound) {
return errorx.ErrRecordNotFound.WithCause(err).WithMsg("租户不存在")
}
return errorx.ErrDatabaseError.WithCause(err)
}
if tenant.UserID == userID {
@@ -110,6 +111,7 @@ func (s *user) ensureTenantMember(ctx context.Context, tenantID, userID int64) e
if !exists {
return errorx.ErrForbidden.WithMsg("未加入该租户")
}
return nil
}
@@ -121,8 +123,10 @@ func (s *user) GetModelByID(ctx context.Context, userID int64) (*models.User, er
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errorx.ErrRecordNotFound
}
return nil, errorx.ErrDatabaseError.WithCause(err)
}
return u, nil
}
@@ -132,6 +136,7 @@ func (s *user) Me(ctx context.Context, userID int64) (*auth_dto.User, error) {
if err != nil {
return nil, err
}
return s.ToAuthUserDTO(u), nil
}
@@ -189,6 +194,7 @@ func (s *user) RealName(ctx context.Context, userID int64, form *user_dto.RealNa
if err != nil {
return errorx.ErrDatabaseError.WithCause(err)
}
return nil
}
@@ -219,6 +225,7 @@ func (s *user) GetNotifications(ctx context.Context, tenantID, userID int64, typ
Time: v.CreatedAt.Format(time.RFC3339),
}
}
return result, nil
}