refactor: unify code formatting and improve push/search implementations
- Remove BOM from all Go source files - Standardize import ordering and whitespace across handlers and services - Replace PostgreSQL full-text search with ILIKE pattern matching in post and user repositories - Enhance JPush client with TLS transport, rate limit monitoring, and simplified API - Refactor PushService to include userID in device management methods - Add MaxDevicesPerUser limit and extract helper functions for push payload construction
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package service
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -22,16 +22,16 @@ type ReportService interface {
|
||||
|
||||
// reportServiceImpl 举报服务实现
|
||||
type reportServiceImpl struct {
|
||||
reportRepo repository.ReportRepository
|
||||
postRepo repository.PostRepository
|
||||
commentRepo repository.CommentRepository
|
||||
messageRepo repository.MessageRepository
|
||||
userRepo repository.UserRepository
|
||||
notifyRepo repository.SystemNotificationRepository
|
||||
pushService PushService
|
||||
txManager repository.TransactionManager
|
||||
logService OperationLogService
|
||||
config *config.ReportConfig
|
||||
reportRepo repository.ReportRepository
|
||||
postRepo repository.PostRepository
|
||||
commentRepo repository.CommentRepository
|
||||
messageRepo repository.MessageRepository
|
||||
userRepo repository.UserRepository
|
||||
notifyRepo repository.SystemNotificationRepository
|
||||
pushService PushService
|
||||
txManager repository.TransactionManager
|
||||
logService OperationLogService
|
||||
config *config.ReportConfig
|
||||
}
|
||||
|
||||
// NewReportService 创建举报服务
|
||||
@@ -52,16 +52,16 @@ func NewReportService(
|
||||
reportConfig.AutoHideThreshold = 3
|
||||
}
|
||||
return &reportServiceImpl{
|
||||
reportRepo: reportRepo,
|
||||
postRepo: postRepo,
|
||||
commentRepo: commentRepo,
|
||||
messageRepo: messageRepo,
|
||||
userRepo: userRepo,
|
||||
notifyRepo: notifyRepo,
|
||||
pushService: pushService,
|
||||
txManager: txManager,
|
||||
logService: logService,
|
||||
config: reportConfig,
|
||||
reportRepo: reportRepo,
|
||||
postRepo: postRepo,
|
||||
commentRepo: commentRepo,
|
||||
messageRepo: messageRepo,
|
||||
userRepo: userRepo,
|
||||
notifyRepo: notifyRepo,
|
||||
pushService: pushService,
|
||||
txManager: txManager,
|
||||
logService: logService,
|
||||
config: reportConfig,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,4 +214,4 @@ func (s *reportServiceImpl) hideTargetContent(ctx context.Context, targetType mo
|
||||
return s.messageRepo.UpdateMessageStatus(targetID, model.MessageStatusDeleted)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user