Commit 4cec3c0e by 周君强

1.bug修复、代码调整;

2.新增意图、新手引导实现
parent 2813abb4
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid</artifactId> <artifactId>druid</artifactId>
<version>1.2.6</version> <version>1.2.11</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.60</version> <version>1.2.70</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
...@@ -94,6 +94,11 @@ ...@@ -94,6 +94,11 @@
<version>1.18.24</version> <version>1.18.24</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
......
...@@ -140,10 +140,34 @@ public class Constants { ...@@ -140,10 +140,34 @@ public class Constants {
/** /**
* 操作ID,用于记录每轮操作 * --------------------操作ID,用于记录每轮操作-------------------
* 宠物删除 * 宠物删除
*/ */
public static final int PET_DELETE = 3004; public static final Integer PET_DELETE = 3004;
/**
* 查看园地
*/
public static final Integer CHECK_GARDEN = 5005;
/**
* 偷菜
*/
public static final Integer STEAL_OTHER = 5006;
/**
* 帮助好友
*/
public static final Integer HELP_FRIEND = 5007;
/**
* 查看帮助简报
*/
public static final Integer CHECK_HELP_REPORT = 5013;
/**
* 查看偷菜简报
*/
public static final Integer CHECK_STEAL_REPORT = 5014;
/**
* 查看商品
*/
public static final Integer CHECK_GOODS = 4003;
/** /**
...@@ -252,6 +276,10 @@ public class Constants { ...@@ -252,6 +276,10 @@ public class Constants {
* 不存在-0 * 不存在-0
*/ */
public static final Integer NON = 0; public static final Integer NON = 0;
/**
* 不存在-0
*/
public static final String NON_STR = "0";
/** /**
...@@ -263,6 +291,7 @@ public class Constants { ...@@ -263,6 +291,7 @@ public class Constants {
*/ */
public static final Integer DEFEND_SUCCESS = 1; public static final Integer DEFEND_SUCCESS = 1;
/** /**
* 简报未读-0 * 简报未读-0
*/ */
...@@ -274,6 +303,25 @@ public class Constants { ...@@ -274,6 +303,25 @@ public class Constants {
/** /**
* 养成任务-1
*/
public static final Integer UPDATE_TASK = 1;
/**
* 日常任务-2
*/
public static final Integer DAILY_TASK = 2;
/**
* 任务未完成
*/
public static final Integer TASK_FINISH_NO = 0;
/**
* 任务已完成
*/
public static final Integer TASK_FINISH_YES = 1;
/**
* 数据存放地址 * 数据存放地址
*/ */
public static final String userFilePath = "/home/qwyf14/dataBackup/"; public static final String userFilePath = "/home/qwyf14/dataBackup/";
......
package com.qiwuai.garden.common; package com.qiwuai.garden.common;
import com.qiwuai.garden.common.cache.CacheUtil; import com.qiwuai.garden.common.cache.CacheUtil;
import com.qiwuai.garden.common.utils.DateUtil;
import com.qiwuai.garden.common.utils.SpeechUtil; import com.qiwuai.garden.common.utils.SpeechUtil;
import com.qiwuai.garden.common.utils.YamlUtil; import com.qiwuai.garden.common.utils.YamlUtil;
import com.qiwuai.garden.dto.GardenerDto; import com.qiwuai.garden.dto.GardenerDto;
...@@ -66,6 +67,8 @@ public class ProxyFactory { ...@@ -66,6 +67,8 @@ public class ProxyFactory {
public void statusUpdate(String uid) { public void statusUpdate(String uid) {
if (!StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) { if (!StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) {
TimingAcquisition.gardenerMap.get(uid).setStatus(Constants.ONLINE); TimingAcquisition.gardenerMap.get(uid).setStatus(Constants.ONLINE);
//修改上线时间
TimingAcquisition.gardenerMap.get(uid).setOnlineTime(DateUtil.getCurrentTime());
} }
} }
......
...@@ -105,6 +105,13 @@ public class ScheduleTask { ...@@ -105,6 +105,13 @@ public class ScheduleTask {
private void feedFieldPet(String uid, PetPojo pet, int i) { private void feedFieldPet(String uid, PetPojo pet, int i) {
//获取当前玩家的背包 //获取当前玩家的背包
BackPackDto backPack = TimingAcquisition.gardenerMap.get(uid).getBackPack(); BackPackDto backPack = TimingAcquisition.gardenerMap.get(uid).getBackPack();
//宠物投喂消耗物品没有配置,则无需喂养
if (StringUtils.isEmpty(pet.getFeedCost())) {
return;
}
if (Constants.NON.equals(Integer.valueOf(pet.getFeedCost()))) {
return;
}
//宠物投喂消耗物品和数量 //宠物投喂消耗物品和数量
List<ItemDto> itemList = TypeConvertUtil.itemString2List(pet.getFeedCost()); List<ItemDto> itemList = TypeConvertUtil.itemString2List(pet.getFeedCost());
//宠物剩余免喂养次数 //宠物剩余免喂养次数
......
...@@ -60,13 +60,62 @@ public class DateUtil { ...@@ -60,13 +60,62 @@ public class DateUtil {
* @return long * @return long
*/ */
public static long subTime(String time1, String time2) throws ParseException { public static long subTime(String time1, String time2) throws ParseException {
String t1 = (time1.compareTo(time2) > 0) ? time1 : time2;
String t2 = (time1.compareTo(time2) > 0) ? time2 : time1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
Date dt1 = sdf.parse(time1); Date dt1 = sdf.parse(t1);
Date dt2 = sdf.parse(time2); Date dt2 = sdf.parse(t2);
return (dt1.getTime() - dt2.getTime())/1000; return (dt1.getTime() - dt2.getTime())/1000;
} }
/** /**
* 计算时间差(time1 - time2),返回单位为天/时/分/秒
* @param time1
* @param time2
* @return String
*/
public static String subTimeToDate(String time1, String time2) throws ParseException {
String t1 = (time1.compareTo(time2) > 0) ? time1 : time2;
String t2 = (time1.compareTo(time2) > 0) ? time2 : time1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
Date dt1 = sdf.parse(t1);
Date dt2 = sdf.parse(t2);
long time = (dt1.getTime() - dt2.getTime())/1000;
String result = null;
long days = time / (60 * 60 * 24);
long hours = (time % (60 * 60 * 24)) / (60 * 60);
long minutes = (time % (60 * 60)) / 60;
long seconds = time % 60;
if (days > 0) {
result = days + "天" + hours + "小时" + minutes + "分钟";
} else if (hours > 0) {
result = hours + "小时" + minutes + "分钟";
} else if (minutes > 0) {
result = minutes + "分钟" + seconds + "秒";
} else {
result = seconds + "秒";
}
return result;
}
/**
* 计算时间差(time1 - time2),返回单位为天
* @param time1
* @param time2
* @return String
*/
public static long subTimeToDay(String time1, String time2) throws ParseException {
String t1 = (time1.compareTo(time2) > 0) ? time1 : time2;
String t2 = (time1.compareTo(time2) > 0) ? time2 : time1;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
Date dt1 = sdf.parse(t1);
Date dt2 = sdf.parse(t2);
long time = (dt1.getTime() - dt2.getTime())/1000;
long result = 0;
return time / (60 * 60 * 24);
}
/**
* 日期比较:(time1 > time2)返回1,=返回0,<返回-1 * 日期比较:(time1 > time2)返回1,=返回0,<返回-1
* @param time1 * @param time1
* @param time2 * @param time2
...@@ -394,6 +443,7 @@ public class DateUtil { ...@@ -394,6 +443,7 @@ public class DateUtil {
String t1 = "20220706170722"; String t1 = "20220706170722";
String t2 = getCurrentTime(); String t2 = getCurrentTime();
System.out.println("时间比较结果:" + changeForm(t1)); System.out.println("时间比较结果:" + changeForm(t1));
System.out.println("时间差:" + subTimeToDate(t2, t1));
} }
} }
...@@ -6,6 +6,9 @@ import com.qiwuai.garden.common.Constants; ...@@ -6,6 +6,9 @@ import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.common.TimingAcquisition; import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.dto.BackPackDto; import com.qiwuai.garden.dto.BackPackDto;
import com.qiwuai.garden.dto.MessageTimeDto; import com.qiwuai.garden.dto.MessageTimeDto;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.io.*; import java.io.*;
...@@ -139,6 +142,27 @@ public class PersistenceUtil { ...@@ -139,6 +142,27 @@ public class PersistenceUtil {
} }
return lastStr; return lastStr;
} }
/**
* 从Excel文件中读取表的信息
* @param fileName
* @return String
*/
public static List<String> getContentFromFile(String fileName) {
List<String> contentList = new ArrayList<>();
try {
File file = new File(configFilePath + fileName);
Workbook workbook = Workbook.getWorkbook(file);
Sheet sheet = workbook.getSheets()[0];
for (int i = 0; i < sheet.getRows(); i++) {
Cell cell = sheet.getCell(0, i);
String content = cell.getContents();
contentList.add(content);
}
} catch (Exception e) {
e.printStackTrace();
}
return contentList;
}
/** /**
* 保存玩家留言到message目录的json文件中 * 保存玩家留言到message目录的json文件中
...@@ -179,9 +203,9 @@ public class PersistenceUtil { ...@@ -179,9 +203,9 @@ public class PersistenceUtil {
BufferedReader reader = null; BufferedReader reader = null;
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
File file = new File(messageFilePath + uid + "/" + friendUid); File file = new File(messageFilePath + uid + "/" + friendUid);
result.append("{");
try { try {
if (file.exists()) { if (file.exists()) {
result.append("{");
File[] fileList = file.listFiles(); File[] fileList = file.listFiles();
assert fileList != null; assert fileList != null;
if (!StringUtils.isEmpty(fileList) || fileList.length != 0) { if (!StringUtils.isEmpty(fileList) || fileList.length != 0) {
...@@ -212,8 +236,11 @@ public class PersistenceUtil { ...@@ -212,8 +236,11 @@ public class PersistenceUtil {
e.printStackTrace(); e.printStackTrace();
} }
} }
Map<String, MessageTimeDto> messageTimeMapTmp = JSON.parseObject(result.toString(), new TypeReference<Map<String, MessageTimeDto>>(){}); if (result.length() > 0) {
return messageTimeMapTmp; return JSON.parseObject(result.toString(), new TypeReference<Map<String, MessageTimeDto>>(){});
} else {
return null;
}
} }
/** /**
...@@ -346,6 +373,8 @@ public class PersistenceUtil { ...@@ -346,6 +373,8 @@ public class PersistenceUtil {
words.add("敏感"); words.add("敏感");
String str = JSON.toJSONString(words); String str = JSON.toJSONString(words);
// saveConfigToFile("sensitiveWords.txt", str); // saveConfigToFile("sensitiveWords.txt", str);
System.out.println("所有好友:"+ getFriendFromFile("Test222")); // System.out.println("所有好友:"+ getFriendFromFile("Test222"));
// List<String> result = getNamesFromFile("name.xls");
// System.out.println("读取excel文件的内容:" + result);
} }
} }
...@@ -3,12 +3,10 @@ package com.qiwuai.garden.common.utils; ...@@ -3,12 +3,10 @@ package com.qiwuai.garden.common.utils;
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.dto.DropItemNumDto; import com.qiwuai.garden.dto.DropItemNumDto;
import com.qiwuai.garden.dto.GardenerDto;
import com.qiwuai.garden.dto.ItemDto; import com.qiwuai.garden.dto.ItemDto;
import com.qiwuai.garden.dto.NurseryInfoDto; import com.qiwuai.garden.dto.NurseryInfoDto;
import com.qiwuai.garden.pojo.AddItemPojo; import com.qiwuai.garden.pojo.*;
import com.qiwuai.garden.pojo.NurseryPojo;
import com.qiwuai.garden.pojo.PetPojo;
import com.qiwuai.garden.pojo.PlantPojo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -225,7 +223,7 @@ public class RandomDropUtil { ...@@ -225,7 +223,7 @@ public class RandomDropUtil {
* @param nurseryInfo * @param nurseryInfo
* @return void * @return void
*/ */
public static void plantMature(NurseryInfoDto nurseryInfo) { public static void plantMature(String uid, NurseryInfoDto nurseryInfo) {
ItemDto fruit = new ItemDto(); ItemDto fruit = new ItemDto();
//花圃配置信息 //花圃配置信息
NurseryPojo nurseryConfig = TimingAcquisition.nurseryConfigMap.get(nurseryInfo.getId()); NurseryPojo nurseryConfig = TimingAcquisition.nurseryConfigMap.get(nurseryInfo.getId());
...@@ -270,20 +268,35 @@ public class RandomDropUtil { ...@@ -270,20 +268,35 @@ public class RandomDropUtil {
//花圃还没有宠物,则有一定几率吸引宠物到来 //花圃还没有宠物,则有一定几率吸引宠物到来
if (StringUtils.isEmpty(nurseryPetId) || nurseryPetId == 0) { if (StringUtils.isEmpty(nurseryPetId) || nurseryPetId == 0) {
List<Integer> petList = new ArrayList<>(); List<Integer> petList = new ArrayList<>();
//宠物配置信息 //--------------植物第一次成熟后必有的宠物id-----------------
Map<Integer, PetPojo> petConfigMap = TimingAcquisition.petConfigMap; String firstPetId = TimingAcquisition.systemConfigMap.get("first_pet_id").getValue();
for (Map.Entry<Integer, PetPojo> entry : petConfigMap.entrySet()) { String firstPetProb = TimingAcquisition.systemConfigMap.get("first_pet_prob").getValue();
PetPojo petPojo = entry.getValue(); GardenerDto gardener = TimingAcquisition.gardenerMap.get(uid);
//宠物喜欢的植物 Integer harvestTime = gardener.getTaskCountMap().get(Constants.HARVEST_EVENT);
if (!StringUtils.isEmpty(petPojo.getFavoritePlantId())) { //玩家第一次收获时给指定宠物
if (Constants.NON.toString().equals(petPojo.getFavoritePlantId())) { if (harvestTime == 0) {
List<String> favorPlantIdList = Arrays.asList(petPojo.getFavoritePlantId().split("\\|")); //统计有概率出现的宠物
if (favorPlantIdList.contains(nurseryInfo.getPlantId().toString())) { Random random = new Random();
//统计有概率出现的宠物 double randomProb = random.nextDouble();
Random random = new Random(); if (randomProb < Double.parseDouble(firstPetProb)) {
double randomProb = random.nextDouble(); petList.add(Integer.valueOf(firstPetId));
if (randomProb < petPojo.getAppearProb().doubleValue()) { }
petList.add(petPojo.getId()); } else {
//宠物配置信息
Map<Integer, PetPojo> petConfigMap = TimingAcquisition.petConfigMap;
for (Map.Entry<Integer, PetPojo> entry : petConfigMap.entrySet()) {
PetPojo petPojo = entry.getValue();
//宠物喜欢的植物
if (!StringUtils.isEmpty(petPojo.getFavoritePlantId())) {
if (Constants.NON.toString().equals(petPojo.getFavoritePlantId())) {
List<String> favorPlantIdList = Arrays.asList(petPojo.getFavoritePlantId().split("\\|"));
if (favorPlantIdList.contains(nurseryInfo.getPlantId().toString())) {
//统计有概率出现的宠物
Random random = new Random();
double randomProb = random.nextDouble();
if (randomProb < petPojo.getAppearProb().doubleValue()) {
petList.add(petPojo.getId());
}
} }
} }
} }
...@@ -294,6 +307,9 @@ public class RandomDropUtil { ...@@ -294,6 +307,9 @@ public class RandomDropUtil {
Integer petId = petList.get(getRandomNum(0, petList.size())); Integer petId = petList.get(getRandomNum(0, petList.size()));
nurseryInfo.setPetField(petId); nurseryInfo.setPetField(petId);
nurseryInfo.setPetCheck(Constants.PET_UNCHECK); nurseryInfo.setPetCheck(Constants.PET_UNCHECK);
//----------获得宠物累计次数加1---------------
Map<Integer, Integer> taskCountMap = gardener.getTaskCountMap();
taskCountMap.put(Constants.GET_PET_EVENT, taskCountMap.get(Constants.GET_PET_EVENT) + 1);
} }
} }
// log.info("掉落物品:" + dropItemsTotal); // log.info("掉落物品:" + dropItemsTotal);
...@@ -316,5 +332,7 @@ public class RandomDropUtil { ...@@ -316,5 +332,7 @@ public class RandomDropUtil {
pet.setDropProbs("0.80|0.65|0.45"); pet.setDropProbs("0.80|0.65|0.45");
List<ItemDto> resultPet = petDropItem(pet); List<ItemDto> resultPet = petDropItem(pet);
System.out.println("宠物掉落结果为:" + resultPet); System.out.println("宠物掉落结果为:" + resultPet);
System.out.println("随机数结果:" + getRandomNum(0, 1));;
} }
} }
...@@ -10,7 +10,7 @@ public class SpeechUtil { ...@@ -10,7 +10,7 @@ public class SpeechUtil {
* 从种植模块话术获取话术 * 从种植模块话术获取话术
* @param someone * @param someone
* @param feedText * @param feedText
* @return Map<String, Map<String, List<String>>> * @return String
*/ */
public static String getPlantSpeech(String someone, String feedText) { public static String getPlantSpeech(String someone, String feedText) {
String result = ""; String result = "";
...@@ -24,7 +24,7 @@ public class SpeechUtil { ...@@ -24,7 +24,7 @@ public class SpeechUtil {
* 从园丁模块话术获取话术 * 从园丁模块话术获取话术
* @param someone * @param someone
* @param feedText * @param feedText
* @return Map<String, Map<String, List<String>>> * @return String
*/ */
public static String getGardenerSpeech(String someone, String feedText) { public static String getGardenerSpeech(String someone, String feedText) {
String result = ""; String result = "";
...@@ -38,7 +38,7 @@ public class SpeechUtil { ...@@ -38,7 +38,7 @@ public class SpeechUtil {
* 从宠物模块话术获取话术 * 从宠物模块话术获取话术
* @param someone * @param someone
* @param feedText * @param feedText
* @return Map<String, Map<String, List<String>>> * @return String
*/ */
public static String getPetSpeech(String someone, String feedText) { public static String getPetSpeech(String someone, String feedText) {
String result = ""; String result = "";
...@@ -52,7 +52,7 @@ public class SpeechUtil { ...@@ -52,7 +52,7 @@ public class SpeechUtil {
* 从市场模块话术获取话术 * 从市场模块话术获取话术
* @param someone * @param someone
* @param feedText * @param feedText
* @return Map<String, Map<String, List<String>>> * @return String
*/ */
public static String getMarketSpeech(String someone, String feedText) { public static String getMarketSpeech(String someone, String feedText) {
String result = ""; String result = "";
...@@ -66,7 +66,7 @@ public class SpeechUtil { ...@@ -66,7 +66,7 @@ public class SpeechUtil {
* 从社交模块话术获取话术 * 从社交模块话术获取话术
* @param someone * @param someone
* @param feedText * @param feedText
* @return Map<String, Map<String, List<String>>> * @return String
*/ */
public static String getSocialSpeech(String someone, String feedText) { public static String getSocialSpeech(String someone, String feedText) {
String result = ""; String result = "";
...@@ -77,6 +77,20 @@ public class SpeechUtil { ...@@ -77,6 +77,20 @@ public class SpeechUtil {
} }
/** /**
* 从任务模块话术获取话术
* @param someone
* @param feedText
* @return String
*/
public static String getTaskSpeech(String someone, String feedText) {
String result = "";
List<String> speech = TimingAcquisition.taskSpeechMap.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
......
...@@ -11,10 +11,13 @@ import java.util.Arrays; ...@@ -11,10 +11,13 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class TypeConvertUtil { public class TypeConvertUtil {
static char[] cnArr = new char[]{'一','二','三','四','五','六','七','八','九'};
static char[] chArr = new char [] {'十','百','千','万','亿'};
/** /**
* 将物品“1003/100,1567/20”转成“{}” * 将物品“1003|100,1567|20”转成“{}”
* @param param * @param param
* @return List<ItemDto> * @return List<ItemDto>
*/ */
...@@ -98,21 +101,127 @@ public class TypeConvertUtil { ...@@ -98,21 +101,127 @@ public class TypeConvertUtil {
if (lastCh.contains(param)) { if (lastCh.contains(param)) {
return Constants.REQ_LAST; return Constants.REQ_LAST;
} }
int i = 0; param = param.replace("两","二");
char[] chNum = new char[]{'一','二','三','四','五','六','七','八','九','十'}; List<Character> cnArrList = new String(cnArr).chars().mapToObj(c->(char)c).collect(Collectors.toList());
char[] chars = param.toCharArray(); List<Character> chArrList = new String(chArr).chars().mapToObj(c->(char)c).collect(Collectors.toList());
for (char c : chars) { boolean num = false;
for (int j = 0; j < chNum.length; j++) { int result = 0;
if (c == chNum[j]) { //存放一个单位的数字如:十万
if (c != '十') { int temp = 1;
i = (j + 1); //判断是否有chArr
} else { int count = 0;
i = (i + 1) * 10; for (int i = 0; i < param.length(); i++) {
//判断是否是chArr
boolean b = true;
char c = param.charAt(i);
//非单位,即数字
for (int j = 0; j < cnArr.length; j++) {
if (c == cnArr[j]) {
//添加下一个单位之前,先把上一个单位值添加到结果中
if(0 != count){
result += temp;
count = 0;
} }
// 下标+1,就是对应的值
temp = j + 1;
b = false;
num = true;
break;
}
}
if(b){
for (int j = 0; j < chArr.length; j++) {
if (c == chArr[j]) {
switch (j) {
case 0:
temp *= 10;
break;
case 1:
temp *= 100;
break;
case 2:
temp *= 1000;
break;
case 3:
temp *= 10000;
break;
case 4:
temp *= 100000000;
break;
default:
break;
}
count++;
}
}
}
//遍历到最后一个字符
if (i == param.length() - 1) {
//避免出现阿拉伯数字,没有找到返回为1的情况
if (num) {
result += temp;
} else {
result = 0;
} }
} }
} }
return i; return result;
}
/**
* 将数字转换为中文数字, 这里只写到了万
* @param intInput 需要转换的数学数字
*/
public static String arabicNumToChineseNum(int intInput) {
String si = String.valueOf(intInput);
String sd = "";
if (si.length() == 1) {
if (intInput == 0) {
return sd;
}
sd += cnArr[intInput - 1];
return sd;
} else if (si.length() == 2) {
if ("1".equals(si.substring(0, 1))) {
sd += "十";
if (intInput % 10 == 0) {
return sd;
}
}
else {
sd += (cnArr[intInput / 10 - 1] + "十");
}
sd += arabicNumToChineseNum(intInput % 10);
} else if (si.length() == 3) {
sd += (cnArr[intInput / 100 - 1] + "百");
if (String.valueOf(intInput % 100).length() < 2) {
if (intInput % 100 == 0) {
return sd;
}
sd += "零";
}
sd += arabicNumToChineseNum(intInput % 100);
} else if (si.length() == 4) {
sd += (cnArr[intInput / 1000 - 1] + "千");
if (String.valueOf(intInput % 1000).length() < 3) {
if (intInput % 1000 == 0) {
return sd;
}
sd += "零";
}
sd += arabicNumToChineseNum(intInput % 1000);
} else if (si.length() == 5) {
sd += (cnArr[intInput / 10000 - 1] + "万");
if (String.valueOf(intInput % 10000).length() < 4) {
if (intInput % 10000 == 0) {
return sd;
}
sd += "零";
}
sd += arabicNumToChineseNum(intInput % 10000);
}
return sd;
} }
/** /**
......
...@@ -105,6 +105,22 @@ public class YamlUtil { ...@@ -105,6 +105,22 @@ public class YamlUtil {
} }
return speechMap; 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;
}
/** /**
* 读取配置文件yml中的某个值,只支持取第一层的值 * 读取配置文件yml中的某个值,只支持取第一层的值
......
...@@ -20,6 +20,8 @@ import com.qiwuai.garden.service.plantService.PlantService; ...@@ -20,6 +20,8 @@ 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.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.impl.TaskServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -65,15 +67,24 @@ public class CommonController { ...@@ -65,15 +67,24 @@ public class CommonController {
//社交模块动态代理 //社交模块动态代理
SocialService socialService = new SocialServiceImpl(); SocialService socialService = new SocialServiceImpl();
SocialService socialServiceProxy = (SocialService) new ProxyFactory(socialService).getProxyInstance(); SocialService socialServiceProxy = (SocialService) new ProxyFactory(socialService).getProxyInstance();
//任务模块动态代理
TaskService taskService = new TaskServiceImpl();
TaskService taskServiceProxy = (TaskService) new ProxyFactory(taskService).getProxyInstance();
@PostMapping(value = "/call", produces = "application/json;charset=UTF-8") @PostMapping(value = "/call", produces = "application/json;charset=UTF-8")
public CommonResponse createGardener(@RequestBody CommonRequest commonRequest) throws ParseException { public CommonResponse createGardener(@RequestBody CommonRequest commonRequest) throws ParseException {
OperationRequest operationReq = RequestConversionUtil.request2Operation(commonRequest); OperationRequest operationReq = RequestConversionUtil.request2Operation(commonRequest);
CommonResponse result = new CommonResponse(); CommonResponse result = new CommonResponse();
switch (commonRequest.getVars().get操作名()) { switch (commonRequest.getVars().get操作名()) {
case "进入游戏":
result = gardenerServiceProxy.enterGame(operationReq);
break;
case "创建用户": case "创建用户":
result = gardenerServiceProxy.create(operationReq); result = gardenerServiceProxy.create(operationReq);
break; break;
case "更改园丁性别":
result = gardenerServiceProxy.changeGender(operationReq);
break;
case "种植": case "种植":
result = plantServiceProxy.seedCheck(operationReq); result = plantServiceProxy.seedCheck(operationReq);
break; break;
...@@ -83,6 +94,15 @@ public class CommonController { ...@@ -83,6 +94,15 @@ public class CommonController {
case "取消种植": case "取消种植":
result = plantServiceProxy.seedCancel(operationReq); result = plantServiceProxy.seedCancel(operationReq);
break; break;
case "批量种植":
result = plantServiceProxy.batchSeedCheck(operationReq);
break;
case "确认批量种植":
result = plantServiceProxy.batchSeed(operationReq);
break;
case "取消批量种植":
result = plantServiceProxy.batchSeedCancel(operationReq);
break;
case "收取": case "收取":
result = plantServiceProxy.harvest(operationReq); result = plantServiceProxy.harvest(operationReq);
break; break;
...@@ -98,12 +118,18 @@ public class CommonController { ...@@ -98,12 +118,18 @@ public class CommonController {
case "取消铲除植物": case "取消铲除植物":
result = plantServiceProxy.clearPlantCancel(operationReq); result = plantServiceProxy.clearPlantCancel(operationReq);
break; break;
case "查看花圃状态": case "查询植物成熟时间指令":
result = nurseryServiceProxy.checkAllNursery(operationReq); result = plantServiceProxy.checkPlantMatureTime(operationReq);
break;
case "查看花圃数量指令":
result = nurseryServiceProxy.checkNurseryAmount(operationReq);
break; break;
case "查看指定花圃状态": case "查看花圃指令":
result = nurseryServiceProxy.checkNurseryByNum(operationReq); result = nurseryServiceProxy.checkNurseryByNum(operationReq);
break; break;
case "查看花圃状态":
result = nurseryServiceProxy.checkAllNursery(operationReq);
break;
case "查看花圃等级": case "查看花圃等级":
result = nurseryServiceProxy.checkNurseryLevel(operationReq); result = nurseryServiceProxy.checkNurseryLevel(operationReq);
break; break;
...@@ -129,8 +155,14 @@ public class CommonController { ...@@ -129,8 +155,14 @@ public class CommonController {
result = nurseryServiceProxy.nurseryResetCancel(operationReq); result = nurseryServiceProxy.nurseryResetCancel(operationReq);
break; break;
case "开启新花圃": case "开启新花圃":
result = nurseryServiceProxy.nurseryReclaimCheck(operationReq);
break;
case "确认开启新花圃":
result = nurseryServiceProxy.nurseryReclaim(operationReq); result = nurseryServiceProxy.nurseryReclaim(operationReq);
break; break;
case "取消开启新花圃":
result = nurseryServiceProxy.nurseryReclaimCancel(operationReq);
break;
case "查看园丁等级": case "查看园丁等级":
result = gardenerServiceProxy.gardenerLevelCheck(operationReq); result = gardenerServiceProxy.gardenerLevelCheck(operationReq);
break; break;
...@@ -182,6 +214,9 @@ public class CommonController { ...@@ -182,6 +214,9 @@ public class CommonController {
case "获取详情": case "获取详情":
result = backPackServiceProxy.searchItemInfo(operationReq); result = backPackServiceProxy.searchItemInfo(operationReq);
break; break;
case "发放奖励":
result = backPackServiceProxy.taskAward(operationReq);
break;
case "查看宠物指令": case "查看宠物指令":
result = petServiceProxy.petView(operationReq); result = petServiceProxy.petView(operationReq);
break; break;
...@@ -213,8 +248,20 @@ public class CommonController { ...@@ -213,8 +248,20 @@ public class CommonController {
result = petServiceProxy.petCheck(operationReq); result = petServiceProxy.petCheck(operationReq);
break; break;
case "查询花圃宠物数量指令": case "查询花圃宠物数量指令":
result = petServiceProxy.nurseryPetNumCheck(operationReq);
break;
case "总览查询指令":
result = petServiceProxy.petOverview(operationReq);
break;
case "查看花圃宠物指令":
result = petServiceProxy.nurseryPetCheck(operationReq); result = petServiceProxy.nurseryPetCheck(operationReq);
break; break;
case "确认查看花圃宠物指令":
result = petServiceProxy.nurseryPetCheckSure(operationReq);
break;
case "取消查看花圃宠物指令":
result = petServiceProxy.nurseryPetCheckCancel(operationReq);
break;
case "购买指令": case "购买指令":
result = marketServiceProxy.buyCheck(operationReq); result = marketServiceProxy.buyCheck(operationReq);
break; break;
...@@ -331,8 +378,20 @@ public class CommonController { ...@@ -331,8 +378,20 @@ public class CommonController {
result = socialServiceProxy.getFightDetail(operationReq); result = socialServiceProxy.getFightDetail(operationReq);
break; break;
case "删除简报": case "删除简报":
result = socialServiceProxy.deleteReportCheck(operationReq);
break;
case "删除帮助简报":
result = socialServiceProxy.deleteHelpReportCheck(operationReq);
break;
case "删除偷菜简报":
result = socialServiceProxy.deleteStealReportCheck(operationReq);
break;
case "确认删除简报":
result = socialServiceProxy.deleteReport(operationReq); result = socialServiceProxy.deleteReport(operationReq);
break; break;
case "取消删除简报":
result = socialServiceProxy.deleteReportCancel(operationReq);
break;
case "查看提醒消息": case "查看提醒消息":
result = socialServiceProxy.checkNotice(operationReq); result = socialServiceProxy.checkNotice(operationReq);
break; break;
...@@ -357,6 +416,30 @@ public class CommonController { ...@@ -357,6 +416,30 @@ public class CommonController {
case "查看下一条留言": case "查看下一条留言":
result = socialServiceProxy.readNextMessage(operationReq); result = socialServiceProxy.readNextMessage(operationReq);
break; break;
case "查询好友数量":
result = socialServiceProxy.checkFriendNum(operationReq);
break;
case "查询在线好友数量":
result = socialServiceProxy.checkOnlineFriendNum(operationReq);
break;
case "查询好友":
result = socialServiceProxy.checkFriendInfo(operationReq);
break;
case "离线筛选好友":
result = socialServiceProxy.checkOfflineFriend(operationReq);
break;
case "返回自家花园":
result = socialServiceProxy.backHome(operationReq);
break;
case "查询他人花圃数量":
result = socialServiceProxy.checkNurseryAmountSide(operationReq);
break;
case "查询他人指定花圃宠物":
result = socialServiceProxy.nurseryPetSideCheck(operationReq);
break;
case "查询任务":
result = taskServiceProxy.checkTask(operationReq);
break;
} }
return result; return result;
} }
......
package com.qiwuai.garden.dao;
import com.qiwuai.garden.pojo.TaskTypePojo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface TaskTypeMapper {
List<TaskTypePojo> findAll();
}
...@@ -16,6 +16,10 @@ public class GardenerDto implements Cloneable{ ...@@ -16,6 +16,10 @@ public class GardenerDto implements Cloneable{
*/ */
private Integer status; private Integer status;
/** /**
* 玩家上线时间
*/
private String onlineTime;
/**
* 玩家下线时间 * 玩家下线时间
*/ */
private String offlineTime; private String offlineTime;
...@@ -49,10 +53,30 @@ public class GardenerDto implements Cloneable{ ...@@ -49,10 +53,30 @@ public class GardenerDto implements Cloneable{
*/ */
private List<Integer> petNoFeedTimesList; private List<Integer> petNoFeedTimesList;
/** /**
* 累计任务,key为eventId,value为次数 * 养成任务,key为eventId,value为次数
*/ */
private Map<Integer, Integer> taskCountMap; private Map<Integer, Integer> taskCountMap;
/** /**
* 养成任务完成情况,key为taskId,value为完成情况:0-未完成,1-已完成
*/
private Map<Integer, Integer> taskFinishMap;
/**
* 日常任务,key为eventId,value为次数
*/
private Map<Integer, Integer> dailyTaskCountMap;
/**
* 日常任务完成情况,key为taskId,value为完成情况:0-未完成,1-已完成
*/
private Map<Integer, Integer> dailyTaskFinishMap;
/**
* 日常任务重置时间
*/
private String dailyTaskResetTime;
/**
* 新手引导任务指定的物品和数量统计:Map<新手引导操作ID, 物品数量>
*/
private Map<Integer, Integer> noviceGuideTaskMap;
/**
* 好友列表 * 好友列表
*/ */
private List<FriendDto> friendList; private List<FriendDto> friendList;
......
...@@ -78,6 +78,10 @@ public class GardenerInfoDto implements Serializable { ...@@ -78,6 +78,10 @@ public class GardenerInfoDto implements Serializable {
* 修改时间 * 修改时间
* */ * */
private String updateTime; private String updateTime;
/**
* 园丁名称免费修改次数
* */
private Integer renameFreeTimes;
public GardenerInfoDto(String uid, String name, Integer gender) { public GardenerInfoDto(String uid, String name, Integer gender) {
this.uid = uid; this.uid = uid;
......
package com.qiwuai.garden.dto;
import lombok.Data;
//或将弃用
@Data
public class TaskFinishedDto {
/**
* 返回文本
*/
private String resultText = "";
/**
* 任务id
*/
private Integer taskId;
}
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class TaskResultDto {
/**
* 任务id
*/
private Integer taskId;
/**
* 返回文本
*/
private String resultText = "";
/**
* 升级任务完成结果
*/
private boolean finished = false;
}
...@@ -17,6 +17,14 @@ public class ResultResponse { ...@@ -17,6 +17,14 @@ public class ResultResponse {
*/ */
private String 后台附加返回; private String 后台附加返回;
/** /**
* 后台附加返回2,bot二次确认升级任务完成情况需要的参数
*/
private String 后台附加返回2;
/**
* 消息推送附加返回,bot查看提醒消息时二次确认需要的参数
*/
private String 消息推送附加返回;
/**
* 玩家当前位置,bot用于判断玩家是否访问他人,仅在访问他人时返回“非本人” * 玩家当前位置,bot用于判断玩家是否访问他人,仅在访问他人时返回“非本人”
*/ */
private String 玩家当前位置; private String 玩家当前位置;
...@@ -24,6 +32,10 @@ public class ResultResponse { ...@@ -24,6 +32,10 @@ public class ResultResponse {
* 消息提醒,玩家有新信息时返回该值 * 消息提醒,玩家有新信息时返回该值
*/ */
private String 消息提醒; private String 消息提醒;
/**
* 任务完成,玩家每完成一个新手引导任务返回该变量提示bot进入新手引导的话术
*/
private String 任务完成;
/***************************用于清空bot端保留的变量***********************************/ /***************************用于清空bot端保留的变量***********************************/
/** /**
...@@ -126,4 +138,8 @@ public class ResultResponse { ...@@ -126,4 +138,8 @@ public class ResultResponse {
* 简报状态 * 简报状态
*/ */
private String 简报状态; private String 简报状态;
/**
* 保存附加返回
*/
private String 保存附加返回;
} }
package com.qiwuai.garden.dto.request; package com.qiwuai.garden.dto.request;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
@Data @Data
...@@ -112,4 +114,29 @@ public class CallRequest { ...@@ -112,4 +114,29 @@ public class CallRequest {
* 简报状态 * 简报状态
*/ */
private String 简报状态; private String 简报状态;
/**
* 离线时长
*/
private String 离线时长;
/**
* 任务类型
*/
private String 任务类型;
/**
* 保存附加返回
*/
private String 保存附加返回;
/**
* 任务奖励
*/
private String 任务奖励;
/**
* 奖励数量
*/
private String 奖励数量;
/**
* GB_新手引导步骤(bot的全局变量)
*/
@JsonProperty(value = "GB_新手引导步骤")
private String GB_新手引导步骤;
} }
...@@ -133,6 +133,30 @@ public class OperationRequest { ...@@ -133,6 +133,30 @@ public class OperationRequest {
*/ */
private String messageContent; private String messageContent;
/** /**
* 离线时长
*/
private Integer offlineDays;
/**
* 任务类型
*/
private Integer taskType;
/**
* 保存附加返回
*/
private String savaAddReturn;
/**
* 任务奖励
*/
private Integer taskAward;
/**
* 奖励数量
*/
private Integer awardNum;
/**
* GB_新手引导步骤
*/
private String noviceGuide;
/**
* 本轮操作标识 * 本轮操作标识
*/ */
private Integer operationLabel; private Integer operationLabel;
......
package com.qiwuai.garden.pojo;
import lombok.Data;
@Data
public class TaskTypePojo {
/**
* 任务类型id
*/
private Integer id;
/**
* 任务类型描述
*/
private String description;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
}
...@@ -11,7 +11,7 @@ public interface BackPackService { ...@@ -11,7 +11,7 @@ public interface BackPackService {
*/ */
CommonResponse viewBackPack(OperationRequest operationReq); CommonResponse viewBackPack(OperationRequest operationReq);
/** /**
* 根据物品种类查看背包中物品详情 * 分类检索。根据物品种类查看背包中物品详情
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
...@@ -28,4 +28,10 @@ public interface BackPackService { ...@@ -28,4 +28,10 @@ public interface BackPackService {
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchItemInfo(OperationRequest operationReq); CommonResponse searchItemInfo(OperationRequest operationReq);
/**
* 发放奖励
* @param operationReq
* @return CommonResponse
*/
CommonResponse taskAward(OperationRequest operationReq);
} }
...@@ -18,9 +18,7 @@ import org.slf4j.LoggerFactory; ...@@ -18,9 +18,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.HashMap; import java.util.*;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
...@@ -36,13 +34,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -36,13 +34,6 @@ public class BackPackServiceImpl implements BackPackService {
String uid = operationReq.getUid(); String uid = operationReq.getUid();
log.info(uid + "开始查看背包详情"); log.info(uid + "开始查看背包详情");
//用户不存在的情况
if (StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) {
log.info(uid + "用户不存在");
commonResponse.setCode(0);
commonResponse.setMsg("失败,用户不存在");
return commonResponse;
}
//获取背包中的所有袋子 //获取背包中的所有袋子
Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags(); Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags();
...@@ -92,13 +83,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -92,13 +83,6 @@ public class BackPackServiceImpl implements BackPackService {
String uid = operationReq.getUid(); String uid = operationReq.getUid();
Integer itemTypeId = operationReq.getItemTypeId(); Integer itemTypeId = operationReq.getItemTypeId();
log.info(uid + "开始根据物品种类查看背包详情"); log.info(uid + "开始根据物品种类查看背包详情");
//用户不存在的情况
if (StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) {
log.info(uid + "用户不存在");
commonResponse.setCode(0);
commonResponse.setMsg("失败,用户不存在");
return commonResponse;
}
//园丁性别 //园丁性别
String gender = TimingAcquisition.getGardenerGender(uid); String gender = TimingAcquisition.getGardenerGender(uid);
//玩家没提供物品类型 //玩家没提供物品类型
...@@ -109,6 +93,7 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -109,6 +93,7 @@ public class BackPackServiceImpl implements BackPackService {
commonResponse.setMsg("成功"); commonResponse.setMsg("成功");
resultResponse.set反馈ID(200403); resultResponse.set反馈ID(200403);
resultResponse.set反馈文本(text); resultResponse.set反馈文本(text);
resultResponse.set后台附加返回("分类检索回复2");
resultVarsResponse.setVars(resultResponse); resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
return commonResponse; return commonResponse;
...@@ -195,6 +180,7 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -195,6 +180,7 @@ public class BackPackServiceImpl implements BackPackService {
text += SpeechUtil.getGardenerSpeech(gender, "view_back_pack_item_lot"); text += SpeechUtil.getGardenerSpeech(gender, "view_back_pack_item_lot");
} else { //背包物品数量少的情况,园丁的回答 } else { //背包物品数量少的情况,园丁的回答
text += SpeechUtil.getGardenerSpeech(gender, "view_back_pack_item_few"); text += SpeechUtil.getGardenerSpeech(gender, "view_back_pack_item_few");
resultResponse.set后台附加返回("查看背包回复2");
} }
log.info("物品详情查询结果:" + feedText.toString()); log.info("物品详情查询结果:" + feedText.toString());
commonResponse.setCode(1); commonResponse.setCode(1);
...@@ -214,13 +200,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -214,13 +200,6 @@ public class BackPackServiceImpl implements BackPackService {
String uid = operationReq.getUid(); String uid = operationReq.getUid();
log.info(uid + "开始查看货币"); log.info(uid + "开始查看货币");
//用户不存在的情况
if (StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) {
log.info(uid + "用户不存在");
commonResponse.setCode(0);
commonResponse.setMsg("失败,用户不存在");
return commonResponse;
}
//物品配置信息 //物品配置信息
Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap; Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap;
//获取背包中的所有袋子 //获取背包中的所有袋子
...@@ -279,13 +258,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -279,13 +258,6 @@ public class BackPackServiceImpl implements BackPackService {
Integer itemId = operationReq.getItemId(); Integer itemId = operationReq.getItemId();
Integer itemTypeId = operationReq.getItemTypeId(); Integer itemTypeId = operationReq.getItemTypeId();
log.info(uid + "开始检索物品信息"); log.info(uid + "开始检索物品信息");
//用户不存在的情况
if (StringUtils.isEmpty(TimingAcquisition.gardenerMap.get(uid))) {
log.info(uid + "用户不存在");
commonResponse.setCode(0);
commonResponse.setMsg("失败,用户不存在");
return commonResponse;
}
//园丁性别 //园丁性别
String gender = TimingAcquisition.getGardenerGender(uid); String gender = TimingAcquisition.getGardenerGender(uid);
//玩家没提供物品名称 //玩家没提供物品名称
...@@ -297,6 +269,7 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -297,6 +269,7 @@ public class BackPackServiceImpl implements BackPackService {
commonResponse.setMsg("成功"); commonResponse.setMsg("成功");
resultResponse.set反馈ID(200603); resultResponse.set反馈ID(200603);
resultResponse.set反馈文本(text); resultResponse.set反馈文本(text);
resultResponse.set后台附加返回("检索物品回复2");
resultVarsResponse.setVars(resultResponse); resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
return commonResponse; return commonResponse;
...@@ -331,12 +304,13 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -331,12 +304,13 @@ public class BackPackServiceImpl implements BackPackService {
if (StringUtils.isEmpty(item) || item.getItemNum() == 0) { if (StringUtils.isEmpty(item) || item.getItemNum() == 0) {
if (!StringUtils.isEmpty(plant)) { if (!StringUtils.isEmpty(plant)) {
text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "search_item_info_fruit_none"); text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "search_item_info_fruit_none");
text = SpeechUtil.speechReplaceNum(text, itemConfig.getName(), itemConfig.getDescription(), "0", plant.getName()); text = SpeechUtil.speechReplaceNum(text, itemConfig.getName(), itemConfig.getDescription(), plant.getName());
text += SpeechUtil.getGardenerSpeech(gender, "search_item_info_fruit_none");
} else { } else {
text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "search_item_info_item_none"); text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "search_item_info_item_none");
text = SpeechUtil.speechReplaceNum(text, itemConfig.getName(), itemConfig.getDescription(), "0"); text = SpeechUtil.speechReplaceNum(text, itemConfig.getName(), itemConfig.getDescription());
text += SpeechUtil.getGardenerSpeech(gender, "search_item_info_item_none");
} }
text += SpeechUtil.getGardenerSpeech(gender, "search_item_info_fruit_none");
log.info(uid + "没有检索到物品信息:" + itemConfig.getName()); log.info(uid + "没有检索到物品信息:" + itemConfig.getName());
commonResponse.setCode(1); commonResponse.setCode(1);
commonResponse.setMsg("成功"); commonResponse.setMsg("成功");
...@@ -357,4 +331,30 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -357,4 +331,30 @@ public class BackPackServiceImpl implements BackPackService {
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
return commonResponse; return commonResponse;
} }
@Override
public CommonResponse taskAward(OperationRequest operationReq) {
CommonResponse commonResponse = new CommonResponse();
ResultVarsResponse resultVarsResponse = new ResultVarsResponse();
ResultResponse resultResponse = new ResultResponse();
String uid = operationReq.getUid();
Integer taskAward = operationReq.getTaskAward(); //任务奖励
Integer awardNum = operationReq.getAwardNum(); //奖励数量
log.info(uid + "发放奖励:" + awardNum + "个" + taskAward);
List<ItemDto> awardItemList = new ArrayList<>();
ItemDto item = new ItemDto();
item.setItemId(taskAward);
item.setItemNum(awardNum);
awardItemList.add(item);
//给玩家发放奖励
TimingAcquisition.addAwardItem(uid, awardItemList);
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(200901);
resultResponse.set反馈文本("成功发放奖励");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
} }
...@@ -5,12 +5,24 @@ import com.qiwuai.garden.dto.request.OperationRequest; ...@@ -5,12 +5,24 @@ import com.qiwuai.garden.dto.request.OperationRequest;
public interface GardenerService { public interface GardenerService {
/** /**
* 进入游戏。清除该玩家现有缓存
* @param
* @param
*/
CommonResponse enterGame(OperationRequest operationReq);
/**
* 创建园丁 * 创建园丁
* @param * @param
* @param * @param
*/ */
CommonResponse create(OperationRequest operationReq); CommonResponse create(OperationRequest operationReq);
/** /**
* 更改园丁性别
* @param
* @param
*/
CommonResponse changeGender(OperationRequest operationReq);
/**
* 查看园丁等级 * 查看园丁等级
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
......
...@@ -10,7 +10,13 @@ public interface NurseryService { ...@@ -10,7 +10,13 @@ public interface NurseryService {
List<NurseryPojo> findAll(); List<NurseryPojo> findAll();
/** /**
* 查看花圃,根据花圃编号查询当前花圃状态 * 查看花圃花圃数量指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkNurseryAmount(OperationRequest operationReq);
/**
* 查看花圃指令,查看花圃概览信息
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
...@@ -52,12 +58,24 @@ public interface NurseryService { ...@@ -52,12 +58,24 @@ public interface NurseryService {
*/ */
CommonResponse nurseryUpgradeCancel(OperationRequest operationReq); CommonResponse nurseryUpgradeCancel(OperationRequest operationReq);
/** /**
* 开启新花圃, 开垦/开启花圃 * 开启新花圃, 查询所需条件
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryReclaimCheck(OperationRequest operationReq);
/**
* 确认开启新花圃, 开垦/开启花圃
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse nurseryReclaim(OperationRequest operationReq); CommonResponse nurseryReclaim(OperationRequest operationReq);
/** /**
* 取消开启新花圃
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryReclaimCancel(OperationRequest operationReq);
/**
* 查询可以重置的花圃 * 查询可以重置的花圃
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
......
...@@ -69,5 +69,29 @@ public interface PetService { ...@@ -69,5 +69,29 @@ public interface PetService {
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse nurseryPetNumCheck(OperationRequest operationReq);
/**
* 总览查询指令,查看当前所有宠物
* @param operationReq
* @return CommonResponse
*/
CommonResponse petOverview(OperationRequest operationReq);
/**
* 查询花圃宠物指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryPetCheck(OperationRequest operationReq); CommonResponse nurseryPetCheck(OperationRequest operationReq);
/**
* 确认查询花圃宠物指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryPetCheckSure(OperationRequest operationReq);
/**
* 取消查询花圃宠物指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryPetCheckCancel(OperationRequest operationReq);
} }
...@@ -23,24 +23,42 @@ public interface PlantService { ...@@ -23,24 +23,42 @@ public interface PlantService {
int plantAttributeAdd(PlantAttributeConfigReq plantAttributeConfigReq); int plantAttributeAdd(PlantAttributeConfigReq plantAttributeConfigReq);
/** /**
* 园丁播种 * 种植
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse seedCheck(OperationRequest operationReq); CommonResponse seedCheck(OperationRequest operationReq);
/** /**
* 确认园丁播种 * 确认种植
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse seed(OperationRequest operationReq) throws ParseException; CommonResponse seed(OperationRequest operationReq) throws ParseException;
/** /**
* 取消园丁播种 * 取消种植
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse seedCancel(OperationRequest operationReq); CommonResponse seedCancel(OperationRequest operationReq);
/** /**
* 批量种植
* @param operationReq
* @return CommonResponse
*/
CommonResponse batchSeedCheck(OperationRequest operationReq) throws ParseException;
/**
* 确认批量种植
* @param operationReq
* @return CommonResponse
*/
CommonResponse batchSeed(OperationRequest operationReq) throws ParseException;
/**
* 取消批量种植
* @param operationReq
* @return CommonResponse
*/
CommonResponse batchSeedCancel(OperationRequest operationReq);
/**
* 收取,园丁收获 * 收取,园丁收获
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
...@@ -70,4 +88,10 @@ public interface PlantService { ...@@ -70,4 +88,10 @@ public interface PlantService {
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse clearPlantCancel(OperationRequest operationReq); CommonResponse clearPlantCancel(OperationRequest operationReq);
/**
* 查询植物成熟时间指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkPlantMatureTime(OperationRequest operationReq) throws ParseException;
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,6 +3,8 @@ package com.qiwuai.garden.service.socialService; ...@@ -3,6 +3,8 @@ package com.qiwuai.garden.service.socialService;
import com.qiwuai.garden.dto.base.CommonResponse; import com.qiwuai.garden.dto.base.CommonResponse;
import com.qiwuai.garden.dto.request.OperationRequest; import com.qiwuai.garden.dto.request.OperationRequest;
import java.text.ParseException;
public interface SocialService { public interface SocialService {
/** /**
* 拜访陌生人/好友 * 拜访陌生人/好友
...@@ -171,8 +173,32 @@ public interface SocialService { ...@@ -171,8 +173,32 @@ public interface SocialService {
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse deleteReportCheck(OperationRequest operationReq);
/**
* 删除帮助简报
* @param operationReq
* @return CommonResponse
*/
CommonResponse deleteHelpReportCheck(OperationRequest operationReq);
/**
* 删除偷菜简报
* @param operationReq
* @return CommonResponse
*/
CommonResponse deleteStealReportCheck(OperationRequest operationReq);
/**
* 确认删除简报
* @param operationReq
* @return CommonResponse
*/
CommonResponse deleteReport(OperationRequest operationReq); CommonResponse deleteReport(OperationRequest operationReq);
/** /**
* 取消删除简报
* @param operationReq
* @return CommonResponse
*/
CommonResponse deleteReportCancel(OperationRequest operationReq);
/**
* 查看提醒消息。检查玩家是否有新消息,有则添加后台返回值给bot端 * 查看提醒消息。检查玩家是否有新消息,有则添加后台返回值给bot端
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
...@@ -220,4 +246,46 @@ public interface SocialService { ...@@ -220,4 +246,46 @@ public interface SocialService {
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse readNextMessage(OperationRequest operationReq); CommonResponse readNextMessage(OperationRequest operationReq);
/**
* 查询好友数量
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkFriendNum(OperationRequest operationReq);
/**
* 查询在线好友数量
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkOnlineFriendNum(OperationRequest operationReq);
/**
* 查询好友,找到所有好友
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkFriendInfo(OperationRequest operationReq);
/**
* 离线筛选好友,通过离线时长条件筛选的好友
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkOfflineFriend(OperationRequest operationReq) throws ParseException;
/**
* 返回自家花园
* @param operationReq
* @return CommonResponse
*/
CommonResponse backHome(OperationRequest operationReq);
/**
* 返回自家花园
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkNurseryAmountSide(OperationRequest operationReq);
/**
* 查询他人指定花圃宠物
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryPetSideCheck(OperationRequest operationReq);
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.qiwuai.garden.service.taskService; package com.qiwuai.garden.service.taskService;
import com.qiwuai.garden.dto.base.CommonResponse;
import com.qiwuai.garden.dto.request.OperationRequest;
public interface TaskService { public interface TaskService {
/**
* 确定该留言
* @param operationReq
* @return CommonResponse
*/
CommonResponse checkTask(OperationRequest operationReq);
} }
spring: spring:
profiles: profiles:
active: uat active: dev
\ No newline at end of file \ No newline at end of file
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.ItemTypeMapper"> <mapper namespace="com.qiwuai.garden.dao.TaskTypeMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.ItemTypePojo"> <select id="findAll" resultType="com.qiwuai.garden.pojo.TaskTypePojo">
select select
id, description, create_time, update_time id, description
from from
item_type task_type
</select> </select>
</mapper> </mapper>
\ No newline at end of file
#存放路径已改为:/home/secretGarden/secretGardenSpeech/ #存放路径已改为:/home/secretGarden/secretGardenSpeech/
aside: aside:
#进入游戏
enter_game:
- 【旁白@正常】欢迎进入秘密花园。
#园丁升级 #园丁升级
nursery_level_check: gardener_level_check:
- 【旁白@正常】园丁目前的等级为【1】级。 - 【旁白@正常】园丁目前的等级为【1】级。
nursery_upgrade_check: gardener_upgrade_check:
- 【旁白@正常】园丁目前的等级为【1】级,升到下一级需要消耗【2】,请问是否确认升级? - 【旁白@正常】园丁目前的等级为【1】级,升到下一级需要完成【2】,请问是否确认升级?
nursery_upgrade_success: gardener_upgrade_success:
- 【旁白@正常】已为园丁进行升级。现在可以选一个技能学习,【1】,要学习哪个技能呢?注意:没有选到的技能以后就不能学习了。 - 【旁白@正常】已为园丁进行升级。现在可以选一个技能学习,【1】,要学习哪个技能呢?注意:没有选到的技能以后就不能学习了。
nursery_upgrade_fail: gardener_upgrade_fail:
- 【旁白@正常】目前缺少【1】,无法进行升级。 - 【旁白@正常】目前缺少【1】,无法进行升级。
nursery_upgrade_fail_had: gardener_upgrade_fail_had:
- 【旁白@正常】已达到最大等级。 - 【旁白@正常】已达到最大等级。
nursery_upgrade_fail_task: gardener_upgrade_fail_task:
- 【旁白@正常】未完成升级任务,【1】。 - 【旁白@正常】未完成升级任务,【1】。
nursery_upgrade_cancel: gardener_upgrade_cancel:
- 【旁白@正常】已取消园丁升级。 - 【旁白@正常】已取消园丁升级。
#学习技能 #学习技能
learn_skill_check: learn_skill_check:
...@@ -44,8 +47,10 @@ aside: ...@@ -44,8 +47,10 @@ aside:
reset_skill_cancel: reset_skill_cancel:
- 【旁白@正常】已取消重置技能。 - 【旁白@正常】已取消重置技能。
#园丁更名 #园丁更名
rename_check_first_free:
- 【旁白@正常】你要为园丁更名?首次可以免费修改。
rename_check: rename_check:
- 【旁白@正常】你要为园丁更名?需要花费【1】 - 【旁白@正常】你要为园丁更名?需要花费【1】。
rename_success: rename_success:
- 【旁白@正常】更名成功。 - 【旁白@正常】更名成功。
rename_fail: rename_fail:
...@@ -68,9 +73,9 @@ aside: ...@@ -68,9 +73,9 @@ aside:
search_item_info: search_item_info:
- 【旁白@正常】【1】,【2】,背包里目前拥有【3】个。 - 【旁白@正常】【1】,【2】,背包里目前拥有【3】个。
search_item_info_fruit_none: search_item_info_fruit_none:
- 【旁白@正常】【1】,【2】,背包里目前拥有【3】个。可以通过种植【4】在收获果实的时候获得。 - 【旁白@正常】【1】,【2】,目前背包里还没有。可以通过种植【3】在收获果实的时候获得。
search_item_info_item_none: search_item_info_item_none:
- 【旁白@正常】【1】,【2】,背包里目前拥有【3】个。可以在商店购买获得。 - 【旁白@正常】【1】,【2】,目前背包里还没有。可以在商店购买获得。
search_item_info_no_exist: search_item_info_no_exist:
- 【旁白@正常】该物品不存在。 - 【旁白@正常】该物品不存在。
...@@ -78,19 +83,19 @@ aside: ...@@ -78,19 +83,19 @@ aside:
man: man:
#园丁升级 #园丁升级
nursery_upgrade_check: gardener_upgrade_check:
- 【男园丁@正常】主人,升级才能让我变得更强大,我想要升级! - 【男园丁@正常】主人,升级才能让我变得更强大,我想要升级!
- 【男园丁@正常】让我升级吧主人! - 【男园丁@正常】让我升级吧主人!
- 【男园丁@正常】我想升级很久了! - 【男园丁@正常】我想升级很久了!
nursery_upgrade_success: gardener_upgrade_success:
- 【男园丁@正常】谢谢主人,我升级成功了!可以更好的帮助主人管理花园了! - 【男园丁@正常】谢谢主人,我升级成功了!可以更好的帮助主人管理花园了!
nursery_upgrade_fail: gardener_upgrade_fail:
- 【男园丁@正常】很抱歉主人,我这次升级失败了…… - 【男园丁@正常】很抱歉主人,我这次升级失败了……
nursery_upgrade_fail_had: gardener_upgrade_fail_had:
- 【男园丁@正常】谢谢主人,满级了。 - 【男园丁@正常】谢谢主人,满级了。
nursery_upgrade_fail_task: gardener_upgrade_fail_task:
- 【男园丁@正常】主人升级不了的话,要了解一下任务详情吗? - 【男园丁@正常】主人升级不了的话,要了解一下任务详情吗?
nursery_upgrade_cancel: gardener_upgrade_cancel:
- 【男园丁@正常】主人有机会下次在帮我升级吧。 - 【男园丁@正常】主人有机会下次在帮我升级吧。
#学习技能 #学习技能
learn_skill_check: learn_skill_check:
...@@ -123,6 +128,8 @@ man: ...@@ -123,6 +128,8 @@ man:
reset_skill_cancel: reset_skill_cancel:
- 【男园丁@正常】我也不想重置技能,还是主人懂我。 - 【男园丁@正常】我也不想重置技能,还是主人懂我。
#园丁更名 #园丁更名
rename_check_first_free:
- 【男园丁@正常】只要主人开心就好,我都可以。
rename_check: rename_check:
- 【男园丁@正常】主人,改名要花货币的,你确定要为我改名吗? - 【男园丁@正常】主人,改名要花货币的,你确定要为我改名吗?
- 【男园丁@正常】我现在的名字不好吗?改名花费的货币可不少,你想好了吗? - 【男园丁@正常】我现在的名字不好吗?改名花费的货币可不少,你想好了吗?
...@@ -168,19 +175,19 @@ man: ...@@ -168,19 +175,19 @@ man:
woman: woman:
#园丁升级 #园丁升级
nursery_upgrade_check: gardener_upgrade_check:
- 【女园丁@正常】升级后我的能力也会跟着提升哦! - 【女园丁@正常】升级后我的能力也会跟着提升哦!
- 【女园丁@正常】快让我升级好吗,主人? - 【女园丁@正常】快让我升级好吗,主人?
- 【女园丁@正常】当然要确认啊!我想升级很久了! - 【女园丁@正常】当然要确认啊!我想升级很久了!
nursery_upgrade_success: gardener_upgrade_success:
- 【女园丁@正常】我又变厉害了一点,能为主人做更多事了! - 【女园丁@正常】我又变厉害了一点,能为主人做更多事了!
nursery_upgrade_fail: gardener_upgrade_fail:
- 【女园丁@正常】啊……我无法获得更强大的力量升级了吗…… - 【女园丁@正常】啊……我无法获得更强大的力量升级了吗……
nursery_upgrade_fail_had: gardener_upgrade_fail_had:
- 【女园丁@正常】厉害了主人,我满级可以帮主人更多的忙。 - 【女园丁@正常】厉害了主人,我满级可以帮主人更多的忙。
nursery_upgrade_fail_task: gardener_upgrade_fail_task:
- 【女园丁@正常】升级不了呢,要不我们去看一下任务详情吧。 - 【女园丁@正常】升级不了呢,要不我们去看一下任务详情吧。
nursery_upgrade_cancel: gardener_upgrade_cancel:
- 【女园丁@正常】虽然不升级了,但是我依旧会能帮到主人的。 - 【女园丁@正常】虽然不升级了,但是我依旧会能帮到主人的。
#学习技能 #学习技能
learn_skill_check: learn_skill_check:
...@@ -213,6 +220,8 @@ woman: ...@@ -213,6 +220,8 @@ woman:
reset_skill_cancel: reset_skill_cancel:
- 【女园丁@正常】好不容易学会的技能我才一点都不想要重置,主人你做了正确的选择。 - 【女园丁@正常】好不容易学会的技能我才一点都不想要重置,主人你做了正确的选择。
#园丁更名 #园丁更名
rename_check_first_free:
- 【女园丁@正常】第一次免费,好耶,主人改什么都可以,我听主人的。
rename_check: rename_check:
- 【女园丁@正常】改名可是要花一笔钱的哦!主人你想好了吗? - 【女园丁@正常】改名可是要花一笔钱的哦!主人你想好了吗?
- 【女园丁@正常】看来你对我现在的名字不是很满意,不过这笔改名的费用是需要我们自己出的……主人你还要给我改名吗? - 【女园丁@正常】看来你对我现在的名字不是很满意,不过这笔改名的费用是需要我们自己出的……主人你还要给我改名吗?
...@@ -231,7 +240,7 @@ woman: ...@@ -231,7 +240,7 @@ woman:
view_back_pack_item_lot: view_back_pack_item_lot:
- 【女园丁@正常】这么多东西都是我为主人积攒的,我真厉害。 - 【女园丁@正常】这么多东西都是我为主人积攒的,我真厉害。
view_back_pack_item_few: view_back_pack_item_few:
- 【女园丁@正常】就这么一点?看来我们还要继续努力啊主人。 - 【女园丁@正常】就这么一点?看来我们还要继续努力啊主人,不然我们去种一些植物吧。
view_back_pack_item_fail_no_type: view_back_pack_item_fail_no_type:
- 【女园丁@正常】主人,你想看哪类物品呢? - 【女园丁@正常】主人,你想看哪类物品呢?
view_back_pack_item_fail_not_exist: view_back_pack_item_fail_not_exist:
...@@ -245,7 +254,7 @@ woman: ...@@ -245,7 +254,7 @@ woman:
search_item_info_not_have: search_item_info_not_have:
- 【女园丁@正常】这种东西比较稀有,我陪主人去找找看吧。 - 【女园丁@正常】这种东西比较稀有,我陪主人去找找看吧。
search_item_info_fruit_none: search_item_info_fruit_none:
- 【女园丁@正常】有的是办法,主人,我陪你去种一些。 - 【女园丁@正常】有的是办法,主人,我陪你去找一些。
search_item_info_item_none: search_item_info_item_none:
- 【女园丁@正常】那我就陪主人逛逛商店吧。 - 【女园丁@正常】那我就陪主人逛逛商店吧。
search_item_info_no_item: search_item_info_no_item:
......
...@@ -18,6 +18,8 @@ aside: ...@@ -18,6 +18,8 @@ aside:
buy_cancel: buy_cancel:
- 【旁白@正常】好的,已为你取消购买。那要看看别的物品吗? - 【旁白@正常】好的,已为你取消购买。那要看看别的物品吗?
#出售商品 #出售商品
sell_check_item_no_name:
- 【旁白@正常】你的背包现在有【1】,你想出售哪个?
sell_check_success: sell_check_success:
- 【旁白@正常】出售【1】个【2】,可获得【3】【4】,确认出售? - 【旁白@正常】出售【1】个【2】,可获得【3】【4】,确认出售?
sell_check_fail_num: sell_check_fail_num:
...@@ -27,13 +29,15 @@ aside: ...@@ -27,13 +29,15 @@ aside:
sell_check_fail_none: sell_check_fail_none:
- 【旁白@正常】背包还没有【1】。 - 【旁白@正常】背包还没有【1】。
sell_check_item_success: sell_check_item_success:
- 【旁白@正常】【1】当前一共有【2】个【3】,请问想要出售多少个? - 【旁白@正常】当前一共有【1】个【2】,请问想要出售多少个?
sell_success: sell_success:
- 【旁白@正常】已成功出售【1】个【2】,为你赚取了【3】【4】。 - 【旁白@正常】已成功出售【1】个【2】,为你赚取了【3】【4】。
sell_cancel: sell_cancel:
- 【旁白@正常】好的,已取消出售。 - 【旁白@正常】好的,已取消出售。
sell_all_check_success: sell_all_check_success:
- 【旁白@正常】出售背包里的所有【1】一共可获得【2】【3】,是否确定出售? - 【旁白@正常】出售背包里的所有【1】一共可获得【2】【3】,是否确定出售?
sell_all_check_fail_none:
- 【旁白@正常】背包里已经没有【1】了。
sell_all_check_fail_no_exist: sell_all_check_fail_no_exist:
- 【旁白@正常】不存在这类物品。 - 【旁白@正常】不存在这类物品。
sell_all_success: sell_all_success:
...@@ -130,7 +134,7 @@ woman: ...@@ -130,7 +134,7 @@ woman:
- 【女园丁@正常】你要买这个东西吗主人? - 【女园丁@正常】你要买这个东西吗主人?
buy_check_fail_no_name: buy_check_fail_no_name:
- 【女园丁@正常】主人,可以直接说出你想购买东西的名称,不然我也不知道你想买什么…… - 【女园丁@正常】主人,可以直接说出你想购买东西的名称,不然我也不知道你想买什么……
- 【女园丁@正常】主人想买种子还是材料啊? - 【女园丁@正常】主人想买果实还是材料啊?
- 【女园丁@正常】你要买东西的话,告诉我名字就好了。 - 【女园丁@正常】你要买东西的话,告诉我名字就好了。
buy_check_fail_no_num: buy_check_fail_no_num:
- 【女园丁@正常】我建议一次性购买,种满花圃后就不用麻烦再来买了! - 【女园丁@正常】我建议一次性购买,种满花圃后就不用麻烦再来买了!
...@@ -162,7 +166,7 @@ woman: ...@@ -162,7 +166,7 @@ woman:
- 【女园丁@正常】主人,没有这个物品呀,看看别的吧。 - 【女园丁@正常】主人,没有这个物品呀,看看别的吧。
sell_success: sell_success:
- 【女园丁@正常】赚到不少钱了,离成为富翁更进一步了! - 【女园丁@正常】赚到不少钱了,离成为富翁更进一步了!
- 【女园丁@正常】主人喜欢钱吗?下次我会种更多的植物,帮主人赚更多更多的钱。 - 【女园丁@正常】主人,下次我会种更多的植物,帮主人赚更多更多的钱。
- 【女园丁@正常】有主人在,我们的花园一定会成为全世界最富有的花园! - 【女园丁@正常】有主人在,我们的花园一定会成为全世界最富有的花园!
sell_cancel: sell_cancel:
- 【女园丁@正常】要不要卖掉背包里的其他东西?总不能空手而归吧。 - 【女园丁@正常】要不要卖掉背包里的其他东西?总不能空手而归吧。
......
#存放路径已改为:/home/secretGarden/secretGardenSpeech/ #存放路径已改为:/home/secretGarden/secretGardenSpeech/
aisde: aside:
#查看任务
check_task_fail_no_name:
- 【旁白@正常】未提供任务类型。目前有【1】。
check_task_fail_wrong_type:
- 【旁白@正常】不存在该类型的任务。
#查看园丁升级任务状态 #查看园丁升级任务状态
check_update_task_status_unfinished: check_update_task_status_unfinished:
- 【旁白@正常】园丁升至【1】级还需要完成【2】任务,目前已完成【3】,接下来还需完成【4】。 - 【旁白@正常】园丁升至【1】级还需要完成【2】
update_task_status_unfinished: #该话术放到上一句的【2】中
- 任务【1】,目前已完成【2】次,接下来还需完成【3】次。
check_update_task_status_finished: check_update_task_status_finished:
- 【旁白@正常】园丁所需的等级任务全部都完成了。 - 【旁白@正常】园丁所需的等级任务全部都完成了。
#询问日常任务 #询问日常任务
check_daily_task_status_unfinished: check_daily_task_status_unfinished:
- 【旁白@正常】今天的日常任务已完成【1】任务,还需完成【2】任务。 - 【旁白@正常】今天的日常任务已完成任务【1】,未完成的有:【2】。
check_daily_task_status_unfinished_only:
- 【旁白@正常】今天的日常任务未完成的有:【1】。
daily_task_status_unfinished: #该话术放到第一句的【2】和第二句的【1】中
- 【1】,已完成【2】次,完成后获得奖励【3】。
check_daily_task_status_finished: check_daily_task_status_finished:
- 【旁白@正常】日常任务已全部完成。 - 【旁白@正常】日常任务已全部完成。
#任务提醒
#园丁任务完成提示 #园丁任务完成提示
update_task_finished: update_task_finished:
- 【旁白@正常】当前【1】任务已完成。 - 【旁白@正常】当前【1】任务已完成。
update_task_level_finished: update_task_level_finished:
- 【旁白@正常】已完成【1】任务,园丁升级条件已满足。 - 【旁白@正常】已完成【1】任务,园丁升级条件已满足。
daily_task_finished: daily_task_finished:
- 【旁白@正常】日常【1】任务已完成,获得【2】个【3】奖励。 - 【旁白@正常】日常【1】任务已完成,获得奖励:【2】。
daily_task_all_finished: daily_task_all_finished:
- 【旁白@正常】日常【1】任务已完成,获得【2】奖励。 - 【旁白@正常】日常【1】任务已完成,今日任务已全部完成,获得奖励【2】。
man: man:
#查看任务
check_task_fail_no_name:
- 【男园丁@正常】主人,你还告诉想看哪种任务类型呢。
#查看园丁升级任务状态 #查看园丁升级任务状态
check_update_task_status_unfinished: check_update_task_status_unfinished:
- 【男园丁@正常】我会早日完成,争取变得更强! - 【男园丁@正常】我会早日完成,争取变得更强!
...@@ -43,6 +58,7 @@ man: ...@@ -43,6 +58,7 @@ man:
- 【男园丁@正常】主人真勤快,明天的任务也要继续努力。 - 【男园丁@正常】主人真勤快,明天的任务也要继续努力。
- 【男园丁@正常】辛苦了,好好休息一下。 - 【男园丁@正常】辛苦了,好好休息一下。
- 【男园丁@正常】我为主人的能力感到自豪。 - 【男园丁@正常】我为主人的能力感到自豪。
#任务提醒
#园丁任务完成提示 #园丁任务完成提示
update_task_finished: update_task_finished:
- 【男园丁@正常】我离升到下一级又更近一步了,谢谢主人。 - 【男园丁@正常】我离升到下一级又更近一步了,谢谢主人。
...@@ -66,7 +82,10 @@ man: ...@@ -66,7 +82,10 @@ man:
women: woman:
#查看任务
check_task_fail_no_name:
- 【女园丁@正常】主人,你想看哪种类型的任务呀?
#查看园丁升级任务状态 #查看园丁升级任务状态
check_update_task_status_unfinished: check_update_task_status_unfinished:
- 【女园丁@正常】主人,我想赶快升级变强,你也要帮我一起啊! - 【女园丁@正常】主人,我想赶快升级变强,你也要帮我一起啊!
...@@ -85,6 +104,7 @@ women: ...@@ -85,6 +104,7 @@ women:
- 【女园丁@正常】日常任务每天都有,主人还要再接再厉,我们明天再来吧! - 【女园丁@正常】日常任务每天都有,主人还要再接再厉,我们明天再来吧!
- 【女园丁@正常】赶快去休息一下吧!我知道你累了。 - 【女园丁@正常】赶快去休息一下吧!我知道你累了。
- 【女园丁@正常】主人你真厉害,这么轻松就把任务给完成了,给你鼓掌! - 【女园丁@正常】主人你真厉害,这么轻松就把任务给完成了,给你鼓掌!
#任务提醒
#园丁任务完成提示 #园丁任务完成提示
update_task_finished: update_task_finished:
- 【女园丁@正常】太好了,再升到下一级我又能变强不少! - 【女园丁@正常】太好了,再升到下一级我又能变强不少!
...@@ -92,7 +112,7 @@ women: ...@@ -92,7 +112,7 @@ women:
- 【女园丁@正常】谢谢你主人,没有你的话我是不可能这么快就升级的! - 【女园丁@正常】谢谢你主人,没有你的话我是不可能这么快就升级的!
update_task_level_finished: update_task_level_finished:
- 【女园丁@正常】那就麻烦主人帮我升级吧! - 【女园丁@正常】那就麻烦主人帮我升级吧!
- 【女园丁@正常】我们花了这么长的是假,终于迎来了这至关重要的一刻啦! - 【女园丁@正常】我们花了这么长的时间,终于迎来了这至关重要的一刻啦!
- 【女园丁@正常】我已经迫不及待想要升级了! - 【女园丁@正常】我已经迫不及待想要升级了!
daily_task_finished: daily_task_finished:
- 【女园丁@正常】主人,再做几个就完成了,加油哦。 - 【女园丁@正常】主人,再做几个就完成了,加油哦。
......
server:
port: 8082
serlvet:
context-path:/secretGarden
#设置当前服务名
spring:
application:
#注册到注册中心的服务名
name: secret-garden
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: root
password: root
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
#配置间隔多久才进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 20000
#配置一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
cloud:
inetutils:
#设置主机ip超时时间,默认1秒
timeout-seconds: 10
mybatis:
type-aliases-package: com.qiwuai.garden.pojo
mapper-locations: classpath:com/qiwuai/garden/dao/*.xml
configuration:
map-underscore-to-camel-case: true
eureka:
instance:
hostname: 127.0.0.1
client:
serviceUrl:
#设置添加服务中心的地址
defaultZone: http://${eureka.instance.hostname}:8081/eureka/
#将当前服务注册到到注册中心(true)
register-with-eureka: false
#是否检索注册中心信息
fetch-registry: false
#对话过期时间
expireTime: 180000
#玩家无操作时长,默认下线
offlineTime: 180000
userFilePath: /home/secretGarden/secretGardenUser/
speechFilePath: /home/secretGarden/secretGardenSpeech/
configFilePath: /home/secretGarden/config/
messageFilePath: /home/secretGarden/message/
\ No newline at end of file
server:
port: 8090
\ No newline at end of file
server:
port: 60016
serlvet:
context-path:/secretGarden
#设置当前服务名
spring:
application:
#注册到注册中心的服务名
name: secret-garden
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: root
password: 38A0O1jEPOE
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000
#配置间隔多久才进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 20000
#配置一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
cloud:
inetutils:
#设置主机ip超时时间,默认1秒
timeout-seconds: 10
mybatis:
type-aliases-package: com.qiwuai.garden.pojo
mapper-locations: classpath:com/qiwuai/garden/dao/*.xml
configuration:
map-underscore-to-camel-case: true
eureka:
instance:
hostname: 127.0.0.1
client:
serviceUrl:
#设置添加服务中心的地址
defaultZone: http://${eureka.instance.hostname}:8081/eureka/
#将当前服务注册到到注册中心(true)
register-with-eureka: false
#是否检索注册中心信息
fetch-registry: false
#对话过期时间
expireTime: 180000
#玩家无操作时长,默认下线
offlineTime: 180000
userFilePath: /home/secretGarden/secretGardenUser/
speechFilePath: /home/secretGarden/secretGardenSpeech/
configFilePath: /home/secretGarden/config/
messageFilePath: /home/secretGarden/message/
\ No newline at end of file
spring:
profiles:
active: uat
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.AddItemMapper">
<resultMap id="AddItemResult" type="com.qiwuai.garden.dto.AddItemDto">
<id property="id" column="id"/>
<collection property="addItems" javaType="List" ofType="com.qiwuai.garden.pojo.AddItemPojo">
<result property="id" column="id"/>
<result property="itemId" column="item_id"/>
<result property="itemTypeId" column="item_type_id"/>
<result property="addItemMin" column="add_item_min"/>
<result property="addItemMax" column="add_item_max"/>
<result property="addItemProb" column="add_item_prob"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</collection>
</resultMap>
<select id="searchAll" resultType="com.qiwuai.garden.pojo.AddItemPojo">
select
id, item_type_id, item_id, add_item_min, add_item_max, add_item_prob, create_time, update_time
from
add_item
</select>
<select id="searchItems" resultMap="AddItemResult">
select
AI.id,
AI.item_id, AI.item_type_id, AI.add_item_min, AI.add_item_max, AI.add_item_prob, AI.create_time, AI.update_time
from
add_item AI
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.AddItemSetMapper">
<resultMap id="AddItemSetResult" type="com.qiwuai.garden.dto.AddItemSetDto">
<id property="id" column="id"/>
<collection property="addItemIds" javaType="List" ofType="integer">
<result column="add_item_id"/>
</collection>
</resultMap>
<select id="searchAll" resultType="com.qiwuai.garden.pojo.AddItemSetPojo">
select
id, add_item_id, description, create_time, update_time
from
add_item_set
</select>
<select id="searchIds" resultMap="AddItemSetResult">
select
id,
add_item_id
from
add_item_set
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.AttributeMapper">
<select id="searchAll" resultType="com.qiwuai.garden.pojo.AttributePojo">
select
id, attribute, restrain_ids, create_time, update_time
from
attribute
</select>
<insert id="add">
insert into attribute
(attribute, restrainIds, create_time, update_time)
values
(#{attribute}, #{restrainIds}, #{createTime}, #{updateTime})
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.GardenerLevelMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.GardenerLevelPojo">
select
id, task_ids, gardener_skill_ids, cost_item_nums,
nursery_num_max, pet_num_max, steal_times_max, price_add_prob,
create_time, update_time
from
gardener_level
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.GardenerMapper">
<select id="create" resultType="com.qiwuai.garden.dto.GardenerInfoDto">
insert into gardener (name, gender)
values (#{name}, #{gender})
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.GardenerSkillMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.GardenerSkillPojo">
select
id, name, description, skill_type_id, type_a, type_b, type_c, create_time, update_time
from
gardener_skill
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.GoodsMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.GoodsPojo">
select
id, name, description, item_id, price, discount, discount_limit_time, level, create_time, update_time
from
goods
</select>
</mapper>
\ No newline at end of file
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