feat(jpush): add vendor-specific message classification support for push notifications
- Add OPPO category/notify_level support (2024.11.20 regulation: category required when notify_level present) - Add Honor importance field (NORMAL=service/LOW=marketing) for notification classification - Add vivo category field (IM/ACCOUNT) for message scenario identification - Set Xiaomi channel/template defaults in code (system=153609, chat=153608, templates P10761/M10289) - Add classification option to JPush push payloads (0=operation, 1=system) - Update xiaomi template keywords mapping to match actual template placeholders - Add keyword search support for GetFollowers and GetFollowing endpoints - Bind new config fields to environment variables for OPPO/Honor/vivo
This commit is contained in:
@@ -42,10 +42,10 @@ type UserService interface {
|
||||
ResetPasswordByEmail(ctx context.Context, email, verificationCode, newPassword string) error
|
||||
|
||||
// 关注相关
|
||||
GetFollowers(ctx context.Context, userID string, page, pageSize int) ([]*model.User, int64, error)
|
||||
GetFollowing(ctx context.Context, userID string, page, pageSize int) ([]*model.User, int64, error)
|
||||
GetFollowingList(ctx context.Context, userID string, page, pageSize string) ([]*model.User, error)
|
||||
GetFollowersList(ctx context.Context, userID string, page, pageSize string) ([]*model.User, error)
|
||||
GetFollowers(ctx context.Context, userID, keyword string, page, pageSize int) ([]*model.User, int64, error)
|
||||
GetFollowing(ctx context.Context, userID, keyword string, page, pageSize int) ([]*model.User, int64, error)
|
||||
GetFollowingList(ctx context.Context, userID, page, pageSize, keyword string) ([]*model.User, error)
|
||||
GetFollowersList(ctx context.Context, userID, page, pageSize, keyword string) ([]*model.User, error)
|
||||
FollowUser(ctx context.Context, followerID, followeeID string) error
|
||||
UnfollowUser(ctx context.Context, followerID, followeeID string) error
|
||||
GetMutualFollowStatus(ctx context.Context, currentUserID string, targetUserIDs []string) (map[string][2]bool, error)
|
||||
@@ -475,13 +475,13 @@ func (s *userServiceImpl) UpdateUser(ctx context.Context, user *model.User) erro
|
||||
}
|
||||
|
||||
// GetFollowers 获取粉丝
|
||||
func (s *userServiceImpl) GetFollowers(ctx context.Context, userID string, page, pageSize int) ([]*model.User, int64, error) {
|
||||
return s.userRepo.GetFollowers(userID, page, pageSize)
|
||||
func (s *userServiceImpl) GetFollowers(ctx context.Context, userID, keyword string, page, pageSize int) ([]*model.User, int64, error) {
|
||||
return s.userRepo.GetFollowers(userID, keyword, page, pageSize)
|
||||
}
|
||||
|
||||
// GetFollowing 获取关注
|
||||
func (s *userServiceImpl) GetFollowing(ctx context.Context, userID string, page, pageSize int) ([]*model.User, int64, error) {
|
||||
return s.userRepo.GetFollowing(userID, page, pageSize)
|
||||
func (s *userServiceImpl) GetFollowing(ctx context.Context, userID, keyword string, page, pageSize int) ([]*model.User, int64, error) {
|
||||
return s.userRepo.GetFollowing(userID, keyword, page, pageSize)
|
||||
}
|
||||
|
||||
// FollowUser 关注用户
|
||||
@@ -597,7 +597,7 @@ func (s *userServiceImpl) IsBlockedBatch(ctx context.Context, blockerID string,
|
||||
}
|
||||
|
||||
// GetFollowingList 获取关注列表(字符串参数版本)
|
||||
func (s *userServiceImpl) GetFollowingList(ctx context.Context, userID, page, pageSize string) ([]*model.User, error) {
|
||||
func (s *userServiceImpl) GetFollowingList(ctx context.Context, userID, page, pageSize, keyword string) ([]*model.User, error) {
|
||||
pageInt := 1
|
||||
pageSizeInt := 20
|
||||
if page != "" {
|
||||
@@ -615,12 +615,12 @@ func (s *userServiceImpl) GetFollowingList(ctx context.Context, userID, page, pa
|
||||
}
|
||||
}
|
||||
|
||||
users, _, err := s.userRepo.GetFollowing(userID, pageInt, pageSizeInt)
|
||||
users, _, err := s.userRepo.GetFollowing(userID, keyword, pageInt, pageSizeInt)
|
||||
return users, err
|
||||
}
|
||||
|
||||
// GetFollowersList 获取粉丝列表(字符串参数版本)
|
||||
func (s *userServiceImpl) GetFollowersList(ctx context.Context, userID, page, pageSize string) ([]*model.User, error) {
|
||||
func (s *userServiceImpl) GetFollowersList(ctx context.Context, userID, page, pageSize, keyword string) ([]*model.User, error) {
|
||||
pageInt := 1
|
||||
pageSizeInt := 20
|
||||
if page != "" {
|
||||
@@ -638,7 +638,7 @@ func (s *userServiceImpl) GetFollowersList(ctx context.Context, userID, page, pa
|
||||
}
|
||||
}
|
||||
|
||||
users, _, err := s.userRepo.GetFollowers(userID, pageInt, pageSizeInt)
|
||||
users, _, err := s.userRepo.GetFollowers(userID, keyword, pageInt, pageSizeInt)
|
||||
return users, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user