|
|
|
@ -42,7 +42,7 @@ func UpdateReport(appId string, report *pb.Report) error {
|
|
|
|
func GetRank(appId string, topCount int32) ([]*pb.Audience, error) {
|
|
|
|
func GetRank(appId string, topCount int32) ([]*pb.Audience, error) {
|
|
|
|
ctx := context.Background()
|
|
|
|
ctx := context.Background()
|
|
|
|
key := ThisWeekScoreKey(appId)
|
|
|
|
key := ThisWeekScoreKey(appId)
|
|
|
|
cmd := client.ZRevRangeWithScores(ctx, key, 0, int64(topCount))
|
|
|
|
cmd := client.ZRangeWithScores(ctx, key, 0, int64(topCount))
|
|
|
|
result, err := cmd.Result()
|
|
|
|
result, err := cmd.Result()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
|