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"
|
||||
@@ -26,15 +26,15 @@ type AdminReportService interface {
|
||||
|
||||
// adminReportServiceImpl 管理端举报服务实现
|
||||
type adminReportServiceImpl 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
|
||||
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
|
||||
}
|
||||
|
||||
// NewAdminReportService 创建管理端举报服务
|
||||
@@ -50,15 +50,15 @@ func NewAdminReportService(
|
||||
logService OperationLogService,
|
||||
) AdminReportService {
|
||||
return &adminReportServiceImpl{
|
||||
reportRepo: reportRepo,
|
||||
postRepo: postRepo,
|
||||
commentRepo: commentRepo,
|
||||
messageRepo: messageRepo,
|
||||
userRepo: userRepo,
|
||||
notifyRepo: notifyRepo,
|
||||
pushService: pushService,
|
||||
txManager: txManager,
|
||||
logService: logService,
|
||||
reportRepo: reportRepo,
|
||||
postRepo: postRepo,
|
||||
commentRepo: commentRepo,
|
||||
messageRepo: messageRepo,
|
||||
userRepo: userRepo,
|
||||
notifyRepo: notifyRepo,
|
||||
pushService: pushService,
|
||||
txManager: txManager,
|
||||
logService: logService,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,9 +405,9 @@ func (s *adminReportServiceImpl) notifyReporter(ctx context.Context, report *mod
|
||||
// 创建通知
|
||||
notification := &model.SystemNotification{
|
||||
ReceiverID: report.ReporterID,
|
||||
Type: notifyType,
|
||||
Title: title,
|
||||
Content: content,
|
||||
Type: notifyType,
|
||||
Title: title,
|
||||
Content: content,
|
||||
ExtraData: &model.SystemNotificationExtra{
|
||||
ActorIDStr: report.ReporterID,
|
||||
TargetID: report.TargetID,
|
||||
@@ -467,4 +467,4 @@ func convertUserToBrief(user *model.User) *dto.UserResponse {
|
||||
return nil
|
||||
}
|
||||
return dto.ConvertUserToResponse(user)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user