Commit 453f64c4 by 周君强

1.排行榜模块实现;

parent 26a780a3
...@@ -540,6 +540,19 @@ public class Constants { ...@@ -540,6 +540,19 @@ public class Constants {
*/ */
public static final String HELP_FRIEND_OPERATE = "帮助好友"; public static final String HELP_FRIEND_OPERATE = "帮助好友";
/**
* 财富榜
*/
public static final String MONEY_RANKING = "财富榜";
/**
* 战斗榜
*/
public static final String FIGHT_RANKING = "偷菜榜";
/**
* 友情榜
*/
public static final String FRIENDSHIP_RANKING = "友情榜";;
/** /**
* 翻页查看,每页3个 * 翻页查看,每页3个
......
package com.qiwuai.garden.common; package com.qiwuai.garden.common;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.qiwuai.garden.common.utils.HttpUtil; import com.qiwuai.garden.common.utils.HttpUtil;
import com.qiwuai.garden.common.utils.PersistenceUtil;
import com.qiwuai.garden.common.utils.RankingUtil;
import com.qiwuai.garden.common.utils.TypeConvertUtil; import com.qiwuai.garden.common.utils.TypeConvertUtil;
import com.qiwuai.garden.dao.*; import com.qiwuai.garden.dao.*;
import com.qiwuai.garden.dto.GardenerDto; import com.qiwuai.garden.dto.*;
import com.qiwuai.garden.dto.PlantPeriodDto;
import com.qiwuai.garden.dto.RegionDto;
import com.qiwuai.garden.pojo.*; import com.qiwuai.garden.pojo.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -497,6 +499,42 @@ public class InitSysServlet implements InitializingBean { ...@@ -497,6 +499,42 @@ public class InitSysServlet implements InitializingBean {
// log.info("缓存中玩家地址对应的地区信息" + TimingAcquisition.addressMap); // log.info("缓存中玩家地址对应的地区信息" + TimingAcquisition.addressMap);
log.info("玩家地址对应的地区信息缓存完成"); log.info("玩家地址对应的地区信息缓存完成");
//----------------------缓存排行榜信息----------------------------
//世界财富排行榜
TimingAcquisition.moneyRankingList.clear();
List<PlayerTimesDto> moneyRankingList = RankingUtil.moneyRankingListSort();
TimingAcquisition.moneyRankingList.addAll(moneyRankingList);
//世界战斗排行榜
TimingAcquisition.fightRankingList.clear();
List<PlayerTimesDto> fightRankingList = RankingUtil.fightRankingListSort();
TimingAcquisition.fightRankingList.addAll(fightRankingList);
//世界友情排行榜
TimingAcquisition.friendshipRankingList.clear();
List<PlayerTimesDto> friendshipRankingList = RankingUtil.friendshipRankingListSort();
TimingAcquisition.friendshipRankingList.addAll(friendshipRankingList);
//获取所有地区
String fileName = "region.json";
String s = PersistenceUtil.getConfigFromFile(fileName);
Map<String, List<RegionIPDto>> IPRegionsMap = JSON.parseObject(s, new TypeReference<Map<String, List<RegionIPDto>>>(){});
for (Map.Entry<String, List<RegionIPDto>> entry : IPRegionsMap.entrySet()) {
List<RegionIPDto> regionIPList = entry.getValue();
for (RegionIPDto regionIP : regionIPList) {
if (regionIP.getPopulation() > 0) {
String place = regionIP.getPlace();
//地区财富排行榜
List<PlayerTimesDto> regionMoneyRankingList = RankingUtil.regionMoneyRankingListSort(place);
TimingAcquisition.regionMoneyRankingListMap.put(place, regionMoneyRankingList);
//地区战斗排行榜
List<PlayerTimesDto> regionFightRankingList = RankingUtil.regionFightRankingListSort(place);
TimingAcquisition.regionFightRankingListMap.put(place, regionFightRankingList);
//地区友情排行榜
List<PlayerTimesDto> regionFriendshipRankingList = RankingUtil.regionFriendshipRankingListSort(place);
TimingAcquisition.regionFriendShipRankingListMap.put(place, regionFriendshipRankingList);
}
}
}
//----------------------更新动态词组到bot服务器------------------------ //----------------------更新动态词组到bot服务器------------------------
// log.info("开始更新所有动态词组"); // log.info("开始更新所有动态词组");
// TimingAcquisition.updatePhraseToBotServer(); // TimingAcquisition.updatePhraseToBotServer();
......
...@@ -59,6 +59,32 @@ public class TimingAcquisition { ...@@ -59,6 +59,32 @@ public class TimingAcquisition {
* 给玩家的建议中所有操作和变量保存: Map<uid, 操作列表> * 给玩家的建议中所有操作和变量保存: Map<uid, 操作列表>
*/ */
public volatile static Map<String, List<AdviseOperateDto>> adviseOperateMap = new ConcurrentHashMap<>(); public volatile static Map<String, List<AdviseOperateDto>> adviseOperateMap = new ConcurrentHashMap<>();
/**
* 世界财富榜
*/
public volatile static List<PlayerTimesDto> moneyRankingList = new ArrayList<>();
/**
* 世界战斗榜
*/
public volatile static List<PlayerTimesDto> fightRankingList = new ArrayList<>();
/**
* 世界友情榜
*/
public volatile static List<PlayerTimesDto> friendshipRankingList = new ArrayList<>();
/**
* 地区财富榜
*/
public volatile static Map<String, List<PlayerTimesDto>> regionMoneyRankingListMap = new ConcurrentHashMap<>();
/**
* 地区战斗榜
*/
public volatile static Map<String, List<PlayerTimesDto>> regionFightRankingListMap = new ConcurrentHashMap<>();
/**
* 地区友情榜
*/
public volatile static Map<String, List<PlayerTimesDto>> regionFriendShipRankingListMap = new ConcurrentHashMap<>();
/** /**
* 地区与服务器对应的配置信息 * 地区与服务器对应的配置信息
...@@ -206,6 +232,10 @@ public class TimingAcquisition { ...@@ -206,6 +232,10 @@ public class TimingAcquisition {
* 建议模块话术 * 建议模块话术
*/ */
public volatile static Map<String, Map<String, List<String>>> adviseSpeechMap = new ConcurrentHashMap<>(); public volatile static Map<String, Map<String, List<String>>> adviseSpeechMap = new ConcurrentHashMap<>();
/**
* 排行榜模块话术
*/
public volatile static Map<String, Map<String, List<String>>> rankingSpeechMap = new ConcurrentHashMap<>();
/** /**
...@@ -252,15 +282,17 @@ public class TimingAcquisition { ...@@ -252,15 +282,17 @@ public class TimingAcquisition {
Map<String, Map<String, List<String>>> taskSpeech = new HashMap<>(); Map<String, Map<String, List<String>>> taskSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> helpSpeech = new HashMap<>(); Map<String, Map<String, List<String>>> helpSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> adviseSpeech = new HashMap<>(); Map<String, Map<String, List<String>>> adviseSpeech = new HashMap<>();
Map<String, Map<String, List<String>>> rankingSpeech = new HashMap<>();
try { try {
plantSpeech = YamlUtil.plantSpeechToMap(); plantSpeech = YamlUtil.loadSpeechToMap("plant.yaml");
gardenerSpeech = YamlUtil.gardenerSpeechToMap(); gardenerSpeech = YamlUtil.loadSpeechToMap("gardener.yaml");
petSpeech = YamlUtil.petSpeechToMap(); petSpeech = YamlUtil.loadSpeechToMap("pet.yaml");
marketSpeech = YamlUtil.marketSpeechToMap(); marketSpeech = YamlUtil.loadSpeechToMap("market.yaml");
socialSpeech = YamlUtil.socialSpeechToMap(); socialSpeech = YamlUtil.loadSpeechToMap("social.yaml");
taskSpeech = YamlUtil.taskSpeechToMap(); taskSpeech = YamlUtil.loadSpeechToMap("task.yaml");
helpSpeech = YamlUtil.helpSpeechToMap(); helpSpeech = YamlUtil.loadSpeechToMap("help.yaml");
adviseSpeech = YamlUtil.adviseSpeechToMap(); adviseSpeech = YamlUtil.loadSpeechToMap("advise.yaml");
rankingSpeech = YamlUtil.loadSpeechToMap("ranking.yaml");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -280,6 +312,7 @@ public class TimingAcquisition { ...@@ -280,6 +312,7 @@ public class TimingAcquisition {
taskSpeechMap.putAll(taskSpeech); taskSpeechMap.putAll(taskSpeech);
helpSpeechMap.putAll(helpSpeech); helpSpeechMap.putAll(helpSpeech);
adviseSpeechMap.putAll(adviseSpeech); adviseSpeechMap.putAll(adviseSpeech);
rankingSpeechMap.putAll(rankingSpeech);
// log.info("缓存中玩家的种植话术:" + plantSpeechMap); // log.info("缓存中玩家的种植话术:" + plantSpeechMap);
// log.info("缓存中玩家的园丁话术:" + gardenerSpeechMap); // log.info("缓存中玩家的园丁话术:" + gardenerSpeechMap);
// log.info("缓存中玩家的宠物话术:" + petSpeechMap); // log.info("缓存中玩家的宠物话术:" + petSpeechMap);
......
package com.qiwuai.garden.common.schedule; package com.qiwuai.garden.common.schedule;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.qiwuai.garden.common.Constants; import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.common.TimingAcquisition; import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.common.utils.PersistenceUtil;
import com.qiwuai.garden.common.utils.RankingUtil;
import com.qiwuai.garden.common.utils.TypeConvertUtil; import com.qiwuai.garden.common.utils.TypeConvertUtil;
import com.qiwuai.garden.dto.BackPackDto; import com.qiwuai.garden.dto.*;
import com.qiwuai.garden.dto.ItemBagDto;
import com.qiwuai.garden.dto.ItemDto;
import com.qiwuai.garden.dto.NurseryInfoDto;
import com.qiwuai.garden.pojo.ItemPojo; import com.qiwuai.garden.pojo.ItemPojo;
import com.qiwuai.garden.pojo.PetPojo; import com.qiwuai.garden.pojo.PetPojo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -101,6 +102,46 @@ public class ScheduleTask { ...@@ -101,6 +102,46 @@ public class ScheduleTask {
} }
} }
@Scheduled(cron = "0 0 3 * * ?")
// @Scheduled(cron = "0 */2 * * * ?")
public void updateRanking() {
log.info("----------------开始更新排行榜----------------");
//世界财富排行榜
TimingAcquisition.moneyRankingList.clear();
List<PlayerTimesDto> moneyRankingList = RankingUtil.moneyRankingListSort();
TimingAcquisition.moneyRankingList.addAll(moneyRankingList);
//世界战斗排行榜
TimingAcquisition.fightRankingList.clear();
List<PlayerTimesDto> fightRankingList = RankingUtil.fightRankingListSort();
TimingAcquisition.fightRankingList.addAll(fightRankingList);
//世界友情排行榜
TimingAcquisition.friendshipRankingList.clear();
List<PlayerTimesDto> friendshipRankingList = RankingUtil.friendshipRankingListSort();
TimingAcquisition.friendshipRankingList.addAll(friendshipRankingList);
//获取所有地区
String fileName = "region.json";
String s = PersistenceUtil.getConfigFromFile(fileName);
Map<String, List<RegionIPDto>> IPRegionsMap = JSON.parseObject(s, new TypeReference<Map<String, List<RegionIPDto>>>(){});
for (Map.Entry<String, List<RegionIPDto>> entry : IPRegionsMap.entrySet()) {
List<RegionIPDto> regionIPList = entry.getValue();
for (RegionIPDto regionIP : regionIPList) {
if (regionIP.getPopulation() > 0) {
String place = regionIP.getPlace();
//地区财富排行榜
List<PlayerTimesDto> regionMoneyRankingList = RankingUtil.regionMoneyRankingListSort(place);
TimingAcquisition.regionMoneyRankingListMap.put(place, regionMoneyRankingList);
//地区战斗排行榜
List<PlayerTimesDto> regionFightRankingList = RankingUtil.regionFightRankingListSort(place);
TimingAcquisition.regionFightRankingListMap.put(place, regionFightRankingList);
//地区友情排行榜
List<PlayerTimesDto> regionFriendshipRankingList = RankingUtil.regionFriendshipRankingListSort(place);
TimingAcquisition.regionFriendShipRankingListMap.put(place, regionFriendshipRankingList);
}
}
}
log.info("----------------排行榜更新完成----------------");
}
/** /**
* 喂养宠物栏中的宠物 * 喂养宠物栏中的宠物
* @param uid * @param uid
......
...@@ -16,6 +16,7 @@ import org.slf4j.Logger; ...@@ -16,6 +16,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -519,6 +520,38 @@ public class RequestConversionUtil { ...@@ -519,6 +520,38 @@ public class RequestConversionUtil {
if (!StringUtils.isEmpty(time)) { if (!StringUtils.isEmpty(time)) {
operationRequest.setTime(Integer.valueOf(time)); operationRequest.setTime(Integer.valueOf(time));
} }
//--------存在榜单-----------
String ranking = callRequest.get榜单();
if (!StringUtils.isEmpty(ranking)) {
operationRequest.setRankingName(ranking);
}
//-----------存在排行榜序号--------------
String rankingNum = callRequest.get排行榜序号();
if (!StringUtils.isEmpty(rankingNum)) {
//找到中文数字对应的阿拉伯数字
Integer number = TypeConvertUtil.change2Integer(reportNum);
//中文中不包含中文数字时,提取阿拉伯数字
if (number == 0) {
number = TypeConvertUtil.extractNum(reportNum);
}
operationRequest.setRankingNum(number);
}
//--------存在地区-----------
String place = callRequest.get地区();
if (!StringUtils.isEmpty(place)) {
operationRequest.setPlace(place);
}
//--------存在名次-----------
String rankNumber = callRequest.get名次();
if (!StringUtils.isEmpty(rankNumber)) {
//找到中文数字对应的阿拉伯数字
Integer number = TypeConvertUtil.change2Integer(rankNumber);
//中文中不包含中文数字时,提取阿拉伯数字
if (number == 0) {
number = TypeConvertUtil.extractNum(rankNumber);
}
operationRequest.setRankNumber(number);
}
return operationRequest; return operationRequest;
} }
} }
...@@ -119,6 +119,20 @@ public class SpeechUtil { ...@@ -119,6 +119,20 @@ public class SpeechUtil {
} }
/** /**
* 从排行榜模块话术获取话术
* @param someone
* @param feedText
* @return String
*/
public static String getRankingSpeech(String someone, String feedText) {
String result = "";
List<String> speech = TimingAcquisition.rankingSpeechMap.get(someone).get(feedText);
Integer i = RandomDropUtil.getRandomNum(0, speech.size());
result = speech.get(i);
return result;
}
/**
* 替换话术中的一个数字 * 替换话术中的一个数字
* @param one * @param one
* @return String * @return String
......
...@@ -23,14 +23,14 @@ public class YamlUtil { ...@@ -23,14 +23,14 @@ public class YamlUtil {
private static LinkedHashMap<String, Map<String, Map<String, String>>> properties = new LinkedHashMap<>(); private static LinkedHashMap<String, Map<String, Map<String, String>>> properties = new LinkedHashMap<>();
/** /**
* 将种植话术转成map格式 * 将话术转成map格式
* @param * @param
* @return Map<String, Map<String, List<String>>> * @return Map<String, Map<String, List<String>>>
*/ */
public static Map<String, Map<String, List<String>>> plantSpeechToMap() { public static Map<String, Map<String, List<String>>> loadSpeechToMap(String fileName) {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>(); Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try { try {
InputStream in = new FileInputStream(speechFilePath + "plant.yaml"); InputStream in = new FileInputStream(speechFilePath + fileName);
Yaml yaml = new Yaml(); Yaml yaml = new Yaml();
speechMap = yaml.load(in); speechMap = yaml.load(in);
} catch (Exception e) { } catch (Exception e) {
...@@ -38,123 +38,6 @@ public class YamlUtil { ...@@ -38,123 +38,6 @@ public class YamlUtil {
} }
return speechMap; return speechMap;
} }
/**
* 将园丁话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> gardenerSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "gardener.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将宠物话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> petSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "pet.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将市场话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> marketSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "market.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将社交话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> socialSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "social.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将任务话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> taskSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "task.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将帮助话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> helpSpeechToMap() {
Map<String, Map<String, List<String>>> speechMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "help.yaml");
Yaml yaml = new Yaml();
speechMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return speechMap;
}
/**
* 将建议话术转成map格式
* @param
* @return Map<String, Map<String, List<String>>>
*/
public static Map<String, Map<String, List<String>>> adviseSpeechToMap() {
Map<String, Map<String, List<String>>> adviseMap = new HashMap<>();
try {
InputStream in = new FileInputStream(speechFilePath + "advise.yaml");
Yaml yaml = new Yaml();
adviseMap = yaml.load(in);
} catch (Exception e) {
e.printStackTrace();
}
return adviseMap;
}
/** /**
* 读取配置文件yml中的某个值,只支持取第一层的值 * 读取配置文件yml中的某个值,只支持取第一层的值
......
...@@ -23,6 +23,8 @@ import com.qiwuai.garden.service.petService.PetService; ...@@ -23,6 +23,8 @@ import com.qiwuai.garden.service.petService.PetService;
import com.qiwuai.garden.service.petService.impl.PetServiceImpl; import com.qiwuai.garden.service.petService.impl.PetServiceImpl;
import com.qiwuai.garden.service.plantService.PlantService; import com.qiwuai.garden.service.plantService.PlantService;
import com.qiwuai.garden.service.plantService.impl.PlantServiceImpl; import com.qiwuai.garden.service.plantService.impl.PlantServiceImpl;
import com.qiwuai.garden.service.rankingService.RankingService;
import com.qiwuai.garden.service.rankingService.impl.RankingServiceImpl;
import com.qiwuai.garden.service.socialService.SocialService; import com.qiwuai.garden.service.socialService.SocialService;
import com.qiwuai.garden.service.socialService.impl.SocialServiceImpl; import com.qiwuai.garden.service.socialService.impl.SocialServiceImpl;
import com.qiwuai.garden.service.taskService.TaskService; import com.qiwuai.garden.service.taskService.TaskService;
...@@ -65,6 +67,9 @@ public class CommonController { ...@@ -65,6 +67,9 @@ public class CommonController {
//任务模块动态代理 //任务模块动态代理
TaskService taskService = new TaskServiceImpl(); TaskService taskService = new TaskServiceImpl();
TaskService taskServiceProxy = (TaskService) new ProxyFactory(taskService).getProxyInstance(); TaskService taskServiceProxy = (TaskService) new ProxyFactory(taskService).getProxyInstance();
//排行榜模块动态代理
RankingService rankingService = new RankingServiceImpl();
RankingService rankingServiceProxy = (RankingService) new ProxyFactory(rankingService).getProxyInstance();
//帮助模块动态代理 //帮助模块动态代理
HelpService helpService = new HelpServiceImpl(); HelpService helpService = new HelpServiceImpl();
HelpService helpServiceProxy = (HelpService) new ProxyFactory(helpService).getProxyInstance(); HelpService helpServiceProxy = (HelpService) new ProxyFactory(helpService).getProxyInstance();
...@@ -533,6 +538,18 @@ public class CommonController { ...@@ -533,6 +538,18 @@ public class CommonController {
case "查询任务": case "查询任务":
result = taskServiceProxy.checkTask(operationReq); result = taskServiceProxy.checkTask(operationReq);
break; break;
case "查看排行榜":
result = rankingServiceProxy.checkRankingList(operationReq);
break;
case "查看本人榜单名次":
result = rankingServiceProxy.checkSelfRankingList(operationReq);
break;
case "查看玩家榜单名次":
result = rankingServiceProxy.checkPlayerRankingList(operationReq);
break;
case "拜访榜单玩家":
result = rankingServiceProxy.visitRankingPlayer(operationReq);
break;
case "打开帮助菜单": case "打开帮助菜单":
result = helpServiceProxy.openHelpMenu(operationReq); result = helpServiceProxy.openHelpMenu(operationReq);
break; break;
......
...@@ -32,4 +32,8 @@ public class FriendDto { ...@@ -32,4 +32,8 @@ public class FriendDto {
* 帮助时间 * 帮助时间
*/ */
private String helpTime; private String helpTime;
/**
* 已帮助次数
*/
private Integer helpNumber = 0;
} }
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class PlayerTimesDto {
/**
* 玩家id
*/
private String uid;
/**
* 玩家地址
*/
private String address;
/**
* 玩家对应货币数量、偷菜成功次数、帮助好友次数
*/
private Integer number;
}
...@@ -186,4 +186,20 @@ public class CallRequest { ...@@ -186,4 +186,20 @@ public class CallRequest {
*/ */
@JsonProperty(value = "GB_园丁姓名") @JsonProperty(value = "GB_园丁姓名")
private String GB_园丁姓名; private String GB_园丁姓名;
/**
* 榜单
*/
private String 榜单;
/**
* 排行榜序号
*/
private String 排行榜序号;
/**
* 地区
*/
private String 地区;
/**
* 名次
*/
private String 名次;
} }
...@@ -193,6 +193,22 @@ public class OperationRequest { ...@@ -193,6 +193,22 @@ public class OperationRequest {
*/ */
private String gardenerName; private String gardenerName;
/** /**
* 榜单
*/
private String rankingName;
/**
* 排行榜序号
*/
private Integer rankingNum;
/**
* 地区
*/
private String place;
/**
* 名次
*/
private Integer rankNumber;
/**
* 本轮操作标识 * 本轮操作标识
*/ */
private Integer operationLabel; private Integer operationLabel;
......
package com.qiwuai.garden.service.rankingService;
import com.qiwuai.garden.dto.base.CommonResponse;
import com.qiwuai.garden.dto.request.OperationRequest;
public interface RankingService {
/**
* 查看排行榜
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkRankingList(OperationRequest operationReq);
/**
* 查看本人榜单名次
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkSelfRankingList(OperationRequest operationReq);
/**
* 查看玩家榜单名次
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkPlayerRankingList(OperationRequest operationReq);
/**
* 拜访榜单玩家
* @param operationReq
* @return CommonResponse
*/
CommonResponse visitRankingPlayer(OperationRequest operationReq);
}
...@@ -1063,6 +1063,7 @@ public class SocialServiceImpl implements SocialService { ...@@ -1063,6 +1063,7 @@ public class SocialServiceImpl implements SocialService {
friend.setName(nameTmp); friend.setName(nameTmp);
friend.setStatus(Constants.OFFLINE); friend.setStatus(Constants.OFFLINE);
friend.setHelpTag(Constants.HELP_NO_SIGN); friend.setHelpTag(Constants.HELP_NO_SIGN);
friend.setHelpNumber(0);
//玩家的好友列表 //玩家的好友列表
List<FriendDto> friendList = gardener.getFriendList(); List<FriendDto> friendList = gardener.getFriendList();
if (StringUtils.isEmpty(friendList)) { if (StringUtils.isEmpty(friendList)) {
...@@ -3604,6 +3605,7 @@ public class SocialServiceImpl implements SocialService { ...@@ -3604,6 +3605,7 @@ public class SocialServiceImpl implements SocialService {
//该好友标记为已帮助 //该好友标记为已帮助
friend.setHelpTag(Constants.HELP_HAVE_SIGN); friend.setHelpTag(Constants.HELP_HAVE_SIGN);
friend.setHelpTime(nowTime); friend.setHelpTime(nowTime);
friend.setHelpNumber(friend.getHelpNumber() + 1); //该好友已帮助次数
//--------------持久化该园丁信息--------------- //--------------持久化该园丁信息---------------
Map<String, GardenerDto> gardenerMap = new ConcurrentHashMap<>(); Map<String, GardenerDto> gardenerMap = new ConcurrentHashMap<>();
gardenerMap.put(uid, TimingAcquisition.gardenerMap.get(uid)); gardenerMap.put(uid, TimingAcquisition.gardenerMap.get(uid));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment