feat: 接入旧站管理端并完整迁移后台能力

This commit is contained in:
yml
2026-11-12 22:03:01 +08:00
parent e5f923706b
commit a4441bba9a
509 changed files with 140714 additions and 1068 deletions
+18 -2
View File
@@ -1,6 +1,7 @@
package listing
import (
"context"
"errors"
"sync"
"time"
@@ -57,9 +58,24 @@ func (r *Repository) syncPublishedShelf(tx *gorm.DB, listing *model.RentalListin
return r.shelfSyncer.EnsureListingShelvedTx(tx, listing.ID, listing.AccountID)
}
func (r *Repository) IsQualityOwner(ctx context.Context, userID uint64) (bool, error) {
if r == nil || r.db == nil {
return false, ErrDependencyUnavailable
}
var status string
err := r.db.WithContext(ctx).Model(&model.User{}).
Where("id = ?", userID).
Pluck("quality_owner_status", &status).Error
if err != nil {
return false, err
}
return status == "active", nil
}
type publicZoneCountCache struct {
Counts map[string]int64
ExpiresAt time.Time
Counts map[string]int64
NonPremiumTotal int64
ExpiresAt time.Time
}
const publicZoneCountCacheTTL = 5 * time.Second