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
9855819a
Commit
9855819a
authored
Dec 09, 2022
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.留言功能调整;
2.代码结构调整,弃用动态代理
parent
453f64c4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
668 additions
and
182 deletions
+668
-182
pom.xml
pom.xml
+2
-2
SecretGardenApplication.java
src/main/java/com/qiwuai/garden/SecretGardenApplication.java
+1
-3
InitSysServlet.java
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
+15
-1
ProxyFactory.java
src/main/java/com/qiwuai/garden/common/ProxyFactory.java
+4
-1
TimingAcquisition.java
...main/java/com/qiwuai/garden/common/TimingAcquisition.java
+23
-40
UserThread.java
src/main/java/com/qiwuai/garden/common/cache/UserThread.java
+0
-5
ScheduleTask.java
.../java/com/qiwuai/garden/common/schedule/ScheduleTask.java
+5
-1
DataTrimUtil.java
...ain/java/com/qiwuai/garden/common/utils/DataTrimUtil.java
+219
-0
HttpUtil.java
src/main/java/com/qiwuai/garden/common/utils/HttpUtil.java
+28
-5
PersistenceUtil.java
.../java/com/qiwuai/garden/common/utils/PersistenceUtil.java
+42
-18
RequestConversionUtil.java
...com/qiwuai/garden/common/utils/RequestConversionUtil.java
+0
-19
SpeechUtil.java
src/main/java/com/qiwuai/garden/common/utils/SpeechUtil.java
+1
-2
TypeConvertUtil.java
.../java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
+105
-5
YamlUtil.java
src/main/java/com/qiwuai/garden/common/utils/YamlUtil.java
+25
-17
CommonController.java
...n/java/com/qiwuai/garden/controller/CommonController.java
+0
-0
AdviseServiceImpl.java
.../garden/service/adviseService/impl/AdviseServiceImpl.java
+3
-1
BackPackServiceImpl.java
...den/service/backPackService/impl/BackPackServiceImpl.java
+1
-0
GardenerServiceImpl.java
...den/service/gardenerService/impl/GardenerServiceImpl.java
+8
-3
MarketServiceImpl.java
.../garden/service/marketService/impl/MarketServiceImpl.java
+41
-4
NurseryServiceImpl.java
...arden/service/nurseryService/impl/NurseryServiceImpl.java
+3
-1
PetServiceImpl.java
...qiwuai/garden/service/petService/impl/PetServiceImpl.java
+3
-1
PlantServiceImpl.java
...ai/garden/service/plantService/impl/PlantServiceImpl.java
+3
-1
RankingServiceImpl.java
...arden/service/rankingService/impl/RankingServiceImpl.java
+27
-1
SocialServiceImpl.java
.../garden/service/socialService/impl/SocialServiceImpl.java
+73
-23
TaskServiceImpl.java
...wuai/garden/service/taskService/impl/TaskServiceImpl.java
+3
-1
application-crazyPro.yml
src/main/resources/application-crazyPro.yml
+6
-6
application-crazyUat.yml
src/main/resources/application-crazyUat.yml
+1
-1
application-dev.yml
src/main/resources/application-dev.yml
+6
-6
application-pro.yml
src/main/resources/application-pro.yml
+6
-6
application-uat.yml
src/main/resources/application-uat.yml
+7
-7
log4j2.xml
src/main/resources/log4j2.xml
+1
-1
ranking.yaml
src/main/resources/speech/ranking.yaml
+4
-0
social.yaml
src/main/resources/speech/social.yaml
+2
-0
No files found.
pom.xml
View file @
9855819a
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.example
</groupId>
<groupId>
org.example
</groupId>
<artifactId>
SecretG
rade
Game
</artifactId>
<artifactId>
SecretG
arden
Game
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
secretG
rade
Game
</name>
<name>
secretG
arden
Game
</name>
<build>
<build>
<finalName>
secretGardenGame
</finalName>
<finalName>
secretGardenGame
</finalName>
<plugins>
<plugins>
...
...
src/main/java/com/qiwuai/garden/SecretGardenApplication.java
View file @
9855819a
...
@@ -6,6 +6,7 @@ import org.springframework.boot.SpringApplication;
...
@@ -6,6 +6,7 @@ import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@SpringBootApplication
@SpringBootApplication
...
@@ -14,9 +15,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -14,9 +15,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@EnableScheduling
public
class
SecretGardenApplication
{
public
class
SecretGardenApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
TimingAcquisition
timingAcquisition
=
new
TimingAcquisition
();
// timingAcquisition.loadingTest();
TimingAcquisition
.
loading
();
SpringApplication
.
run
(
SecretGardenApplication
.
class
,
args
);
SpringApplication
.
run
(
SecretGardenApplication
.
class
,
args
);
ExpireThread
expireThread
=
new
ExpireThread
();
ExpireThread
expireThread
=
new
ExpireThread
();
Thread
thread
=
new
Thread
(
expireThread
);
Thread
thread
=
new
Thread
(
expireThread
);
...
...
src/main/java/com/qiwuai/garden/common/InitSysServlet.java
View file @
9855819a
...
@@ -13,6 +13,7 @@ import org.slf4j.Logger;
...
@@ -13,6 +13,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -27,6 +28,13 @@ import java.util.stream.Collectors;
...
@@ -27,6 +28,13 @@ import java.util.stream.Collectors;
public
class
InitSysServlet
implements
InitializingBean
{
public
class
InitSysServlet
implements
InitializingBean
{
Logger
log
=
LoggerFactory
.
getLogger
(
InitSysServlet
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
InitSysServlet
.
class
);
@Value
(
"${userFilePath}"
)
private
String
userFilePath
;
@Value
(
"${configFilePath}"
)
private
String
configFilePath
;
@Value
(
"${speechFilePath}"
)
private
String
speechFilePath
;
private
NurseryMapper
nurseryMapper
;
private
NurseryMapper
nurseryMapper
;
private
PlantPeriodMapper
plantPeriodMapper
;
private
PlantPeriodMapper
plantPeriodMapper
;
private
PlantMapper
plantMapper
;
private
PlantMapper
plantMapper
;
...
@@ -178,6 +186,12 @@ public class InitSysServlet implements InitializingBean {
...
@@ -178,6 +186,12 @@ public class InitSysServlet implements InitializingBean {
*/
*/
@Override
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
public
void
afterPropertiesSet
()
throws
Exception
{
//--------------------------加载玩家数据----------------------
TimingAcquisition
.
loading
(
userFilePath
);
//--------------------加载话术-----------------
TimingAcquisition
.
speechLoading
(
speechFilePath
);
//--------------------------缓存花圃配置信息----------------------
//--------------------------缓存花圃配置信息----------------------
log
.
info
(
"开始缓存花圃配置信息到缓存"
);
log
.
info
(
"开始缓存花圃配置信息到缓存"
);
Map
<
Integer
,
NurseryPojo
>
nurseryPojoMap
=
new
ConcurrentHashMap
<>();
Map
<
Integer
,
NurseryPojo
>
nurseryPojoMap
=
new
ConcurrentHashMap
<>();
...
@@ -514,7 +528,7 @@ public class InitSysServlet implements InitializingBean {
...
@@ -514,7 +528,7 @@ public class InitSysServlet implements InitializingBean {
TimingAcquisition
.
friendshipRankingList
.
addAll
(
friendshipRankingList
);
TimingAcquisition
.
friendshipRankingList
.
addAll
(
friendshipRankingList
);
//获取所有地区
//获取所有地区
String
fileName
=
"region.json"
;
String
fileName
=
"region.json"
;
String
s
=
PersistenceUtil
.
getConfigFromFile
(
fileName
);
String
s
=
PersistenceUtil
.
getConfigFromFile
(
configFilePath
,
fileName
);
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
for
(
Map
.
Entry
<
String
,
List
<
RegionIPDto
>>
entry
:
IPRegionsMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
RegionIPDto
>>
entry
:
IPRegionsMap
.
entrySet
())
{
List
<
RegionIPDto
>
regionIPList
=
entry
.
getValue
();
List
<
RegionIPDto
>
regionIPList
=
entry
.
getValue
();
...
...
src/main/java/com/qiwuai/garden/common/ProxyFactory.java
View file @
9855819a
...
@@ -2,6 +2,7 @@ package com.qiwuai.garden.common;
...
@@ -2,6 +2,7 @@ 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.DateUtil
;
import
com.qiwuai.garden.common.utils.HttpUtil
;
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.FriendDto
;
import
com.qiwuai.garden.dto.FriendDto
;
...
@@ -12,6 +13,7 @@ import com.qiwuai.garden.dto.base.ResultVarsResponse;
...
@@ -12,6 +13,7 @@ import com.qiwuai.garden.dto.base.ResultVarsResponse;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.InvocationHandler
;
...
@@ -23,7 +25,8 @@ import java.util.Map;
...
@@ -23,7 +25,8 @@ import java.util.Map;
public
class
ProxyFactory
{
public
class
ProxyFactory
{
Logger
log
=
LoggerFactory
.
getLogger
(
ProxyFactory
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
ProxyFactory
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
offlineTime
=
YamlUtil
.
getValueByKey
(
"offlineTime"
);
@Value
(
"${offlineTime}"
)
private
String
offlineTime
;
private
Object
target
;
private
Object
target
;
public
ProxyFactory
(
Object
target
)
{
public
ProxyFactory
(
Object
target
)
{
...
...
src/main/java/com/qiwuai/garden/common/TimingAcquisition.java
View file @
9855819a
...
@@ -21,7 +21,6 @@ import org.springframework.util.StringUtils;
...
@@ -21,7 +21,6 @@ import org.springframework.util.StringUtils;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.io.File
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -83,7 +82,14 @@ public class TimingAcquisition {
...
@@ -83,7 +82,14 @@ public class TimingAcquisition {
* 地区友情榜
* 地区友情榜
*/
*/
public
volatile
static
Map
<
String
,
List
<
PlayerTimesDto
>>
regionFriendShipRankingListMap
=
new
ConcurrentHashMap
<>();
public
volatile
static
Map
<
String
,
List
<
PlayerTimesDto
>>
regionFriendShipRankingListMap
=
new
ConcurrentHashMap
<>();
/**
* 配置文件信息
*/
public
volatile
static
Map
<
String
,
String
>
applicationMap
=
new
ConcurrentHashMap
<>();
/**
* 敏感词
*/
public
volatile
static
List
<
String
>
sensitiveWordList
=
new
ArrayList
<>();
/**
/**
...
@@ -241,10 +247,8 @@ public class TimingAcquisition {
...
@@ -241,10 +247,8 @@ public class TimingAcquisition {
/**
/**
* 通过json文件加载所有用户数据到缓存中
* 通过json文件加载所有用户数据到缓存中
*/
*/
public
static
void
loading
()
{
public
static
void
loading
(
String
userFilePath
)
{
log
.
info
(
"-----------开始加载玩家数据----------------"
);
log
.
info
(
"-----------开始加载玩家数据----------------"
);
//从yml配置文件中取出存放玩家数据的地址
String
userFilePath
=
YamlUtil
.
getValueByKey
(
"userFilePath"
);
File
file
=
new
File
(
userFilePath
);
File
file
=
new
File
(
userFilePath
);
File
[]
files
=
file
.
listFiles
();
File
[]
files
=
file
.
listFiles
();
if
(
files
==
null
)
{
if
(
files
==
null
)
{
...
@@ -255,24 +259,17 @@ public class TimingAcquisition {
...
@@ -255,24 +259,17 @@ public class TimingAcquisition {
if
(
f
.
isFile
())
{
if
(
f
.
isFile
())
{
String
s
=
PersistenceUtil
.
getDataFromFile
(
String
.
valueOf
(
f
));
String
s
=
PersistenceUtil
.
getDataFromFile
(
String
.
valueOf
(
f
));
//JSON转map对象
//JSON转map对象
// log.info("取出的数据:" + s);
Map
<
String
,
GardenerDto
>
gardener
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
GardenerDto
>>(){});
Map
<
String
,
GardenerDto
>
gardener
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
GardenerDto
>>(){});
// log.info("从文件中取出玩家的缓存数据:" + gardener);
gardenerMap
.
putAll
(
gardener
);
gardenerMap
.
putAll
(
gardener
);
}
}
}
}
log
.
info
(
"-----------玩家数据加载完成----------------"
);
log
.
info
(
"-----------玩家数据加载完成----------------"
);
// log.info("内存中所有玩家的缓存数据:" + gardenerMap );
//加载话术
speechLoading
();
//加载配置文件region.json
// regionNoLoading("region.json");
}
}
/**
/**
* 通过yaml文件加载所有话术到缓存中
* 通过yaml文件加载所有话术到缓存中
*/
*/
public
static
void
speechLoading
()
{
public
static
void
speechLoading
(
String
speechFilePath
)
{
log
.
info
(
"---------开始加载话术到缓存中---------"
);
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
<>();
...
@@ -284,26 +281,19 @@ public class TimingAcquisition {
...
@@ -284,26 +281,19 @@ public class TimingAcquisition {
Map
<
String
,
Map
<
String
,
List
<
String
>>>
adviseSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
adviseSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
rankingSpeech
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
rankingSpeech
=
new
HashMap
<>();
try
{
try
{
plantSpeech
=
YamlUtil
.
loadSpeechToMap
(
"plant.yaml"
);
plantSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"plant.yaml"
);
gardenerSpeech
=
YamlUtil
.
loadSpeechToMap
(
"gardener.yaml"
);
gardenerSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"gardener.yaml"
);
petSpeech
=
YamlUtil
.
loadSpeechToMap
(
"pet.yaml"
);
petSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"pet.yaml"
);
marketSpeech
=
YamlUtil
.
loadSpeechToMap
(
"market.yaml"
);
marketSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"market.yaml"
);
socialSpeech
=
YamlUtil
.
loadSpeechToMap
(
"social.yaml"
);
socialSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"social.yaml"
);
taskSpeech
=
YamlUtil
.
loadSpeechToMap
(
"task.yaml"
);
taskSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"task.yaml"
);
helpSpeech
=
YamlUtil
.
loadSpeechToMap
(
"help.yaml"
);
helpSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"help.yaml"
);
adviseSpeech
=
YamlUtil
.
loadSpeechToMap
(
"advise.yaml"
);
adviseSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"advise.yaml"
);
rankingSpeech
=
YamlUtil
.
loadSpeechToMap
(
"ranking.yaml"
);
rankingSpeech
=
YamlUtil
.
loadSpeechToMap
(
speechFilePath
,
"ranking.yaml"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
//JSON转map对象
//JSON转map对象
// log.info("从yaml文件中取出的种植话术:" + plantSpeech);
// log.info("从yaml文件中取出的园丁话术:" + gardenerSpeech);
// log.info("从yaml文件中取出的宠物话术:" + petSpeech);
// log.info("从yaml文件中取出的市场话术:" + marketSpeech);
// log.info("从yaml文件中取出的社交话术:" + socialSpeech);
// log.info("从yaml文件中取出的任务话术:" + taskSpeech);
// log.info("从yaml文件中取出的帮助话术:" + helpSpeech);
plantSpeechMap
.
putAll
(
plantSpeech
);
plantSpeechMap
.
putAll
(
plantSpeech
);
gardenerSpeechMap
.
putAll
(
gardenerSpeech
);
gardenerSpeechMap
.
putAll
(
gardenerSpeech
);
petSpeechMap
.
putAll
(
petSpeech
);
petSpeechMap
.
putAll
(
petSpeech
);
...
@@ -313,13 +303,6 @@ public class TimingAcquisition {
...
@@ -313,13 +303,6 @@ public class TimingAcquisition {
helpSpeechMap
.
putAll
(
helpSpeech
);
helpSpeechMap
.
putAll
(
helpSpeech
);
adviseSpeechMap
.
putAll
(
adviseSpeech
);
adviseSpeechMap
.
putAll
(
adviseSpeech
);
rankingSpeechMap
.
putAll
(
rankingSpeech
);
rankingSpeechMap
.
putAll
(
rankingSpeech
);
// log.info("缓存中玩家的种植话术:" + plantSpeechMap);
// log.info("缓存中玩家的园丁话术:" + gardenerSpeechMap);
// log.info("缓存中玩家的宠物话术:" + petSpeechMap);
// log.info("缓存中玩家的市场话术:" + marketSpeechMap);
// log.info("缓存中玩家的社交话术:" + socialSpeechMap);
// log.info("缓存中玩家的任务话术:" + taskSpeechMap);
// log.info("缓存中玩家的帮助话术:" + helpSpeechMap);
log
.
info
(
"---------加载话术到缓存的操作完成---------"
);
log
.
info
(
"---------加载话术到缓存的操作完成---------"
);
}
}
...
@@ -327,8 +310,8 @@ public class TimingAcquisition {
...
@@ -327,8 +310,8 @@ public class TimingAcquisition {
* @param fileName
* @param fileName
* 通过json文件加载配置到缓存中
* 通过json文件加载配置到缓存中
*/
*/
public
static
void
regionNoLoading
(
String
fileName
)
{
public
static
void
regionNoLoading
(
String
configFilePath
,
String
fileName
)
{
String
s
=
PersistenceUtil
.
getConfigFromFile
(
fileName
);
String
s
=
PersistenceUtil
.
getConfigFromFile
(
configFilePath
,
fileName
);
//JSON转map对象
//JSON转map对象
log
.
info
(
fileName
+
"配置文件取出的配置数据:"
+
s
);
log
.
info
(
fileName
+
"配置文件取出的配置数据:"
+
s
);
Map
<
String
,
Integer
>
config
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
Integer
>>(){});
Map
<
String
,
Integer
>
config
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
Integer
>>(){});
...
@@ -339,10 +322,10 @@ public class TimingAcquisition {
...
@@ -339,10 +322,10 @@ public class TimingAcquisition {
/**
/**
* 通过json文件加载配置到缓存中
* 通过json文件加载配置到缓存中
*/
*/
public
static
String
generateAddress
(
String
IP
)
{
public
static
String
generateAddress
(
String
configFilePath
,
String
IP
)
{
String
result
=
null
;
String
result
=
null
;
String
fileName
=
"region.json"
;
String
fileName
=
"region.json"
;
String
s
=
PersistenceUtil
.
getConfigFromFile
(
fileName
);
String
s
=
PersistenceUtil
.
getConfigFromFile
(
configFilePath
,
fileName
);
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
log
.
info
(
fileName
+
"文件中取出服务器和地区的数据:"
+
IPRegionsMap
);
log
.
info
(
fileName
+
"文件中取出服务器和地区的数据:"
+
IPRegionsMap
);
//通过服务器IP找到所有的地区
//通过服务器IP找到所有的地区
...
...
src/main/java/com/qiwuai/garden/common/cache/UserThread.java
deleted
100644 → 0
View file @
453f64c4
package
com
.
qiwuai
.
garden
.
common
.
cache
;
public
class
UserThread
{
}
src/main/java/com/qiwuai/garden/common/schedule/ScheduleTask.java
View file @
9855819a
...
@@ -14,6 +14,7 @@ import com.qiwuai.garden.pojo.PetPojo;
...
@@ -14,6 +14,7 @@ import com.qiwuai.garden.pojo.PetPojo;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -32,6 +33,9 @@ import java.util.concurrent.TimeUnit;
...
@@ -32,6 +33,9 @@ import java.util.concurrent.TimeUnit;
public
class
ScheduleTask
{
public
class
ScheduleTask
{
Logger
log
=
LoggerFactory
.
getLogger
(
ScheduleTask
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
ScheduleTask
.
class
);
@Value
(
"${configFilePath}"
)
public
String
configFilePath
;
//定时喂养宠物,消耗物品
//定时喂养宠物,消耗物品
// @Scheduled(cron = "0 0 1 * * ?")
// @Scheduled(cron = "0 0 1 * * ?")
// @Scheduled(cron = "0/60 * * * * ?")
// @Scheduled(cron = "0/60 * * * * ?")
...
@@ -120,7 +124,7 @@ public class ScheduleTask {
...
@@ -120,7 +124,7 @@ public class ScheduleTask {
TimingAcquisition
.
friendshipRankingList
.
addAll
(
friendshipRankingList
);
TimingAcquisition
.
friendshipRankingList
.
addAll
(
friendshipRankingList
);
//获取所有地区
//获取所有地区
String
fileName
=
"region.json"
;
String
fileName
=
"region.json"
;
String
s
=
PersistenceUtil
.
getConfigFromFile
(
fileName
);
String
s
=
PersistenceUtil
.
getConfigFromFile
(
configFilePath
,
fileName
);
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
Map
<
String
,
List
<
RegionIPDto
>>
IPRegionsMap
=
JSON
.
parseObject
(
s
,
new
TypeReference
<
Map
<
String
,
List
<
RegionIPDto
>>>(){});
for
(
Map
.
Entry
<
String
,
List
<
RegionIPDto
>>
entry
:
IPRegionsMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
RegionIPDto
>>
entry
:
IPRegionsMap
.
entrySet
())
{
List
<
RegionIPDto
>
regionIPList
=
entry
.
getValue
();
List
<
RegionIPDto
>
regionIPList
=
entry
.
getValue
();
...
...
src/main/java/com/qiwuai/garden/common/utils/DataTrimUtil.java
0 → 100644
View file @
9855819a
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwuai/garden/common/utils/HttpUtil.java
View file @
9855819a
...
@@ -7,27 +7,50 @@ import com.qiwuai.garden.dto.response.PhraseResponse;
...
@@ -7,27 +7,50 @@ import com.qiwuai.garden.dto.response.PhraseResponse;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.List
;
import
java.util.List
;
@Component
public
class
HttpUtil
{
public
class
HttpUtil
{
static
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
static
Logger
log
=
LoggerFactory
.
getLogger
(
HttpUtil
.
class
);
//动态词组更新秘钥
//动态词组更新秘钥
public
static
String
appSecret
=
YamlUtil
.
getValueByKey
(
"appSecret"
);
public
static
String
appSecret
;
@Value
(
"${appSecret}"
)
public
void
setAppSecret
(
String
appSecret
)
{
HttpUtil
.
appSecret
=
appSecret
;
}
//动态词组更新秘钥
//动态词组更新秘钥
public
static
String
updatePhraseUrl
=
YamlUtil
.
getValueByKey
(
"updatePhraseUrl"
);
public
static
String
updatePhraseUrl
;
@Value
(
"${updatePhraseUrl}"
)
public
void
setUpdatePhraseUrl
(
String
updatePhraseUrl
)
{
HttpUtil
.
updatePhraseUrl
=
updatePhraseUrl
;
}
//分享关系地址
//分享关系地址
public
static
String
shareRelationUrl
=
YamlUtil
.
getValueByKey
(
"shareRelationUrl"
);
public
static
String
shareRelationUrl
;
@Value
(
"${shareRelationUrl}"
)
public
void
setShareRelationUrl
(
String
shareRelationUrl
)
{
HttpUtil
.
shareRelationUrl
=
shareRelationUrl
;
}
//分享链接通道
//分享链接通道
public
static
String
shareChannelId
=
YamlUtil
.
getValueByKey
(
"shareChannelId"
);
public
static
String
shareChannelId
;
@Value
(
"${shareChannelId}"
)
public
void
setShareChannelId
(
String
shareChannelId
)
{
HttpUtil
.
shareChannelId
=
shareChannelId
;
}
//分享链接秘钥
//分享链接秘钥
public
static
String
shareAppSecret
=
YamlUtil
.
getValueByKey
(
"shareAppSecret"
);
public
static
String
shareAppSecret
;
@Value
(
"${shareAppSecret}"
)
public
void
setShareAppSecret
(
String
shareAppSecret
)
{
HttpUtil
.
shareAppSecret
=
shareAppSecret
;
}
//更新动态词组
//更新动态词组
public
static
void
doPut
(
String
phraseName
,
String
phraseContent
)
{
public
static
void
doPut
(
String
phraseName
,
String
phraseContent
)
{
...
...
src/main/java/com/qiwuai/garden/common/utils/PersistenceUtil.java
View file @
9855819a
...
@@ -4,27 +4,45 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,27 +4,45 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.qiwuai.garden.common.Constants
;
import
com.qiwuai.garden.common.Constants
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
com.qiwuai.garden.dto.BackPackDto
;
import
com.qiwuai.garden.dto.HelpReportDto
;
import
com.qiwuai.garden.dto.HelpReportDto
;
import
com.qiwuai.garden.dto.MessageTimeDto
;
import
com.qiwuai.garden.dto.MessageTimeDto
;
import
com.qiwuai.garden.dto.StealReportDto
;
import
com.qiwuai.garden.dto.StealReportDto
;
import
jxl.Cell
;
import
jxl.Cell
;
import
jxl.Sheet
;
import
jxl.Sheet
;
import
jxl.Workbook
;
import
jxl.Workbook
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.*
;
@Component
public
class
PersistenceUtil
{
public
class
PersistenceUtil
{
//玩家数据的存放路径
//玩家数据的存放路径
public
static
String
userFilePath
=
YamlUtil
.
getValueByKey
(
"userFilePath"
);
public
static
String
userFilePath
;
@Value
(
"${userFilePath}"
)
public
void
setUserFilePath
(
String
userFilePath
)
{
PersistenceUtil
.
userFilePath
=
userFilePath
;
}
//各地区编号的存放路径
//各地区编号的存放路径
public
static
String
configFilePath
=
YamlUtil
.
getValueByKey
(
"configFilePath"
);
public
static
String
configFilePath
;
@Value
(
"${configFilePath}"
)
public
void
setConfigFilePath
(
String
configFilePath
)
{
PersistenceUtil
.
configFilePath
=
configFilePath
;
}
//各玩家的留言信息
//各玩家的留言信息
public
static
String
messageFilePath
=
YamlUtil
.
getValueByKey
(
"messageFilePath"
);
public
static
String
messageFilePath
;
@Value
(
"${messageFilePath}"
)
public
void
setMessageFilePath
(
String
messageFilePath
)
{
PersistenceUtil
.
messageFilePath
=
messageFilePath
;
}
//各玩家的简报信息
//各玩家的简报信息
public
static
String
reportFilePath
=
YamlUtil
.
getValueByKey
(
"reportFilePath"
);
public
static
String
reportFilePath
;
@Value
(
"${reportFilePath}"
)
public
void
setReportFilePath
(
String
reportFilePath
)
{
PersistenceUtil
.
reportFilePath
=
reportFilePath
;
}
/**
/**
* 保存玩家数据到json文件
* 保存玩家数据到json文件
* @param fileName
* @param fileName
...
@@ -122,7 +140,7 @@ public class PersistenceUtil {
...
@@ -122,7 +140,7 @@ public class PersistenceUtil {
* @param fileName
* @param fileName
* @return String
* @return String
*/
*/
public
static
String
getConfigFromFile
(
String
fileName
)
{
public
static
String
getConfigFromFile
(
String
configFilePath
,
String
fileName
)
{
BufferedReader
reader
=
null
;
BufferedReader
reader
=
null
;
String
lastStr
=
""
;
String
lastStr
=
""
;
try
{
try
{
...
@@ -152,20 +170,26 @@ public class PersistenceUtil {
...
@@ -152,20 +170,26 @@ public class PersistenceUtil {
* @return String
* @return String
*/
*/
public
static
List
<
String
>
getContentFromFile
(
String
fileName
)
{
public
static
List
<
String
>
getContentFromFile
(
String
fileName
)
{
List
<
String
>
contentList
=
new
ArrayList
<>();
List
<
String
>
sensitiveWordList
=
TimingAcquisition
.
sensitiveWordList
;
try
{
if
(
sensitiveWordList
.
size
()
!=
0
)
{
File
file
=
new
File
(
configFilePath
+
fileName
);
return
sensitiveWordList
;
Workbook
workbook
=
Workbook
.
getWorkbook
(
file
);
}
else
{
Sheet
sheet
=
workbook
.
getSheets
()[
0
];
List
<
String
>
contentList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
sheet
.
getRows
();
i
++)
{
try
{
Cell
cell
=
sheet
.
getCell
(
0
,
i
);
File
file
=
new
File
(
configFilePath
+
fileName
);
String
content
=
cell
.
getContents
();
Workbook
workbook
=
Workbook
.
getWorkbook
(
file
);
contentList
.
add
(
content
);
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
);
}
sensitiveWordList
.
addAll
(
contentList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
Exception
e
)
{
return
contentList
;
e
.
printStackTrace
();
}
}
return
contentList
;
}
}
/**
/**
...
...
src/main/java/com/qiwuai/garden/common/utils/RequestConversionUtil.java
View file @
9855819a
...
@@ -2,21 +2,16 @@ package com.qiwuai.garden.common.utils;
...
@@ -2,21 +2,16 @@ 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.GardenerDto
;
import
com.qiwuai.garden.dto.base.CommonRequest
;
import
com.qiwuai.garden.dto.base.CommonRequest
;
import
com.qiwuai.garden.dto.request.CallRequest
;
import
com.qiwuai.garden.dto.request.CallRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.dto.request.OperationRequest
;
import
com.qiwuai.garden.pojo.AttributePojo
;
import
com.qiwuai.garden.pojo.AttributePojo
;
import
com.qiwuai.garden.pojo.ItemPojo
;
import
com.qiwuai.garden.pojo.ItemPojo
;
import
com.qiwuai.garden.pojo.PetPojo
;
import
com.qiwuai.garden.pojo.PlantPojo
;
import
com.qiwuai.garden.pojo.PlantPojo
;
import
com.qiwuai.garden.service.gardenerService.GardenerService
;
import
com.qiwuai.garden.service.gardenerService.impl.GardenerServiceImpl
;
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
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -32,20 +27,6 @@ public class RequestConversionUtil {
...
@@ -32,20 +27,6 @@ public class RequestConversionUtil {
OperationRequest
operationRequest
=
new
OperationRequest
();
OperationRequest
operationRequest
=
new
OperationRequest
();
CallRequest
callRequest
=
commonRequest
.
getVars
();
CallRequest
callRequest
=
commonRequest
.
getVars
();
operationRequest
.
setUid
(
commonRequest
.
getUid
());
operationRequest
.
setUid
(
commonRequest
.
getUid
());
//----------------------新的uid则创建用户--------------------------
GardenerDto
gardener
=
TimingAcquisition
.
gardenerMap
.
get
(
commonRequest
.
getUid
());
if
(
StringUtils
.
isEmpty
(
gardener
))
{
//给新玩家分配姓名
// List<String> nameList = PersistenceUtil.getContentFromFile("name.xls");
// String name = nameList.get(RandomDropUtil.getRandomNum(0, nameList.size()));
String
name
=
"海棠仙子"
;
OperationRequest
operationReq
=
new
OperationRequest
();
operationReq
.
setUid
(
commonRequest
.
getUid
());
operationReq
.
setGender
(
2
);
operationReq
.
setName
(
name
);
GardenerService
gardenerService
=
new
GardenerServiceImpl
();
gardenerService
.
create
(
operationReq
);
}
//---------------------存在GB_园丁姓名-----------------------
//---------------------存在GB_园丁姓名-----------------------
String
gardenerName
=
callRequest
.
getGB_
园丁姓名
();
String
gardenerName
=
callRequest
.
getGB_
园丁姓名
();
if
(!
StringUtils
.
isEmpty
(
gardenerName
))
{
if
(!
StringUtils
.
isEmpty
(
gardenerName
))
{
...
...
src/main/java/com/qiwuai/garden/common/utils/SpeechUtil.java
View file @
9855819a
...
@@ -3,7 +3,6 @@ package com.qiwuai.garden.common.utils;
...
@@ -3,7 +3,6 @@ package com.qiwuai.garden.common.utils;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
class
SpeechUtil
{
public
class
SpeechUtil
{
/**
/**
...
@@ -91,7 +90,7 @@ public class SpeechUtil {
...
@@ -91,7 +90,7 @@ public class SpeechUtil {
}
}
/**
/**
* 从
任务
模块话术获取话术
* 从
帮助
模块话术获取话术
* @param someone
* @param someone
* @param feedText
* @param feedText
* @return String
* @return String
...
...
src/main/java/com/qiwuai/garden/common/utils/TypeConvertUtil.java
View file @
9855819a
...
@@ -301,21 +301,45 @@ public class TypeConvertUtil {
...
@@ -301,21 +301,45 @@ public class TypeConvertUtil {
}
}
/**
/**
* 提取
中文
的阿拉伯数字
* 提取
文本中
的阿拉伯数字
* @param param
* @param param
* @return Integer
* @return Integer
*/
*/
public
static
Integer
extractNum
(
String
param
)
{
public
static
Integer
extractNum
(
String
param
)
{
int
i
;
String
regEx
=
"[^0-9]"
;
String
regEx
=
"[^0-9]"
;
Pattern
p
=
Pattern
.
compile
(
regEx
);
Pattern
p
=
Pattern
.
compile
(
regEx
);
Matcher
m
=
p
.
matcher
(
param
);
Matcher
m
=
p
.
matcher
(
param
);
if
(!
""
.
equals
(
m
.
replaceAll
(
""
).
trim
()))
{
if
(!
""
.
equals
(
m
.
replaceAll
(
""
).
trim
()))
{
i
=
Integer
.
parseInt
(
m
.
replaceAll
(
""
).
trim
());
if
(
StringUtils
.
isEmpty
(
extractChinese
(
param
)))
{
if
(
param
.
length
()
>
9
)
{
return
Constants
.
REQ_NON
;
}
}
return
Integer
.
valueOf
(
m
.
replaceAll
(
""
).
trim
());
}
else
{
return
Constants
.
REQ_NON
;
}
}
/**
* 提取文本中的阿拉伯数字,以字符串返回
* @param param
* @return Integer
*/
public
static
String
getNumFromContext
(
String
param
)
{
String
regEx
=
"[^0-9]"
;
Pattern
p
=
Pattern
.
compile
(
regEx
);
Matcher
m
=
p
.
matcher
(
param
);
if
(!
""
.
equals
(
m
.
replaceAll
(
""
).
trim
()))
{
if
(
StringUtils
.
isEmpty
(
extractChinese
(
param
)))
{
if
(
param
.
length
()
>
9
)
{
return
Constants
.
NON_STR
;
}
}
return
m
.
replaceAll
(
""
).
trim
();
}
else
{
}
else
{
i
=
Constants
.
REQ_NON
;
return
Constants
.
NON_STR
;
}
}
return
i
;
}
}
/**
/**
...
@@ -344,6 +368,16 @@ public class TypeConvertUtil {
...
@@ -344,6 +368,16 @@ public class TypeConvertUtil {
}
}
/**
/**
* 删除中文
* @param param
* @return Integer
*/
public
static
String
removeChinese
(
String
param
)
{
String
regEx
=
"[\u4e00-\u9fa5)]"
;
return
param
.
replaceAll
(
regEx
,
""
);
}
/**
* {"未读", "已读"}中文转成数字
* {"未读", "已读"}中文转成数字
* @param param
* @param param
* @return Integer
* @return Integer
...
@@ -465,4 +499,70 @@ public class TypeConvertUtil {
...
@@ -465,4 +499,70 @@ public class TypeConvertUtil {
pageInfo
.
setEnd
(
end
);
pageInfo
.
setEnd
(
end
);
return
pageInfo
;
return
pageInfo
;
}
}
/**
* 正则匹配微信号、手机号码和qq号
* @param context
*/
public
static
int
checkContext
(
String
context
)
{
//微信正则表达式
String
weChatPattern
=
"^[a-zA-Z]{1}[-_a-zA-Z0-9]{5,19}+$"
;
//qq正则表达式
String
qqPattern
=
"^[1-9][0-9]{4,10}$"
;
//手机号正则表达式
String
phonePattern
=
"^((13[0-9])|(14[5,6,7,9])|(15[^4])|(16[5,6])|(17[0-9])|(18[0-9])|(19[1,8,9]))\\d{8}$"
;
//留言内容不符合格式要求
if
(!
context
.
contains
(
"微信"
)
&&
!
context
.
contains
(
"qq"
)&&
!
context
.
contains
(
"QQ"
)
&&
!
context
.
contains
(
"手机"
))
{
return
4
;
}
//微信格式不正确
if
(
context
.
contains
(
"微信"
))
{
context
=
removeChinese
(
context
);
//微信格式不正确
if
(!
context
.
matches
(
weChatPattern
)
&&
!
context
.
matches
(
phonePattern
))
{
return
1
;
}
}
//qq格式不正确
if
(
context
.
contains
(
"qq"
)
||
context
.
contains
(
"QQ"
))
{
context
=
getNumFromContext
(
context
);
//qq格式不正确
if
(!
context
.
matches
(
qqPattern
))
{
return
2
;
}
}
//手机号码格式不正确
if
(
context
.
contains
(
"手机"
))
{
context
=
getNumFromContext
(
context
);
//手机号码格式不正确
if
(!
context
.
matches
(
phonePattern
))
{
return
3
;
}
}
return
0
;
}
/**
* 微信号、手机号码和qq号的文本替换
* @param context
*/
public
static
String
contextChange
(
String
context
)
{
String
result
=
""
;
//微信格式
if
(
context
.
contains
(
"微信"
))
{
context
=
removeChinese
(
context
);
result
=
"微信:"
+
context
;
}
//qq格式
if
(
context
.
contains
(
"qq"
)
||
context
.
contains
(
"QQ"
))
{
context
=
getNumFromContext
(
context
);
result
=
"QQ:"
+
context
;
}
//手机号码格式
if
(
context
.
contains
(
"手机"
))
{
context
=
getNumFromContext
(
context
);
result
=
"手机号码:"
+
context
;
}
return
result
;
}
}
}
src/main/java/com/qiwuai/garden/common/utils/YamlUtil.java
View file @
9855819a
package
com
.
qiwuai
.
garden
.
common
.
utils
;
package
com
.
qiwuai
.
garden
.
common
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.qiwuai.garden.common.TimingAcquisition
;
import
com.qiwuai.garden.dto.RegionIPDto
;
import
com.qiwuai.garden.dto.RegionIPDto
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
org.yaml.snakeyaml.Yaml
;
import
org.yaml.snakeyaml.Yaml
;
import
java.io.FileInputStream
;
import
java.io.*
;
import
java.io.FileNotFoundException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
...
@@ -18,16 +20,13 @@ import java.util.concurrent.ConcurrentHashMap;
...
@@ -18,16 +20,13 @@ import java.util.concurrent.ConcurrentHashMap;
@Component
@Component
@Data
@Data
public
class
YamlUtil
{
public
class
YamlUtil
{
//获取话术存放的路径
public
static
String
speechFilePath
=
YamlUtil
.
getValueByKey
(
"speechFilePath"
);
private
static
LinkedHashMap
<
String
,
Map
<
String
,
Map
<
String
,
String
>>>
properties
=
new
LinkedHashMap
<>();
private
static
LinkedHashMap
<
String
,
Map
<
String
,
Map
<
String
,
String
>>>
properties
=
new
LinkedHashMap
<>();
/**
/**
* 将话术转成map格式
* 将话术转成map格式
* @param
* @param
* @return Map<String, Map<String, List<String>>>
* @return Map<String, Map<String, List<String>>>
*/
*/
public
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
loadSpeechToMap
(
String
fileName
)
{
public
static
Map
<
String
,
Map
<
String
,
List
<
String
>>>
loadSpeechToMap
(
String
speechFilePath
,
String
fileName
)
{
Map
<
String
,
Map
<
String
,
List
<
String
>>>
speechMap
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
List
<
String
>>>
speechMap
=
new
HashMap
<>();
try
{
try
{
InputStream
in
=
new
FileInputStream
(
speechFilePath
+
fileName
);
InputStream
in
=
new
FileInputStream
(
speechFilePath
+
fileName
);
...
@@ -46,16 +45,25 @@ public class YamlUtil {
...
@@ -46,16 +45,25 @@ public class YamlUtil {
*/
*/
public
static
String
getValueByKey
(
String
key
)
{
public
static
String
getValueByKey
(
String
key
)
{
String
value
=
""
;
String
value
=
""
;
try
{
Map
<
String
,
String
>
applicationMap
=
TimingAcquisition
.
applicationMap
;
Yaml
yaml
=
new
Yaml
();
if
(
applicationMap
.
size
()
!=
0
)
{
ClassPathResource
resource
=
new
ClassPathResource
(
"\\application.yml"
);
return
String
.
valueOf
(
applicationMap
.
get
(
key
));
properties
=
yaml
.
load
(
resource
.
getInputStream
());
}
else
{
String
val
=
properties
.
get
(
"spring"
).
get
(
"profiles"
).
get
(
"active"
);
try
{
ClassPathResource
resourceNext
=
new
ClassPathResource
(
"\\application-"
+
val
+
".yml"
);
Yaml
yaml
=
new
Yaml
();
Map
map
=
yaml
.
load
(
resourceNext
.
getInputStream
());
ClassPathResource
resource
=
new
ClassPathResource
(
"\\application.yml"
);
value
=
String
.
valueOf
(
map
.
get
(
key
));
properties
=
yaml
.
load
(
resource
.
getInputStream
());
}
catch
(
Exception
e
)
{
String
val
=
properties
.
get
(
"spring"
).
get
(
"profiles"
).
get
(
"active"
);
e
.
printStackTrace
();
// ClassPathResource resourceNext = new ClassPathResource("\\application-" + val + ".yml");
// Map map = yaml.load(resourceNext.getInputStream());
FileInputStream
fileInputStream
=
new
FileInputStream
(
"/home/jiaoyou/projects/secretGarden/application-"
+
val
+
".yml"
);
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
fileInputStream
,
"UTF-8"
);
Map
<
String
,
String
>
map
=
yaml
.
load
(
inputStreamReader
);
applicationMap
.
putAll
(
map
);
value
=
String
.
valueOf
(
map
.
get
(
key
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
return
value
;
return
value
;
}
}
...
...
src/main/java/com/qiwuai/garden/controller/CommonController.java
View file @
9855819a
This diff is collapsed.
Click to expand it.
src/main/java/com/qiwuai/garden/service/adviseService/impl/AdviseServiceImpl.java
View file @
9855819a
...
@@ -21,6 +21,7 @@ import com.qiwuai.garden.service.plantService.impl.PlantServiceImpl;
...
@@ -21,6 +21,7 @@ import com.qiwuai.garden.service.plantService.impl.PlantServiceImpl;
import
com.qiwuai.garden.service.socialService.impl.SocialServiceImpl
;
import
com.qiwuai.garden.service.socialService.impl.SocialServiceImpl
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -35,7 +36,8 @@ import java.util.stream.Collectors;
...
@@ -35,7 +36,8 @@ import java.util.stream.Collectors;
public
class
AdviseServiceImpl
implements
AdviseService
{
public
class
AdviseServiceImpl
implements
AdviseService
{
Logger
log
=
LoggerFactory
.
getLogger
(
AdviseServiceImpl
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
AdviseServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
GardenerServiceImpl
gardenerService
=
(
GardenerServiceImpl
)
GetBeanUtil
.
getBean
(
"gardenerServiceImpl"
);
GardenerServiceImpl
gardenerService
=
(
GardenerServiceImpl
)
GetBeanUtil
.
getBean
(
"gardenerServiceImpl"
);
...
...
src/main/java/com/qiwuai/garden/service/backPackService/impl/BackPackServiceImpl.java
View file @
9855819a
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.pojo.*;
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.pojo.*;
import
com.qiwuai.garden.service.backPackService.BackPackService
;
import
com.qiwuai.garden.service.backPackService.BackPackService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
...
src/main/java/com/qiwuai/garden/service/gardenerService/impl/GardenerServiceImpl.java
View file @
9855819a
...
@@ -21,6 +21,7 @@ import com.qiwuai.garden.service.gardenerService.GardenerService;
...
@@ -21,6 +21,7 @@ import com.qiwuai.garden.service.gardenerService.GardenerService;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -39,10 +40,14 @@ import java.util.stream.Stream;
...
@@ -39,10 +40,14 @@ import java.util.stream.Stream;
public
class
GardenerServiceImpl
implements
GardenerService
{
public
class
GardenerServiceImpl
implements
GardenerService
{
private
Logger
log
=
LoggerFactory
.
getLogger
(
GardenerServiceImpl
.
class
);
private
Logger
log
=
LoggerFactory
.
getLogger
(
GardenerServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Value
(
"${configFilePath}"
)
private
String
configFilePath
;
@Autowired
@Autowired
private
GardenerMapper
gardenerMapper
;
private
GardenerMapper
gardenerMapper
;
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Override
@Override
public
CommonResponse
enterGame
(
OperationRequest
operationReq
)
throws
ParseException
{
public
CommonResponse
enterGame
(
OperationRequest
operationReq
)
throws
ParseException
{
...
@@ -175,7 +180,7 @@ public class GardenerServiceImpl implements GardenerService {
...
@@ -175,7 +180,7 @@ public class GardenerServiceImpl implements GardenerService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
//--------------生成新的玩家地址----------------
//--------------生成新的玩家地址----------------
String
location
=
TimingAcquisition
.
generateAddress
(
hostAddress
);
String
location
=
TimingAcquisition
.
generateAddress
(
configFilePath
,
hostAddress
);
region
=
TypeConvertUtil
.
extractChinese
(
location
);
region
=
TypeConvertUtil
.
extractChinese
(
location
);
String
num
=
location
.
replace
(
region
,
""
);
String
num
=
location
.
replace
(
region
,
""
);
gardenDto
.
setZone
(
region
);
gardenDto
.
setZone
(
region
);
...
...
src/main/java/com/qiwuai/garden/service/marketService/impl/MarketServiceImpl.java
View file @
9855819a
...
@@ -16,6 +16,7 @@ import com.qiwuai.garden.service.marketService.MarketService;
...
@@ -16,6 +16,7 @@ import com.qiwuai.garden.service.marketService.MarketService;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -31,7 +32,8 @@ public class MarketServiceImpl implements MarketService {
...
@@ -31,7 +32,8 @@ public class MarketServiceImpl implements MarketService {
Logger
log
=
LoggerFactory
.
getLogger
(
MarketServiceImpl
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
MarketServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Override
@Override
public
CommonResponse
buyCheck
(
OperationRequest
operationReq
)
{
public
CommonResponse
buyCheck
(
OperationRequest
operationReq
)
{
...
@@ -217,14 +219,29 @@ public class MarketServiceImpl implements MarketService {
...
@@ -217,14 +219,29 @@ public class MarketServiceImpl implements MarketService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//商品总价
int
price
=
itemPrice
.
multiply
(
new
BigDecimal
(
number
)).
intValue
();
if
(
price
<
0
)
{
log
.
info
(
uid
+
"的货币不足"
);
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_fail_money"
);
text
+=
SpeechUtil
.
getMarketSpeech
(
gender
,
"buy_fail_money"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
callName
.
getName
(),
callName
.
getSubName
());
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400107
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"购买物品回复3"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//保存玩家这轮的请求信息,itemId和数量均保存,用于下一步的确认购买操作
//保存玩家这轮的请求信息,itemId和数量均保存,用于下一步的确认购买操作
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemTypeId
(
itemConfig
.
getItemTypeId
());
operationReq
.
setItemTypeId
(
itemConfig
.
getItemTypeId
());
operationReq
.
setNumber
(
number
);
operationReq
.
setNumber
(
number
);
operationReq
.
setOperationLabel
(
Constants
.
BUY_GOODS
);
operationReq
.
setOperationLabel
(
Constants
.
BUY_GOODS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//商品总价
int
price
=
itemPrice
.
multiply
(
new
BigDecimal
(
number
)).
intValue
();
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"buy_check_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
goodsName
,
String
.
valueOf
(
price
),
moneyConfig
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
goodsName
,
String
.
valueOf
(
price
),
moneyConfig
.
getName
());
...
@@ -529,7 +546,7 @@ public class MarketServiceImpl implements MarketService {
...
@@ -529,7 +546,7 @@ public class MarketServiceImpl implements MarketService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
if
(
item
.
getItemNum
()
=
=
0
)
{
if
(
item
.
getItemNum
()
<
=
0
)
{
log
.
info
(
uid
+
"玩家背包还没有该物品"
);
log
.
info
(
uid
+
"玩家背包还没有该物品"
);
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_fail_none"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_fail_none"
);
...
@@ -604,6 +621,26 @@ public class MarketServiceImpl implements MarketService {
...
@@ -604,6 +621,26 @@ public class MarketServiceImpl implements MarketService {
return
commonResponse
;
return
commonResponse
;
}
}
int
price
=
number
*
itemConfig
.
getPrice
();
int
price
=
number
*
itemConfig
.
getPrice
();
if
(
price
<
0
)
{
log
.
info
(
uid
+
"玩家出售物品数量大于背包有的数量"
);
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_fail_num"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
itemConfig
.
getName
());
//保存玩家这轮的请求信息,用于下一步的操作
operationReq
.
setItemId
(
itemId
);
operationReq
.
setItemTypeId
(
itemTypeId
);
operationReq
.
setNumber
(
item
.
getItemNum
());
//保存最大数量,提供给下一步操作
operationReq
.
setOperationLabel
(
Constants
.
SELL_ITEMS
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
400216
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"出售物品回复1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_success"
);
String
text
=
SpeechUtil
.
getMarketSpeech
(
Constants
.
SPEECH_ASIDE
,
"sell_check_success"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
itemConfig
.
getName
(),
String
.
valueOf
(
price
),
money
.
getName
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
number
.
toString
(),
itemConfig
.
getName
(),
String
.
valueOf
(
price
),
money
.
getName
());
...
...
src/main/java/com/qiwuai/garden/service/nurseryService/impl/NurseryServiceImpl.java
View file @
9855819a
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.service.nurseryService.NurseryService;
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.service.nurseryService.NurseryService;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -31,7 +32,8 @@ public class NurseryServiceImpl implements NurseryService {
...
@@ -31,7 +32,8 @@ public class NurseryServiceImpl implements NurseryService {
@Autowired
@Autowired
private
NurseryMapper
nurseryMapper
;
private
NurseryMapper
nurseryMapper
;
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Override
@Override
public
List
<
NurseryPojo
>
findAll
()
{
public
List
<
NurseryPojo
>
findAll
()
{
...
...
src/main/java/com/qiwuai/garden/service/petService/impl/PetServiceImpl.java
View file @
9855819a
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.service.petService.PetService;
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.service.petService.PetService;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -30,7 +31,8 @@ public class PetServiceImpl implements PetService {
...
@@ -30,7 +31,8 @@ public class PetServiceImpl implements PetService {
private
Logger
log
=
LoggerFactory
.
getLogger
(
PetServiceImpl
.
class
);
private
Logger
log
=
LoggerFactory
.
getLogger
(
PetServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Override
@Override
public
CommonResponse
petView
(
OperationRequest
operationReq
)
{
public
CommonResponse
petView
(
OperationRequest
operationReq
)
{
...
...
src/main/java/com/qiwuai/garden/service/plantService/impl/PlantServiceImpl.java
View file @
9855819a
...
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -43,7 +44,8 @@ public class PlantServiceImpl implements PlantService {
...
@@ -43,7 +44,8 @@ public class PlantServiceImpl implements PlantService {
private
AttributeMapper
plantAttributeMapper
;
private
AttributeMapper
plantAttributeMapper
;
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
public
List
<
PlantPojo
>
plantSearch
()
{
public
List
<
PlantPojo
>
plantSearch
()
{
List
<
PlantPojo
>
plantList
=
plantMapper
.
searchAll
();
List
<
PlantPojo
>
plantList
=
plantMapper
.
searchAll
();
...
...
src/main/java/com/qiwuai/garden/service/rankingService/impl/RankingServiceImpl.java
View file @
9855819a
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.pojo.ItemPojo;
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.pojo.ItemPojo;
import
com.qiwuai.garden.service.rankingService.RankingService
;
import
com.qiwuai.garden.service.rankingService.RankingService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -29,7 +30,8 @@ import java.util.stream.Collectors;
...
@@ -29,7 +30,8 @@ import java.util.stream.Collectors;
public
class
RankingServiceImpl
implements
RankingService
{
public
class
RankingServiceImpl
implements
RankingService
{
Logger
log
=
LoggerFactory
.
getLogger
(
RankingServiceImpl
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
RankingServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Override
@Override
public
CommonResponse
checkRankingList
(
OperationRequest
operationReq
)
{
public
CommonResponse
checkRankingList
(
OperationRequest
operationReq
)
{
...
@@ -374,6 +376,18 @@ public class RankingServiceImpl implements RankingService {
...
@@ -374,6 +376,18 @@ public class RankingServiceImpl implements RankingService {
int
fightRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FIGHT_RANKING
,
place
,
uid
);
int
fightRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FIGHT_RANKING
,
place
,
uid
);
//友情榜名次
//友情榜名次
int
friendshipRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FRIENDSHIP_RANKING
,
place
,
uid
);
int
friendshipRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FRIENDSHIP_RANKING
,
place
,
uid
);
//今日新增玩家还没有进行排行
if
(
moneyRanking
==
-
1
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getRankingSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_self_no_ranking"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
700209
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//玩家未提供了榜单和地区,即查看世界排名
//玩家未提供了榜单和地区,即查看世界排名
if
(
StringUtils
.
isEmpty
(
rankingName
)
&&
StringUtils
.
isEmpty
(
place
))
{
if
(
StringUtils
.
isEmpty
(
rankingName
)
&&
StringUtils
.
isEmpty
(
place
))
{
//获取对应话术
//获取对应话术
...
@@ -546,6 +560,18 @@ public class RankingServiceImpl implements RankingService {
...
@@ -546,6 +560,18 @@ public class RankingServiceImpl implements RankingService {
int
fightRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FIGHT_RANKING
,
place
,
uidSide
);
int
fightRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FIGHT_RANKING
,
place
,
uidSide
);
//友情榜名次
//友情榜名次
int
friendshipRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FRIENDSHIP_RANKING
,
place
,
uidSide
);
int
friendshipRanking
=
RankingUtil
.
getRankingByUid
(
Constants
.
FRIENDSHIP_RANKING
,
place
,
uidSide
);
//今日新增玩家还没有进行排行
if
(
moneyRanking
==
-
1
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getRankingSpeech
(
Constants
.
SPEECH_ASIDE
,
"check_player_no_ranking"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
700311
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//玩家未提供了榜单和地区,即查看世界排名
//玩家未提供了榜单和地区,即查看世界排名
if
(
StringUtils
.
isEmpty
(
rankingName
)
&&
StringUtils
.
isEmpty
(
place
))
{
if
(
StringUtils
.
isEmpty
(
rankingName
)
&&
StringUtils
.
isEmpty
(
place
))
{
//获取对应话术
//获取对应话术
...
...
src/main/java/com/qiwuai/garden/service/socialService/impl/SocialServiceImpl.java
View file @
9855819a
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.service.taskService.impl.TaskServiceImpl;
...
@@ -18,6 +18,7 @@ import com.qiwuai.garden.service.taskService.impl.TaskServiceImpl;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -32,7 +33,8 @@ import java.util.stream.Stream;
...
@@ -32,7 +33,8 @@ import java.util.stream.Stream;
public
class
SocialServiceImpl
implements
SocialService
{
public
class
SocialServiceImpl
implements
SocialService
{
Logger
log
=
LoggerFactory
.
getLogger
(
SocialServiceImpl
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
SocialServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Autowired
@Autowired
private
TaskServiceImpl
taskServiceImpl
;
private
TaskServiceImpl
taskServiceImpl
;
...
@@ -6009,7 +6011,7 @@ public class SocialServiceImpl implements SocialService {
...
@@ -6009,7 +6011,7 @@ public class SocialServiceImpl implements SocialService {
//留言内容为空,提示玩家输入留言内容
//留言内容为空,提示玩家输入留言内容
if
(
StringUtils
.
isEmpty
(
message
))
{
if
(
StringUtils
.
isEmpty
(
message
))
{
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_check"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_check
_context
"
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
501101
);
resultResponse
.
set
反馈
ID
(
501101
);
...
@@ -6019,28 +6021,76 @@ public class SocialServiceImpl implements SocialService {
...
@@ -6019,28 +6021,76 @@ public class SocialServiceImpl implements SocialService {
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
return
commonResponse
;
}
}
//留言内容包含敏感词汇,判定失败
//当前留言只允许留qq、微信和电话
List
<
String
>
sensitiveWordList
=
PersistenceUtil
.
getContentFromFile
(
"sensitiveWords.xls"
);
int
result
=
TypeConvertUtil
.
checkContext
(
message
);
for
(
String
sensitive
:
sensitiveWordList
)
{
//留言内容格式不对
if
(
message
.
contains
(
sensitive
))
{
if
(
result
==
4
)
{
log
.
info
(
uid
+
"的留言内容包含敏感词汇:"
+
sensitive
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_check_context"
);
//保存玩家这轮的请求信息,用于下一步操作
commonResponse
.
setCode
(
1
);
operationReq
.
setAddress
(
address
);
commonResponse
.
setMsg
(
"成功"
);
operationReq
.
setMessage
(
null
);
resultResponse
.
set
反馈
ID
(
501112
);
operationReq
.
setOperationLabel
(
Constants
.
LEAVE_MESSAGE
);
resultResponse
.
set
反馈文本
(
text
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
resultResponse
.
set
后台附加返回
(
"请说明留言内容"
);
//获取对应话术
resultVarsResponse
.
setVars
(
resultResponse
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_fail_sensitive_words"
);
commonResponse
.
setData
(
resultVarsResponse
);
commonResponse
.
setCode
(
1
);
return
commonResponse
;
commonResponse
.
setMsg
(
"成功"
);
}
resultResponse
.
set
反馈
ID
(
501105
);
//微信格式不对
resultResponse
.
set
反馈文本
(
text
);
if
(
result
==
1
)
{
resultResponse
.
set
后台附加返回
(
"请说明留言内容"
);
commonResponse
.
setCode
(
1
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setMsg
(
"成功"
);
commonResponse
.
setData
(
resultVarsResponse
);
resultResponse
.
set
反馈
ID
(
501113
);
return
commonResponse
;
resultResponse
.
set
反馈文本
(
"【旁白@正常】微信号格式不对哦。"
);
}
resultResponse
.
set
后台附加返回
(
"请说明留言内容"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
}
//qq格式不对
if
(
result
==
2
)
{
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
501114
);
resultResponse
.
set
反馈文本
(
"【旁白@正常】QQ号格式不对哦。"
);
resultResponse
.
set
后台附加返回
(
"请说明留言内容"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
//手机号码格式不对
if
(
result
==
3
)
{
commonResponse
.
setCode
(
1
);
commonResponse
.
setMsg
(
"成功"
);
resultResponse
.
set
反馈
ID
(
501115
);
resultResponse
.
set
反馈文本
(
"【旁白@正常】手机号码格式不对哦。"
);
resultResponse
.
set
后台附加返回
(
"请说明留言内容"
);
resultVarsResponse
.
setVars
(
resultResponse
);
commonResponse
.
setData
(
resultVarsResponse
);
return
commonResponse
;
}
message
=
TypeConvertUtil
.
contextChange
(
message
);
//留言内容包含敏感词汇,判定失败
// List<String> sensitiveWordList = PersistenceUtil.getContentFromFile("sensitiveWords.xls");
// for (String sensitive : sensitiveWordList) {
// if (message.contains(sensitive)) {
// log.info(uid + "的留言内容包含敏感词汇:" + sensitive);
// //保存玩家这轮的请求信息,用于下一步操作
// operationReq.setAddress(address);
// operationReq.setMessage(null);
// operationReq.setOperationLabel(Constants.LEAVE_MESSAGE);
// CacheUtil.put(uid, operationReq, Long.parseLong(expireTime));
// //获取对应话术
// String text = SpeechUtil.getSocialSpeech(Constants.SPEECH_ASIDE, "leave_message_fail_sensitive_words");
// commonResponse.setCode(1);
// commonResponse.setMsg("成功");
// resultResponse.set反馈ID(501105);
// resultResponse.set反馈文本(text);
// resultResponse.set后台附加返回("请说明留言内容");
// resultVarsResponse.setVars(resultResponse);
// commonResponse.setData(resultVarsResponse);
// return commonResponse;
// }
// }
//获取对应话术
//获取对应话术
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_double_check"
);
String
text
=
SpeechUtil
.
getSocialSpeech
(
Constants
.
SPEECH_ASIDE
,
"leave_message_double_check"
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
message
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
message
);
...
...
src/main/java/com/qiwuai/garden/service/taskService/impl/TaskServiceImpl.java
View file @
9855819a
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.pojo.TaskTypePojo;
...
@@ -17,6 +17,7 @@ import com.qiwuai.garden.pojo.TaskTypePojo;
import
com.qiwuai.garden.service.taskService.TaskService
;
import
com.qiwuai.garden.service.taskService.TaskService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -29,7 +30,8 @@ import java.util.stream.Collectors;
...
@@ -29,7 +30,8 @@ import java.util.stream.Collectors;
public
class
TaskServiceImpl
implements
TaskService
{
public
class
TaskServiceImpl
implements
TaskService
{
Logger
log
=
LoggerFactory
.
getLogger
(
TaskServiceImpl
.
class
);
Logger
log
=
LoggerFactory
.
getLogger
(
TaskServiceImpl
.
class
);
//从yml配置文件中取出对话过期时间
//从yml配置文件中取出对话过期时间
String
expireTime
=
YamlUtil
.
getValueByKey
(
"expireTime"
);
@Value
(
"${expireTime}"
)
private
String
expireTime
;
@Override
@Override
public
CommonResponse
checkTask
(
OperationRequest
operationReq
)
{
public
CommonResponse
checkTask
(
OperationRequest
operationReq
)
{
...
...
src/main/resources/application-crazyPro.yml
View file @
9855819a
...
@@ -12,7 +12,7 @@ spring:
...
@@ -12,7 +12,7 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://localhost:3306/crazy_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
url
:
jdbc:mysql://localhost:3306/crazy_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username
:
root
username
:
root
password
:
38A0O1jEPOE
password
:
R91jKARPj23dtqZ4wfc2F
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
druid
:
initial-size
:
5
initial-size
:
5
...
@@ -53,15 +53,15 @@ expireTime: 180000
...
@@ -53,15 +53,15 @@ expireTime: 180000
#玩家无操作时长,默认下线
#玩家无操作时长,默认下线
offlineTime
:
180000
offlineTime
:
180000
userFilePath
:
/home/crazyGarden/crazyGardenUser/
userFilePath
:
/home/
jiaoyou/projects/
crazyGarden/crazyGardenUser/
speechFilePath
:
/home/crazyGarden/crazyGardenSpeech/
speechFilePath
:
/home/
jiaoyou/projects/
crazyGarden/crazyGardenSpeech/
configFilePath
:
/home/crazyGarden/config/
configFilePath
:
/home/
jiaoyou/projects/
crazyGarden/config/
messageFilePath
:
/home/crazyGarden/message/
messageFilePath
:
/home/
jiaoyou/projects/
crazyGarden/message/
reportFilePath
:
/home/crazyGarden/report/
reportFilePath
:
/home/
jiaoyou/projects/
crazyGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
Wl4zX6mEAjK5uT2M
appSecret
:
Wl4zX6mEAjK5uT2M
...
...
src/main/resources/application-crazyUat.yml
View file @
9855819a
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
#分享关系查看地址
#分享关系查看地址
shareRelationUrl
:
http
s://hw-gz26
.heyqiwu.cn/api/tongyong/
shareRelationUrl
:
http
://tx-gz10
.heyqiwu.cn/api/tongyong/
#分享链接通道
#分享链接通道
shareChannelId
:
zhuimenggarden-server-test
shareChannelId
:
zhuimenggarden-server-test
#分享链接秘钥
#分享链接秘钥
...
...
src/main/resources/application-dev.yml
View file @
9855819a
...
@@ -53,15 +53,15 @@ expireTime: 180000
...
@@ -53,15 +53,15 @@ expireTime: 180000
#玩家无操作时长,默认下线
#玩家无操作时长,默认下线
offlineTime
:
180000
offlineTime
:
180000
userFilePath
:
/home/secretGarden/secretGardenUser/
userFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenUser/
speechFilePath
:
/home/secretGarden/secretGardenSpeech/
speechFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenSpeech/
configFilePath
:
/home/secretGarden/config/
configFilePath
:
/home/
jiaoyou/projects/
secretGarden/config/
messageFilePath
:
/home/secretGarden/message/
messageFilePath
:
/home/
jiaoyou/projects/
secretGarden/message/
reportFilePath
:
/home/secretGarden/report/
reportFilePath
:
/home/
jiaoyou/projects/
secretGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
nnPGsrbMriXdrRNISQeb
appSecret
:
nnPGsrbMriXdrRNISQeb
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
#分享关系查看地址
#分享关系查看地址
shareRelationUrl
:
http
s://hw-gz26
.heyqiwu.cn/api/tongyong/
shareRelationUrl
:
http
://tx-gz10
.heyqiwu.cn/api/tongyong/
#分享链接通道
#分享链接通道
shareChannelId
:
zhuimenggarden-server-test
shareChannelId
:
zhuimenggarden-server-test
#分享链接秘钥
#分享链接秘钥
...
...
src/main/resources/application-pro.yml
View file @
9855819a
...
@@ -12,7 +12,7 @@ spring:
...
@@ -12,7 +12,7 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
url
:
jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username
:
root
username
:
root
password
:
38A0O1jEPOE
password
:
R91jKARPj23dtqZ4wfc2F
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
druid
:
initial-size
:
5
initial-size
:
5
...
@@ -53,15 +53,15 @@ expireTime: 180000
...
@@ -53,15 +53,15 @@ expireTime: 180000
#玩家无操作时长,默认下线
#玩家无操作时长,默认下线
offlineTime
:
180000
offlineTime
:
180000
userFilePath
:
/home/secretGarden/secretGardenUser/
userFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenUser/
speechFilePath
:
/home/secretGarden/secretGardenSpeech/
speechFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenSpeech/
configFilePath
:
/home/secretGarden/config/
configFilePath
:
/home/
jiaoyou/projects/
secretGarden/config/
messageFilePath
:
/home/secretGarden/message/
messageFilePath
:
/home/
jiaoyou/projects/
secretGarden/message/
reportFilePath
:
/home/secretGarden/report/
reportFilePath
:
/home/
jiaoyou/projects/
secretGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
Wl4zX6mEAjK5uT2M
appSecret
:
Wl4zX6mEAjK5uT2M
...
...
src/main/resources/application-uat.yml
View file @
9855819a
...
@@ -12,7 +12,7 @@ spring:
...
@@ -12,7 +12,7 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
url
:
jdbc:mysql://localhost:3306/secret_garden?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username
:
root
username
:
root
password
:
38A0O1jEPOE
password
:
dgKNTmt2iLHNjEQajkDEZkq8
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
druid
:
initial-size
:
5
initial-size
:
5
...
@@ -53,15 +53,15 @@ expireTime: 180000
...
@@ -53,15 +53,15 @@ expireTime: 180000
#玩家无操作时长,默认下线
#玩家无操作时长,默认下线
offlineTime
:
180000
offlineTime
:
180000
userFilePath
:
/home/secretGarden/secretGardenUser/
userFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenUser/
speechFilePath
:
/home/secretGarden/secretGardenSpeech/
speechFilePath
:
/home/
jiaoyou/projects/
secretGarden/secretGardenSpeech/
configFilePath
:
/home/secretGarden/config/
configFilePath
:
/home/
jiaoyou/projects/
secretGarden/config/
messageFilePath
:
/home/secretGarden/message/
messageFilePath
:
/home/
jiaoyou/projects/
secretGarden/message/
reportFilePath
:
/home/secretGarden/report/
reportFilePath
:
/home/
jiaoyou/projects/
secretGarden/report/
#动态词组更新秘钥
#动态词组更新秘钥
appSecret
:
nnPGsrbMriXdrRNISQeb
appSecret
:
nnPGsrbMriXdrRNISQeb
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
...
@@ -69,7 +69,7 @@ appSecret: nnPGsrbMriXdrRNISQeb
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
updatePhraseUrl
:
http://hw-gz24.heyqiwu.cn:8082/out/phrase
#分享关系查看地址
#分享关系查看地址
shareRelationUrl
:
http
s://hw-gz26
.heyqiwu.cn/api/tongyong/
shareRelationUrl
:
http
://tx-gz10
.heyqiwu.cn/api/tongyong/
#分享链接通道
#分享链接通道
shareChannelId
:
zhuimenggarden-server-test
shareChannelId
:
zhuimenggarden-server-test
#分享链接秘钥
#分享链接秘钥
...
...
src/main/resources/log4j2.xml
View file @
9855819a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<Configuration
status=
"fatal"
>
<Configuration
status=
"fatal"
>
<!--打印在本地,根据具体存储地址填写-->
<!--打印在本地,根据具体存储地址填写-->
<Properties>
<Properties>
<Property
name=
"baseDir"
value=
"/home/secretGarden/logs"
/>
<Property
name=
"baseDir"
value=
"/home/
jiaoyou/projects/
secretGarden/logs"
/>
</Properties>
</Properties>
<Appenders>
<Appenders>
...
...
src/main/resources/speech/ranking.yaml
View file @
9855819a
...
@@ -39,6 +39,8 @@ aside:
...
@@ -39,6 +39,8 @@ aside:
check_region_friendship_ranking
:
check_region_friendship_ranking
:
-
【旁白@正常】第【1】名是【2】,共帮助好友收获植物【3】次
-
【旁白@正常】第【1】名是【2】,共帮助好友收获植物【3】次
#查看本人排名
#查看本人排名
check_self_no_ranking
:
-
【旁白@正常】榜单每天刷新一次,你当前还没有进行排名。
check_self_rich_ranking
:
check_self_rich_ranking
:
-
【旁白@正常】你在富豪榜上排名为第【1】名。
-
【旁白@正常】你在富豪榜上排名为第【1】名。
check_self_fight_ranking
:
check_self_fight_ranking
:
...
@@ -56,6 +58,8 @@ aside:
...
@@ -56,6 +58,8 @@ aside:
check_self_local_ranking
:
check_self_local_ranking
:
-
【旁白@正常】你在本地区的富豪榜上排名为第【1】名。你在战斗榜上排名为第【2】名。你在友情榜上排名为第【3】名。
-
【旁白@正常】你在本地区的富豪榜上排名为第【1】名。你在战斗榜上排名为第【2】名。你在友情榜上排名为第【3】名。
#查看玩家排名
#查看玩家排名
check_player_no_ranking
:
-
【旁白@正常】榜单每天刷新一次,玩家【1】还未进行排名。
check_player_rich_ranking
:
check_player_rich_ranking
:
-
【旁白@正常】玩家【1】在富豪榜上排名为第【2】名。
-
【旁白@正常】玩家【1】在富豪榜上排名为第【2】名。
check_player_fight_ranking
:
check_player_fight_ranking
:
...
...
src/main/resources/speech/social.yaml
View file @
9855819a
...
@@ -178,6 +178,8 @@ aside:
...
@@ -178,6 +178,8 @@ aside:
address_self_check
:
address_self_check
:
-
【旁白@正常】你的地址为【1】。
-
【旁白@正常】你的地址为【1】。
#好友留言
#好友留言
leave_message_check_context
:
-
【旁白@正常】目前的留言功能尚未开放,您可以先给好友留下联系方式以便联系,暂且支持微信、QQ或者手机号码哦。请按以下方式说出要留言的内容:微信+微信号、QQ+QQ号、或者手机号码+手机号。如微信zhanghao123。
leave_message_check
:
leave_message_check
:
-
【旁白@正常】好的,请留下你要留言的内容。
-
【旁白@正常】好的,请留下你要留言的内容。
leave_message_double_check
:
leave_message_double_check
:
...
...
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