Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
secret-garden-game
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周君强
secret-garden-game
Commits
882e0bb4
Commit
882e0bb4
authored
Sep 16, 2022
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.建议系统初步实现
parent
dfc71f7c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
630 additions
and
46 deletions
+630
-46
Constants.java
src/main/java/com/qiwuai/garden/common/Constants.java
+2
-0
InitSysServlet.java
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
+10
-0
TimingAcquisition.java
...main/java/com/qiwuai/garden/common/TimingAcquisition.java
+23
-10
AdviseUtil.java
src/main/java/com/qiwuai/garden/common/utils/AdviseUtil.java
+0
-0
DateUtil.java
src/main/java/com/qiwuai/garden/common/utils/DateUtil.java
+18
-1
RequestConversionUtil.java
...com/qiwuai/garden/common/utils/RequestConversionUtil.java
+7
-2
TypeConvertUtil.java
.../java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
+3
-1
YamlUtil.java
src/main/java/com/qiwuai/garden/common/utils/YamlUtil.java
+17
-0
CommonController.java
...n/java/com/qiwuai/garden/controller/CommonController.java
+20
-0
CallNameMapper.java
src/main/java/com/qiwuai/garden/dao/CallNameMapper.java
+3
-0
BackPackDto.java
src/main/java/com/qiwuai/garden/dto/BackPackDto.java
+3
-1
ItemBagDto.java
src/main/java/com/qiwuai/garden/dto/ItemBagDto.java
+6
-4
CallRequest.java
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
+4
-0
OperationRequest.java
.../java/com/qiwuai/garden/dto/request/OperationRequest.java
+4
-0
CallNameGuidePojo.java
src/main/java/com/qiwuai/garden/pojo/CallNameGuidePojo.java
+23
-0
CallNamePojo.java
src/main/java/com/qiwuai/garden/pojo/CallNamePojo.java
+4
-0
AdviseService.java
...om/qiwuai/garden/service/adviseService/AdviseService.java
+19
-0
AdviseServiceImpl.java
.../garden/service/adviseService/impl/AdviseServiceImpl.java
+206
-0
GardenerService.java
...iwuai/garden/service/gardenerService/GardenerService.java
+6
-0
GardenerServiceImpl.java
...den/service/gardenerService/impl/GardenerServiceImpl.java
+39
-19
NurseryService.java
.../qiwuai/garden/service/nurseryService/NurseryService.java
+6
-0
NurseryServiceImpl.java
...arden/service/nurseryService/impl/NurseryServiceImpl.java
+22
-0
PetService.java
...java/com/qiwuai/garden/service/petService/PetService.java
+6
-0
PetServiceImpl.java
...qiwuai/garden/service/petService/impl/PetServiceImpl.java
+22
-0
PlantService.java
.../com/qiwuai/garden/service/plantService/PlantService.java
+6
-0
PlantServiceImpl.java
...ai/garden/service/plantService/impl/PlantServiceImpl.java
+109
-6
SocialServiceImpl.java
.../garden/service/socialService/impl/SocialServiceImpl.java
+1
-1
CallNameMapper.xml
src/main/resources/com/qiwuai/garden/dao/CallNameMapper.xml
+12
-1
advise.yaml
src/main/resources/speech/advise.yaml
+29
-0
No files found.
src/main/java/com/qiwuai/garden/common/Constants.java
View file @
882e0bb4
...
@@ -224,6 +224,8 @@ public class Constants {
...
@@ -224,6 +224,8 @@ public class Constants {
/**
/**
* ----------------------------事件ID----------------------
* ----------------------------事件ID----------------------
*/
/**
* 播种
* 播种
*/
*/
public
static
final
int
SEEDING_EVENT
=
1
;
public
static
final
int
SEEDING_EVENT
=
1
;
...
...
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
View file @
882e0bb4
...
@@ -446,6 +446,16 @@ public class InitSysServlet implements InitializingBean {
...
@@ -446,6 +446,16 @@ public class InitSysServlet implements InitializingBean {
log
.
info
(
"缓存中玩家称呼对应信息"
+
TimingAcquisition
.
callNameMap
);
log
.
info
(
"缓存中玩家称呼对应信息"
+
TimingAcquisition
.
callNameMap
);
log
.
info
(
"玩家称呼对应信息缓存完成"
);
log
.
info
(
"玩家称呼对应信息缓存完成"
);
//----------------------缓存新手引导玩家称呼对应信息--------------------------
Map
<
Integer
,
CallNameGuidePojo
>
callNameGuideMap
=
new
ConcurrentHashMap
<>();
List
<
CallNameGuidePojo
>
callNameGuideList
=
callNameMapper
.
findGuideAll
();
for
(
CallNameGuidePojo
callNameGuide
:
callNameGuideList
)
{
callNameGuideMap
.
put
(
callNameGuide
.
getId
(),
callNameGuide
);
}
TimingAcquisition
.
callNameGuideMap
.
putAll
(
callNameGuideMap
);
log
.
info
(
"缓存中新手引导玩家称呼对应信息"
+
TimingAcquisition
.
callNameGuideMap
);
log
.
info
(
"新手引导玩家称呼对应信息缓存完成"
);
//----------------------缓存玩家地址对应的地区信息----------------------------
//----------------------缓存玩家地址对应的地区信息----------------------------
Map
<
String
,
Map
<
String
,
RegionDto
>>
addressMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
Map
<
String
,
RegionDto
>>
addressMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
RegionPojo
>
regionPojoMap
=
TimingAcquisition
.
regionIPMap
;
Map
<
String
,
RegionPojo
>
regionPojoMap
=
TimingAcquisition
.
regionIPMap
;
...
...
src/main/java/com/qiwuai/garden/common/TimingAcquisition.java
View file @
882e0bb4
...
@@ -166,6 +166,10 @@ public class TimingAcquisition {
...
@@ -166,6 +166,10 @@ public class TimingAcquisition {
* 玩家称呼配置信息
* 玩家称呼配置信息
*/
*/
public
volatile
static
Map
<
Integer
,
CallNamePojo
>
callNameMap
=
new
ConcurrentHashMap
<>();
public
volatile
static
Map
<
Integer
,
CallNamePojo
>
callNameMap
=
new
ConcurrentHashMap
<>();
/**
* 新手引导玩家称呼配置信息
*/
public
volatile
static
Map
<
Integer
,
CallNameGuidePojo
>
callNameGuideMap
=
new
ConcurrentHashMap
<>();
/**
/**
...
@@ -193,9 +197,13 @@ public class TimingAcquisition {
...
@@ -193,9 +197,13 @@ public class TimingAcquisition {
*/
*/
public
volatile
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
taskSpeechMap
=
new
ConcurrentHashMap
<>();
public
volatile
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
taskSpeechMap
=
new
ConcurrentHashMap
<>();
/**
/**
*
任务
模块话术
*
帮助
模块话术
*/
*/
public
volatile
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
helpSpeechMap
=
new
ConcurrentHashMap
<>();
public
volatile
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
helpSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 建议模块话术
*/
public
volatile
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
adviseSpeechMap
=
new
ConcurrentHashMap
<>();
/**
/**
...
@@ -231,6 +239,7 @@ public class TimingAcquisition {
...
@@ -231,6 +239,7 @@ public class TimingAcquisition {
* 通过yaml文件加载所有话术到缓存中
* 通过yaml文件加载所有话术到缓存中
*/
*/
public
static
void
speechLoading
()
{
public
static
void
speechLoading
()
{
log
.
info
(
"---------开始加载话术到缓存中---------"
);
Map
<
String
,
Map
<
String
,
List
<
String
>>>
plantSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
plantSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
gardenerSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
gardenerSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
petSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
petSpeech
=
new
HashMap
<>();
...
@@ -238,6 +247,7 @@ public class TimingAcquisition {
...
@@ -238,6 +247,7 @@ public class TimingAcquisition {
Map
<
String
,
Map
<
String
,
List
<
String
>>>
socialSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
socialSpeech
=
new
HashMap
<>();
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
<>();
try
{
try
{
plantSpeech
=
YamlUtil
.
plantSpeechToMap
();
plantSpeech
=
YamlUtil
.
plantSpeechToMap
();
gardenerSpeech
=
YamlUtil
.
gardenerSpeechToMap
();
gardenerSpeech
=
YamlUtil
.
gardenerSpeechToMap
();
...
@@ -246,6 +256,7 @@ public class TimingAcquisition {
...
@@ -246,6 +256,7 @@ public class TimingAcquisition {
socialSpeech
=
YamlUtil
.
socialSpeechToMap
();
socialSpeech
=
YamlUtil
.
socialSpeechToMap
();
taskSpeech
=
YamlUtil
.
taskSpeechToMap
();
taskSpeech
=
YamlUtil
.
taskSpeechToMap
();
helpSpeech
=
YamlUtil
.
helpSpeechToMap
();
helpSpeech
=
YamlUtil
.
helpSpeechToMap
();
adviseSpeech
=
YamlUtil
.
adviseSpeechToMap
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -264,13 +275,15 @@ public class TimingAcquisition {
...
@@ -264,13 +275,15 @@ public class TimingAcquisition {
socialSpeechMap
.
putAll
(
socialSpeech
);
socialSpeechMap
.
putAll
(
socialSpeech
);
taskSpeechMap
.
putAll
(
taskSpeech
);
taskSpeechMap
.
putAll
(
taskSpeech
);
helpSpeechMap
.
putAll
(
helpSpeech
);
helpSpeechMap
.
putAll
(
helpSpeech
);
log
.
info
(
"缓存中玩家的种植话术:"
+
plantSpeechMap
);
adviseSpeechMap
.
putAll
(
adviseSpeech
);
log
.
info
(
"缓存中玩家的园丁话术:"
+
gardenerSpeechMap
);
// log.info("缓存中玩家的种植话术:" + plantSpeechMap);
log
.
info
(
"缓存中玩家的宠物话术:"
+
petSpeechMap
);
// log.info("缓存中玩家的园丁话术:" + gardenerSpeechMap);
log
.
info
(
"缓存中玩家的市场话术:"
+
marketSpeechMap
);
// log.info("缓存中玩家的宠物话术:" + petSpeechMap);
log
.
info
(
"缓存中玩家的社交话术:"
+
socialSpeechMap
);
// log.info("缓存中玩家的市场话术:" + marketSpeechMap);
log
.
info
(
"缓存中玩家的任务话术:"
+
taskSpeechMap
);
// log.info("缓存中玩家的社交话术:" + socialSpeechMap);
log
.
info
(
"缓存中玩家的帮助话术:"
+
helpSpeechMap
);
// log.info("缓存中玩家的任务话术:" + taskSpeechMap);
// log.info("缓存中玩家的帮助话术:" + helpSpeechMap);
log
.
info
(
"---------加载话术到缓存的操作完成---------"
);
}
}
/**
/**
...
@@ -1502,7 +1515,7 @@ public class TimingAcquisition {
...
@@ -1502,7 +1515,7 @@ public class TimingAcquisition {
nextNodes
.
add
(
nextId
);
nextNodes
.
add
(
nextId
);
}
}
nextId
=
nurseryId
;
nextId
=
nurseryId
;
//
花圃配置信息
//
前置花圃id
nurseryId
=
nurseryConfigMap
.
get
(
nurseryId
).
getPreId
();
nurseryId
=
nurseryConfigMap
.
get
(
nurseryId
).
getPreId
();
}
while
(
nurseryId
!=
0
);
}
while
(
nurseryId
!=
0
);
nurseryTypeNodeList
.
addAll
(
nurseryTypeNodes
);
nurseryTypeNodeList
.
addAll
(
nurseryTypeNodes
);
...
@@ -1762,7 +1775,7 @@ public class TimingAcquisition {
...
@@ -1762,7 +1775,7 @@ public class TimingAcquisition {
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantId
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfo
.
getPlantTime
()))
{
//植物已成熟
//植物已成熟
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getMatureTime
())
>
0
)
{
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfo
.
getPlantTime
().
getMatureTime
())
>
=
0
)
{
return
true
;
return
true
;
}
}
}
}
...
...
src/main/java/com/qiwuai/garden/common/utils/AdviseUtil.java
0 → 100644
View file @
882e0bb4
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwuai/garden/common/utils/DateUtil.java
View file @
882e0bb4
...
@@ -37,7 +37,7 @@ public class DateUtil {
...
@@ -37,7 +37,7 @@ public class DateUtil {
return
format
;
return
format
;
}
}
/**
/**
*
当前
时间加上毫秒
* 时间加上毫秒
* @param time
* @param time
* @param sub
* @param sub
* @return String
* @return String
...
@@ -54,6 +54,23 @@ public class DateUtil {
...
@@ -54,6 +54,23 @@ public class DateUtil {
}
}
/**
/**
* 时间减去毫秒
* @param time
* @param sub
* @return String
*/
public
static
String
subTime
(
String
time
,
int
sub
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
//设置日期格式
Date
dt
=
sdf
.
parse
(
time
);
Calendar
newTime
=
Calendar
.
getInstance
();
newTime
.
setTime
(
dt
);
newTime
.
add
(
Calendar
.
SECOND
,
-
sub
);
Date
newDt
=
newTime
.
getTime
();
return
sdf
.
format
(
newDt
);
}
/**
* 计算时间差(time1 - time2),返回单位为秒
* 计算时间差(time1 - time2),返回单位为秒
* @param time1
* @param time1
* @param time2
* @param time2
...
...
src/main/java/com/qiwuai/garden/common/utils/RequestConversionUtil.java
View file @
882e0bb4
...
@@ -23,8 +23,8 @@ public class RequestConversionUtil {
...
@@ -23,8 +23,8 @@ public class RequestConversionUtil {
Logger
log
=
LoggerFactory
.
getLogger
(
RequestConversionUtil
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
RequestConversionUtil
.
class
);
/**
/**
* 将请求的中文转成系统数据
* 将请求的中文转成系统数据
* @param
* @param
commonRequest
* @
* @
return OperationRequest
*/
*/
public
static
OperationRequest
request2Operation
(
CommonRequest
commonRequest
)
{
public
static
OperationRequest
request2Operation
(
CommonRequest
commonRequest
)
{
OperationRequest
operationRequest
=
new
OperationRequest
();
OperationRequest
operationRequest
=
new
OperationRequest
();
...
@@ -472,6 +472,11 @@ public class RequestConversionUtil {
...
@@ -472,6 +472,11 @@ public class RequestConversionUtil {
if
(!
StringUtils
.
isEmpty
(
noviceGuide
))
{
if
(!
StringUtils
.
isEmpty
(
noviceGuide
))
{
operationRequest
.
setNoviceGuide
(
noviceGuide
);
operationRequest
.
setNoviceGuide
(
noviceGuide
);
}
}
//--------存在时长-----------
String
time
=
callRequest
.
get
时长
();
if
(!
StringUtils
.
isEmpty
(
time
))
{
operationRequest
.
setTime
(
Integer
.
valueOf
(
time
));
}
return
operationRequest
;
return
operationRequest
;
}
}
}
}
src/main/java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
common
.
utils
;
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.dto.DropItemNumDto
;
import
com.qiwuai.garden.dto.DropItemNumDto
;
import
com.qiwuai.garden.dto.ItemDto
;
import
com.qiwuai.garden.dto.ItemDto
;
import
com.qiwuai.garden.dto.PlantDto
;
import
com.qiwuai.garden.dto.PlantDto
;
import
com.qiwuai.garden.dto.base.PageDto
;
import
com.qiwuai.garden.dto.base.PageDto
;
import
com.qiwuai.garden.pojo.ItemPojo
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -438,7 +440,7 @@ public class TypeConvertUtil {
...
@@ -438,7 +440,7 @@ public class TypeConvertUtil {
}
}
/**
/**
*
合并两个list数组,元素为对象
*
分页查找
* @param page
* @param page
* @param size
* @param size
* @return PageDto
* @return PageDto
...
...
src/main/java/com/qiwuai/garden/common/utils/YamlUtil.java
View file @
882e0bb4
...
@@ -140,6 +140,23 @@ public class YamlUtil {
...
@@ -140,6 +140,23 @@ public class YamlUtil {
}
}
/**
/**
* 将建议话术转成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中的某个值,只支持取第一层的值
* @param
* @param
* @return Map<String, Map<String, List<String>>>
* @return Map<String, Map<String, List<String>>>
...
...
src/main/java/com/qiwuai/garden/controller/CommonController.java
View file @
882e0bb4
...
@@ -10,6 +10,8 @@ import com.qiwuai.garden.dto.base.CommonResponse;
...
@@ -10,6 +10,8 @@ import com.qiwuai.garden.dto.base.CommonResponse;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.service.adviseService.AdviseService
;
import
com.qiwuai.garden.service.adviseService.impl.AdviseServiceImpl
;
import
com.qiwuai.garden.service.backPackService.BackPackService
;
import
com.qiwuai.garden.service.backPackService.BackPackService
;
import
com.qiwuai.garden.service.backPackService.impl.BackPackServiceImpl
;
import
com.qiwuai.garden.service.backPackService.impl.BackPackServiceImpl
;
import
com.qiwuai.garden.service.gardenerService.GardenerService
;
import
com.qiwuai.garden.service.gardenerService.GardenerService
;
...
@@ -72,6 +74,9 @@ public class CommonController {
...
@@ -72,6 +74,9 @@ public class CommonController {
//帮助模块动态代理
//帮助模块动态代理
HelpService
helpService
=
new
HelpServiceImpl
();
HelpService
helpService
=
new
HelpServiceImpl
();
HelpService
helpServiceProxy
=
(
HelpService
)
new
ProxyFactory
(
helpService
).
getProxyInstance
();
HelpService
helpServiceProxy
=
(
HelpService
)
new
ProxyFactory
(
helpService
).
getProxyInstance
();
//建议模块动态代理
AdviseService
adviseService
=
new
AdviseServiceImpl
();
AdviseService
adviseServiceProxy
=
(
AdviseService
)
new
ProxyFactory
(
adviseService
).
getProxyInstance
();
@PostMapping
(
value
=
"/call"
,
produces
=
"application/json;charset=UTF-8"
)
@PostMapping
(
value
=
"/call"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
startGame
(
@RequestBody
CommonRequest
commonRequest
)
throws
ParseException
{
public
CommonResponse
startGame
(
@RequestBody
CommonRequest
commonRequest
)
throws
ParseException
{
...
@@ -158,6 +163,9 @@ public class CommonController {
...
@@ -158,6 +163,9 @@ public class CommonController {
case
"查询植物成熟时间指令"
:
case
"查询植物成熟时间指令"
:
result
=
plantServiceProxy
.
checkPlantMatureTime
(
operationReq
);
result
=
plantServiceProxy
.
checkPlantMatureTime
(
operationReq
);
break
;
break
;
case
"加快植物成熟指令"
:
result
=
plantServiceProxy
.
speedPlantMatureTime
(
operationReq
);
break
;
case
"查看花圃数量指令"
:
case
"查看花圃数量指令"
:
result
=
nurseryServiceProxy
.
checkNurseryAmount
(
operationReq
);
result
=
nurseryServiceProxy
.
checkNurseryAmount
(
operationReq
);
break
;
break
;
...
@@ -200,6 +208,9 @@ public class CommonController {
...
@@ -200,6 +208,9 @@ public class CommonController {
case
"取消开启新花圃"
:
case
"取消开启新花圃"
:
result
=
nurseryServiceProxy
.
nurseryReclaimCancel
(
operationReq
);
result
=
nurseryServiceProxy
.
nurseryReclaimCancel
(
operationReq
);
break
;
break
;
case
"花圃直接升级指令"
:
result
=
nurseryServiceProxy
.
nurseryUpgradeDirect
(
operationReq
);
break
;
case
"查看园丁等级"
:
case
"查看园丁等级"
:
result
=
gardenerServiceProxy
.
gardenerLevelCheck
(
operationReq
);
result
=
gardenerServiceProxy
.
gardenerLevelCheck
(
operationReq
);
break
;
break
;
...
@@ -212,6 +223,9 @@ public class CommonController {
...
@@ -212,6 +223,9 @@ public class CommonController {
case
"取消园丁升级"
:
case
"取消园丁升级"
:
result
=
gardenerServiceProxy
.
gardenerUpgradeCancel
(
operationReq
);
result
=
gardenerServiceProxy
.
gardenerUpgradeCancel
(
operationReq
);
break
;
break
;
case
"园丁直接升级指令"
:
result
=
gardenerServiceProxy
.
gardenerUpgradeDirect
(
operationReq
);
break
;
case
"使用技能"
:
case
"使用技能"
:
result
=
gardenerServiceProxy
.
learnSkillCheck
(
operationReq
);
result
=
gardenerServiceProxy
.
learnSkillCheck
(
operationReq
);
break
;
break
;
...
@@ -314,6 +328,9 @@ public class CommonController {
...
@@ -314,6 +328,9 @@ public class CommonController {
case
"花圃宠物调换指令"
:
case
"花圃宠物调换指令"
:
result
=
petServiceProxy
.
nurseryPetSwitch
(
operationReq
);
result
=
petServiceProxy
.
nurseryPetSwitch
(
operationReq
);
break
;
break
;
case
"发放花圃宠物指令"
:
result
=
petServiceProxy
.
addNurseryPet
(
operationReq
);
break
;
case
"购买指令"
:
case
"购买指令"
:
result
=
marketServiceProxy
.
buyCheck
(
operationReq
);
result
=
marketServiceProxy
.
buyCheck
(
operationReq
);
break
;
break
;
...
@@ -696,6 +713,9 @@ public class CommonController {
...
@@ -696,6 +713,9 @@ public class CommonController {
case
"查询货币说明"
:
case
"查询货币说明"
:
result
=
helpServiceProxy
.
moneyExplainCheck
(
operationReq
);
result
=
helpServiceProxy
.
moneyExplainCheck
(
operationReq
);
break
;
break
;
case
"建议指令"
:
result
=
adviseServiceProxy
.
adviseWithout
(
operationReq
);
break
;
}
}
log
.
info
(
operationReq
.
getUid
()
+
"已完成操作:【"
+
commonRequest
.
getVars
().
get
操作名
()
+
"】"
);
log
.
info
(
operationReq
.
getUid
()
+
"已完成操作:【"
+
commonRequest
.
getVars
().
get
操作名
()
+
"】"
);
return
result
;
return
result
;
...
...
src/main/java/com/qiwuai/garden/dao/CallNameMapper.java
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
dao
;
package
com
.
qiwuai
.
garden
.
dao
;
import
com.qiwuai.garden.pojo.CallNameGuidePojo
;
import
com.qiwuai.garden.pojo.CallNamePojo
;
import
com.qiwuai.garden.pojo.CallNamePojo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -10,4 +11,6 @@ import java.util.List;
...
@@ -10,4 +11,6 @@ import java.util.List;
@Repository
@Repository
public
interface
CallNameMapper
{
public
interface
CallNameMapper
{
List
<
CallNamePojo
>
findAll
();
List
<
CallNamePojo
>
findAll
();
List
<
CallNameGuidePojo
>
findGuideAll
();
}
}
src/main/java/com/qiwuai/garden/dto/BackPackDto.java
View file @
882e0bb4
...
@@ -55,7 +55,9 @@ public class BackPackDto {
...
@@ -55,7 +55,9 @@ public class BackPackDto {
* 修改时间
* 修改时间
* */
* */
private
String
updateTime
;
private
String
updateTime
;
/**
* Map<物品类型id, 袋子>
* */
Map
<
Integer
,
ItemBagDto
>
itemBags
=
new
ConcurrentHashMap
<>();
Map
<
Integer
,
ItemBagDto
>
itemBags
=
new
ConcurrentHashMap
<>();
public
void
add
(
Integer
id
,
ItemBagDto
itemBag
)
{
public
void
add
(
Integer
id
,
ItemBagDto
itemBag
)
{
itemBags
.
put
(
id
,
itemBag
);
//id对应背包中装不同物品类型id的袋子编号
itemBags
.
put
(
id
,
itemBag
);
//id对应背包中装不同物品类型id的袋子编号
...
...
src/main/java/com/qiwuai/garden/dto/ItemBagDto.java
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
dto
;
package
com
.
qiwuai
.
garden
.
dto
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -37,11 +38,12 @@ public class ItemBagDto {
...
@@ -37,11 +38,12 @@ public class ItemBagDto {
//增加物品id和物品信息
//增加物品id和物品信息
public
void
add
(
Integer
id
,
ItemDto
item
)
{
public
void
add
(
Integer
id
,
ItemDto
item
)
{
if
(
itemBag
.
size
()
<
10
)
{
itemBag
.
put
(
id
,
item
);
itemBag
.
put
(
id
,
item
);
}
else
{
// if (itemBag.size() < 10) {
System
.
out
.
println
(
id
+
"袋已满"
);
//后续改为通知玩家背包已满,可以进行卖出其他物品等操作
// itemBag.put(id, item);
}
// } else {
// System.out.println(id + "袋已满"); //后续改为通知玩家背包已满,可以进行卖出其他物品等操作
// }
}
}
public
ItemDto
get
(
int
i
)
{
public
ItemDto
get
(
int
i
)
{
...
...
src/main/java/com/qiwuai/garden/dto/request/CallRequest.java
View file @
882e0bb4
...
@@ -169,4 +169,8 @@ public class CallRequest {
...
@@ -169,4 +169,8 @@ public class CallRequest {
*/
*/
@JsonProperty
(
value
=
"GB_新手引导步骤"
)
@JsonProperty
(
value
=
"GB_新手引导步骤"
)
private
String
GB_
新手引导步骤
;
private
String
GB_
新手引导步骤
;
/**
* 时长
*/
private
String
时长
;
}
}
src/main/java/com/qiwuai/garden/dto/request/OperationRequest.java
View file @
882e0bb4
...
@@ -183,6 +183,10 @@ public class OperationRequest {
...
@@ -183,6 +183,10 @@ public class OperationRequest {
*/
*/
private
String
noviceGuide
;
private
String
noviceGuide
;
/**
/**
* 时长
*/
private
Integer
time
;
/**
* 本轮操作标识
* 本轮操作标识
*/
*/
private
Integer
operationLabel
;
private
Integer
operationLabel
;
...
...
src/main/java/com/qiwuai/garden/pojo/CallNameGuidePojo.java
0 → 100644
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
pojo
;
import
lombok.Data
;
@Data
public
class
CallNameGuidePojo
{
/**
* id
*/
private
Integer
id
;
/**
* 称呼id
*/
private
Integer
callNameId
;
/**
* 性别
*/
private
Integer
gender
;
/**
* 称呼是否可用:0-不可用,1-可用
*/
private
Integer
usable
;
}
src/main/java/com/qiwuai/garden/pojo/CallNamePojo.java
View file @
882e0bb4
...
@@ -20,4 +20,8 @@ public class CallNamePojo {
...
@@ -20,4 +20,8 @@ public class CallNamePojo {
* 性别
* 性别
*/
*/
private
Integer
gender
;
private
Integer
gender
;
/**
* 称呼是否可用:0-不可用,1-可用
*/
private
Integer
usable
;
}
}
src/main/java/com/qiwuai/garden/service/adviseService/AdviseService.java
0 → 100644
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
service
.
adviseService
;
import
com.qiwuai.garden.dto.base.CommonResponse
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
public
interface
AdviseService
{
/**
* 建议指令。没有指定任何植物或宠物名称的情况
* @param operationReq
* @return CommonResponse
*/
CommonResponse
adviseWithout
(
OperationRequest
operationReq
);
/**
* 种植植物判定。
* @param operationReq
* @return CommonResponse
*/
CommonResponse
adviseByPlant
(
OperationRequest
operationReq
);
}
src/main/java/com/qiwuai/garden/service/adviseService/impl/AdviseServiceImpl.java
0 → 100644
View file @
882e0bb4
package
com
.
qiwuai
.
garden
.
service
.
adviseService
.
impl
;
import
com.qiwuai.garden.common.Constants
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
com.qiwuai.garden.common.utils.AdviseUtil
;
import
com.qiwuai.garden.common.utils.SpeechUtil
;
import
com.qiwuai.garden.common.utils.TypeConvertUtil
;
import
com.qiwuai.garden.dto.BackPackDto
;
import
com.qiwuai.garden.dto.ItemBagDto
;
import
com.qiwuai.garden.dto.ItemDto
;
import
com.qiwuai.garden.dto.NurseryInfoDto
;
import
com.qiwuai.garden.dto.base.CommonResponse
;
import
com.qiwuai.garden.dto.base.ResultResponse
;
import
com.qiwuai.garden.dto.base.ResultVarsResponse
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.pojo.*
;
import
com.qiwuai.garden.service.adviseService.AdviseService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
AdviseServiceImpl
implements
AdviseService
{
Logger
log
=
LoggerFactory
.
getLogger
(
AdviseServiceImpl
.
class
);
@Override
public
CommonResponse
adviseWithout
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
log
.
info
(
uid
+
"根据当前状态查看建议"
);
//园丁等级上限
Integer
gardenerLevelMax
=
Integer
.
valueOf
(
TimingAcquisition
.
systemConfigMap
.
get
(
"gardener_level_max"
).
getValue
());
Integer
gardenerLevel
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
().
getLevel
();
//园丁等级满级
if
(
gardenerLevel
>=
gardenerLevelMax
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"current_status_advise_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
900101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//园丁下个等级配置信息
GardenerLevelPojo
gardenerLevelConfig
=
TimingAcquisition
.
gardenerLevelMap
.
get
(
gardenerLevel
+
1
);
//事件配置信息
Map
<
Integer
,
EventPojo
>
eventConfigMap
=
TimingAcquisition
.
eventConfigMap
;
//升级所需物品
List
<
ItemDto
>
itemList
=
TypeConvertUtil
.
itemString2List
(
gardenerLevelConfig
.
getCostItemNums
());
//物品配置信息
Map
<
Integer
,
ItemPojo
>
itemConfigMap
=
TimingAcquisition
.
itemConfigMap
;
//升级需完成的任务id
String
[]
taskIdList
=
gardenerLevelConfig
.
getTaskIds
().
split
(
"\\|"
);
//玩家已完成的任务清单详情
Map
<
Integer
,
Integer
>
taskCountMap
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getTaskCountMap
();
//--------------------------遍历升级需完成的任务id-----------------------
for
(
String
id
:
taskIdList
)
{
Integer
taskId
=
Integer
.
valueOf
(
id
);
//园丁升级所需完成任务配置信息
TaskPojo
task
=
TimingAcquisition
.
taskMap
.
get
(
taskId
);
String
eventName
=
TimingAcquisition
.
eventConfigMap
.
get
(
task
.
getEventId
()).
getName
();
//任务对应事件名称
Integer
eventCont
=
taskCountMap
.
get
(
task
.
getEventId
());
//玩家已完成的任务对应事件次数
//1.种植事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
SEEDING_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
//进入种植植物判定
}
}
//2.收获事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
HARVEST_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
}
}
//3.开启花圃事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
RECLAIM_NURSERY_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
}
}
//4.获得宠物事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
GET_PET_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
//进入种植植物判定
}
}
//5.偷菜成功事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
STEAL_SUCCESS_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
}
}
//6.帮助好友事件对应的任务
if
(
task
.
getEventId
()
==
Constants
.
HELP_EVENT
)
{
if
(
eventCont
<
task
.
getTimes
())
{
}
}
}
//获取当前玩家的背包
BackPackDto
backPack
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getBackPack
();
//货币配置信息
Integer
moneyId
=
Integer
.
parseInt
(
TimingAcquisition
.
systemConfigMap
.
get
(
"money"
).
getValue
());
//货币对应种类
Integer
moneyType
=
itemConfigMap
.
get
(
moneyId
).
getItemTypeId
();
//-------------------------升级物品需求判定-----------------------
for
(
ItemDto
item
:
itemList
)
{
//所需材料的物品类型
Integer
itemTypeId
=
itemConfigMap
.
get
(
item
.
getItemId
()).
getItemTypeId
();
//获取对应类型的袋子
ItemBagDto
itemBag
=
backPack
.
getItemBags
().
get
(
itemTypeId
);
//------------物品需求判定----------
if
(!
itemTypeId
.
equals
(
moneyType
))
{
//根据物品ID获取对应的植物信息
//根据物品ID获取对应的宠物信息
//袋子没有此类物品
if
(
StringUtils
.
isEmpty
(
itemBag
))
{
//进入种植植物判定
}
ItemDto
itemPacket
=
itemBag
.
getItems
(
item
.
getItemId
());
//没有该物品
if
(
StringUtils
.
isEmpty
(
itemPacket
))
{
//进入种植植物判定
}
//该物品数量不够
if
(
itemPacket
.
getItemNum
()
<
item
.
getItemNum
())
{
//进入种植植物判定
}
}
//------------灵石需求判定----------
if
(
itemTypeId
.
equals
(
moneyType
))
{
}
}
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"current_status_advise_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
900101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
@Override
public
CommonResponse
adviseByPlant
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
Integer
plantId
=
operationReq
.
getPlantId
();
log
.
info
(
uid
+
"根据指定植物"
+
plantId
+
"来提供建议"
);
//通过植物id找到能种植的空闲花圃
List
<
Integer
>
nurseryNumList
=
AdviseUtil
.
findFreeNurseryNumsByPlantId
(
uid
,
plantId
);
//没有可种植该植物的空闲花圃
if
(
nurseryNumList
.
size
()
==
0
)
{
//--------走其他植物的种植流程---------
//找到花圃等级升序的空闲花圃
List
<
Integer
>
freeNurseryNumList
=
AdviseUtil
.
findFreeNurseryNum
(
uid
);
//存在空闲花圃
if
(
freeNurseryNumList
.
size
()
!=
0
)
{
//找到最高等级的花圃编号
Integer
nurseryNum
=
freeNurseryNumList
.
get
(
freeNurseryNumList
.
size
()
-
1
);
//根据花圃编号找到所有可以种植的植物id
List
<
Integer
>
plantIdList
=
AdviseUtil
.
findPlantIdByFreeNursery
(
uid
,
nurseryNum
);
//存在可以种植的植物
if
(
plantIdList
.
size
()
!=
0
)
{
//检查玩家是否有可种植的果实和材料
AdviseUtil
.
checkPlantItems
(
uid
,
nurseryNum
,
plantIdList
.
get
(
0
));
}
}
else
{
//不存在空闲花圃,查找是否有成熟植物的花圃,有则建议收取
List
<
Integer
>
matureNurseryNumList
=
AdviseUtil
.
findMatureNurseryNum
(
uid
);
//不存在有成熟植物的花圃
if
(
matureNurseryNumList
.
size
()
==
0
)
{
//建议开启花圃
}
else
{
//建议收取果实
}
}
}
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"current_status_advise_success"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
900101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
src/main/java/com/qiwuai/garden/service/gardenerService/GardenerService.java
View file @
882e0bb4
...
@@ -60,6 +60,12 @@ public interface GardenerService {
...
@@ -60,6 +60,12 @@ public interface GardenerService {
*/
*/
CommonResponse
gardenerUpgradeCancel
(
OperationRequest
operationReq
);
CommonResponse
gardenerUpgradeCancel
(
OperationRequest
operationReq
);
/**
/**
* 园丁直接升级指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse
gardenerUpgradeDirect
(
OperationRequest
operationReq
);
/**
* 查看技能信息,查看当前等级可选择的所有技能信息,暂不使用
* 查看技能信息,查看当前等级可选择的所有技能信息,暂不使用
* @param operationReq
* @param operationReq
* @return CommonResponse
* @return CommonResponse
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/impl/GardenerServiceImpl.java
View file @
882e0bb4
...
@@ -443,8 +443,8 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -443,8 +443,8 @@ public class GardenerServiceImpl implements GardenerService {
String
callNameText
=
TimingAcquisition
.
getCallNameByGender
(
uid
);
String
callNameText
=
TimingAcquisition
.
getCallNameByGender
(
uid
);
//玩家提供了序号
//玩家提供了序号
if
(!
StringUtils
.
isEmpty
(
rank
))
{
if
(!
StringUtils
.
isEmpty
(
rank
))
{
List
<
Integer
>
callNameIdList
=
TimingAcquisition
.
callNameMap
.
values
().
stream
().
List
<
Integer
>
callNameIdList
=
TimingAcquisition
.
callName
Guide
Map
.
values
().
stream
().
filter
(
callNamePojo
->
gardenerInfo
.
getGender
().
equals
(
callNamePojo
.
getGender
())).
map
(
CallName
Pojo:
:
get
Id
).
collect
(
Collectors
.
toList
());
filter
(
callNamePojo
->
gardenerInfo
.
getGender
().
equals
(
callNamePojo
.
getGender
())).
map
(
CallName
GuidePojo:
:
getCallName
Id
).
collect
(
Collectors
.
toList
());
//首个
//首个
if
(
rank
==
Constants
.
REQ_FIRST
)
{
if
(
rank
==
Constants
.
REQ_FIRST
)
{
callNameId
=
callNameIdList
.
get
(
0
);
callNameId
=
callNameIdList
.
get
(
0
);
...
@@ -516,7 +516,7 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -516,7 +516,7 @@ public class GardenerServiceImpl implements GardenerService {
assert
callNamePojo
!=
null
;
assert
callNamePojo
!=
null
;
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_call_name_change_success"
);
String
text
=
SpeechUtil
.
getGardenerSpeech
(
gender
,
"gardener_call_name_change_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callNamePojo
.
getName
(),
callName
.
getSubName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callNamePojo
.
getName
(),
callName
Pojo
.
getSubName
());
gardenerInfo
.
setCallNameId
(
callNameId
);
gardenerInfo
.
setCallNameId
(
callNameId
);
//---------------------------持久化该园丁信息----------------------------
//---------------------------持久化该园丁信息----------------------------
Map
<
String
,
GardenerDto
>
gardenerMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
GardenerDto
>
gardenerMap
=
new
ConcurrentHashMap
<>();
...
@@ -840,22 +840,22 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -840,22 +840,22 @@ public class GardenerServiceImpl implements GardenerService {
}
}
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
feedText
.
deleteCharAt
(
feedText
.
length
()
-
1
);
//---------------------新手引导的园丁升级至2任务开启,满足条件则开放园丁升级功能------------------------
//---------------------新手引导的园丁升级至2任务开启,满足条件则开放园丁升级功能------------------------
if
(
gardenerInfo
.
getLevel
()
==
1
)
{
//
if (gardenerInfo.getLevel() == 1) {
if
(!
StringUtils
.
isEmpty
(
noviceGuide
))
{
//
if (!StringUtils.isEmpty(noviceGuide)) {
if
(!
"完成10010"
.
equals
(
noviceGuide
))
{
//
if (!"完成10010".equals(noviceGuide)) {
log
.
info
(
uid
+
"新手引导的园丁升级任务10011还未开启"
);
//
log.info(uid + "新手引导的园丁升级任务10011还未开启");
//获取对应话术
//
//获取对应话术
String
text
=
SpeechUtil
.
getGardenerSpeech
(
Constants
.
SPEECH_ASIDE
,
"gardener_upgrade_fail_task_open"
);
//
String text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "gardener_upgrade_fail_task_open");
commonResponse
.
setCode
(
1
);
//
commonResponse.setCode(1);
commonResponse
.
setMsg
(
"成功"
);
//
commonResponse.setMsg("成功");
resultResponse
.
set
反馈
ID
(
200119
);
//
resultResponse.set反馈ID(200119);
resultResponse
.
set
反馈文本
(
text
);
//
resultResponse.set反馈文本(text);
resultVarsResponse
.
setVars
(
resultResponse
);
//
resultVarsResponse.setVars(resultResponse);
commonResponse
.
setData
(
resultVarsResponse
);
//
commonResponse.setData(resultVarsResponse);
return
commonResponse
;
//
return commonResponse;
}
//
}
}
//
}
}
//
}
//保存玩家这轮的请求信息,用于下一步的确认或取消操作
//保存玩家这轮的请求信息,用于下一步的确认或取消操作
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
//获取对应话术
...
@@ -1108,6 +1108,26 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -1108,6 +1108,26 @@ public class GardenerServiceImpl implements GardenerService {
}
}
@Override
@Override
public
CommonResponse
gardenerUpgradeDirect
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
log
.
info
(
uid
+
"直接升级园丁等级到2级"
);
GardenerInfoDto
gardenerInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGardenerInfo
();
gardenerInfo
.
setLevel
(
2
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
200120
);
resultResponse
.
set
反馈文本
(
"园丁直接升级到2级完成"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
@Override
public
CommonResponse
searchSkillInfo
(
OperationRequest
operationReq
)
{
public
CommonResponse
searchSkillInfo
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
...
...
src/main/java/com/qiwuai/garden/service/nurseryService/NurseryService.java
View file @
882e0bb4
...
@@ -99,4 +99,10 @@ public interface NurseryService {
...
@@ -99,4 +99,10 @@ public interface NurseryService {
* @return CommonResponse
* @return CommonResponse
*/
*/
CommonResponse
nurseryResetCancel
(
OperationRequest
operationReq
);
CommonResponse
nurseryResetCancel
(
OperationRequest
operationReq
);
/**
* 花圃直接升级指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse
nurseryUpgradeDirect
(
OperationRequest
operationReq
);
}
}
src/main/java/com/qiwuai/garden/service/nurseryService/impl/NurseryServiceImpl.java
View file @
882e0bb4
...
@@ -1623,4 +1623,26 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -1623,4 +1623,26 @@ public class NurseryServiceImpl implements NurseryService {
return
commonResponse
;
return
commonResponse
;
}
}
@Override
public
CommonResponse
nurseryUpgradeDirect
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
Integer
nurseryNum
=
operationReq
.
getNurseryNum
();
log
.
info
(
uid
+
"直接升级花圃到中级花圃"
);
//当前花圃信息
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
//花圃类型变更“中级苗圃”
nurseryInfo
.
setId
(
2
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
100708
);
resultResponse
.
set
反馈文本
(
"升级到中级苗圃完成"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
}
src/main/java/com/qiwuai/garden/service/petService/PetService.java
View file @
882e0bb4
...
@@ -100,4 +100,10 @@ public interface PetService {
...
@@ -100,4 +100,10 @@ public interface PetService {
* @return CommonResponse
* @return CommonResponse
*/
*/
CommonResponse
nurseryPetSwitch
(
OperationRequest
operationReq
);
CommonResponse
nurseryPetSwitch
(
OperationRequest
operationReq
);
/**
* 发放花圃宠物指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse
addNurseryPet
(
OperationRequest
operationReq
);
}
}
src/main/java/com/qiwuai/garden/service/petService/impl/PetServiceImpl.java
View file @
882e0bb4
...
@@ -2220,4 +2220,26 @@ public class PetServiceImpl implements PetService {
...
@@ -2220,4 +2220,26 @@ public class PetServiceImpl implements PetService {
return
commonResponse
;
return
commonResponse
;
}
}
@Override
public
CommonResponse
addNurseryPet
(
OperationRequest
operationReq
)
{
CommonResponse
commonResponse
=
new
CommonResponse
();
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
Integer
nurseryNum
=
operationReq
.
getNurseryNum
();
Integer
petId
=
operationReq
.
getPetId
();
NurseryInfoDto
nurseryInfo
=
TimingAcquisition
.
gardenerMap
.
get
(
uid
).
getGarden
().
getNurseryInfos
().
get
(
nurseryNum
);
nurseryInfo
.
setPetField
(
petId
);
nurseryInfo
.
setPetCheck
(
Constants
.
PET_UNCHECK
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
301004
);
resultResponse
.
set
反馈文本
(
uid
+
"的宠物"
+
petId
+
"发放到"
+
nurseryNum
+
"号苗圃完成"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
}
src/main/java/com/qiwuai/garden/service/plantService/PlantService.java
View file @
882e0bb4
...
@@ -94,4 +94,10 @@ public interface PlantService {
...
@@ -94,4 +94,10 @@ public interface PlantService {
* @return CommonResponse
* @return CommonResponse
*/
*/
CommonResponse
checkPlantMatureTime
(
OperationRequest
operationReq
)
throws
ParseException
;
CommonResponse
checkPlantMatureTime
(
OperationRequest
operationReq
)
throws
ParseException
;
/**
* 加快成熟时间指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse
speedPlantMatureTime
(
OperationRequest
operationReq
)
throws
ParseException
;
}
}
src/main/java/com/qiwuai/garden/service/plantService/impl/PlantServiceImpl.java
View file @
882e0bb4
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwuai/garden/service/socialService/impl/SocialServiceImpl.java
View file @
882e0bb4
...
@@ -2991,7 +2991,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -2991,7 +2991,7 @@ public class SocialServiceImpl implements SocialService {
if
(!
StringUtils
.
isEmpty
(
nurseryInfoDto
.
getPlantId
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfoDto
.
getPlantId
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfoDto
.
getPlantTime
()))
{
if
(!
StringUtils
.
isEmpty
(
nurseryInfoDto
.
getPlantTime
()))
{
//植物已成熟
//植物已成熟
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfoDto
.
getPlantTime
().
getMatureTime
())
>
0
)
{
if
(
DateUtil
.
getCurrentTime
().
compareTo
(
nurseryInfoDto
.
getPlantTime
().
getMatureTime
())
>
=
0
)
{
nurseryNumList
.
add
(
entry
.
getKey
());
nurseryNumList
.
add
(
entry
.
getKey
());
}
}
}
}
...
...
src/main/resources/com/qiwuai/garden/dao/CallNameMapper.xml
View file @
882e0bb4
...
@@ -6,8 +6,18 @@
...
@@ -6,8 +6,18 @@
<select
id=
"findAll"
resultType=
"com.qiwuai.garden.pojo.CallNamePojo"
>
<select
id=
"findAll"
resultType=
"com.qiwuai.garden.pojo.CallNamePojo"
>
select
select
id, name, sub_name, gender
id, name, sub_name, gender
, usable
from
from
call_name
call_name
where
usable = 1
</select>
<select
id=
"findGuideAll"
resultType=
"com.qiwuai.garden.pojo.CallNameGuidePojo"
>
select
id, call_name_id, gender, usable
from
call_name_guide
where
usable = 1
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/speech/advise.yaml
0 → 100644
View file @
882e0bb4
#存放路径已改为:/home/secretGarden/secretGardenSpeech/
aside
:
#-----------------------------当前状态建议-------------------------------
#9001:当前状态建议
current_status_advise_success
:
-
【旁白@正常】你当前的园丁等级为【1】,园丁养成任务已完成,并且拥有所有升级所需材料和灵石,建议你现在升级园丁,可以吗?
current_status_advise_harvest
:
-
【旁白@正常】你当前的园丁等级为【1】,园丁养成任务需要完成【2】,当前任务完成进度【3】,还需完成【4】次,建议你收取果实,可以吗?
current_status_advise_wait
:
-
【旁白@正常】你当前的园丁等级为【1】,园丁养成任务需要完成【2】,当前任务完成进度【3】,还需完成【4】次,当前所有花圃中的植物正在成长中,建议你等待植物成熟后完成收取果实的任务。
current_status_advise_open_nursery
:
-
【旁白@正常】你当前的园丁等级为【1】,园丁养成任务需要完成【2】,当前任务完成进度【3】次,还需完成【4】次,建议你现在开启一个新的花圃,可以吗?
current_status_advise_open_nursery_fail_money
:
-
【旁白@正常】你当前的园丁等级为【1】,园丁养成任务需要完成【2】,当前任务完成进度【3】次,还需完成【4】次,现在灵石数量不足,我们来种植一下【5】或者出售【6】吧?
man
:
#-----------------------------当前状态建议-------------------------------
#9001:当前状态建议
current_status_advise_success
:
-
【男园丁@正常】
woman
:
#-----------------------------当前状态建议-------------------------------
#9001:当前状态建议
current_status_advise_success
:
-
【女园丁@正常】
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment