From 9b1336f40828f1a5ab1b5e5fd4bfb057f3c59a1e Mon Sep 17 00:00:00 2001 From: heqijun Date: Sun, 8 Jun 2025 18:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96cacheclient+=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=AD=96=E7=95=A5=E6=A8=A1=E5=9D=97=E5=8F=91=E9=80=81?= =?UTF-8?q?=E3=80=90=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=BD=92=E5=B1=9E=E5=9C=B0?= =?UTF-8?q?=E5=92=8C=E8=BF=90=E8=90=A5=E5=95=86=E3=80=91=E5=88=B0=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E7=9A=84=E9=98=9F?= =?UTF-8?q?=E5=88=97+=E4=BC=98=E5=8C=96=E7=AD=96=E7=95=A5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8F=B7=E6=AE=B5=E8=A1=A5=E5=85=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cache/controller/CacheController.java | 6 +++ .../common/clients/BeaconCacheClient.java | 3 ++ .../common/constant/CacheConstant.java | 3 ++ .../strategy/config/RabbitMQConfig.java | 26 +++++++++++ .../config/RabbitMQTemplateConfig.java | 43 +++++++++++++++++++ .../impl/PhaseStrategyFilter.java | 15 +++++-- .../test/feignClient/BeaconCacheClient.java | 40 ----------------- .../test/feignClient/CacheClient.java | 19 ++++++++ .../test/mapper/MobileDirtywordMapper.java | 19 ++++++++ .../test/mapper/ClientBalanceMapperTest.java | 8 ++-- .../test/mapper/ClientBusinessMapperTest.java | 6 +-- .../test/mapper/ClientSignMapperTest.java | 9 ++-- .../test/mapper/ClientTemplateMapperTest.java | 8 ++-- .../test/mapper/MobileAreaMapperTest.java | 8 ++-- .../mapper/MobileDirtywordMapperTest.java | 34 +++++++++++++++ 15 files changed, 179 insertions(+), 68 deletions(-) create mode 100644 beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQConfig.java create mode 100644 beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQTemplateConfig.java delete mode 100644 beacon-test/src/main/java/com/mashibing/test/feignClient/BeaconCacheClient.java create mode 100644 beacon-test/src/main/java/com/mashibing/test/feignClient/CacheClient.java create mode 100644 beacon-test/src/main/java/com/mashibing/test/mapper/MobileDirtywordMapper.java create mode 100644 beacon-test/src/test/java/com/mashibing/test/mapper/MobileDirtywordMapperTest.java diff --git a/beacon-cache/src/main/java/com/mashibing/cache/controller/CacheController.java b/beacon-cache/src/main/java/com/mashibing/cache/controller/CacheController.java index 00ea1e7..7ff26b5 100644 --- a/beacon-cache/src/main/java/com/mashibing/cache/controller/CacheController.java +++ b/beacon-cache/src/main/java/com/mashibing/cache/controller/CacheController.java @@ -70,6 +70,12 @@ public class CacheController { redisClient.sAdd(key, value); } + @PostMapping("/saddstr/{key}") + public void saddStr(@PathVariable(value = "key") String key, @RequestBody String... value) { + log.info("【缓存模块】saddStr: key = {},\nvalue = {}", key, value); + redisClient.sAdd(key, value); + } + @PostMapping("/smember/{key}") public Set smember(@PathVariable(value = "key") String key) { log.info("【缓存模块】smember: key = {},", key); diff --git a/beacon-common/src/main/java/com/mashibing/common/clients/BeaconCacheClient.java b/beacon-common/src/main/java/com/mashibing/common/clients/BeaconCacheClient.java index 734cc1c..81d7a9a 100644 --- a/beacon-common/src/main/java/com/mashibing/common/clients/BeaconCacheClient.java +++ b/beacon-common/src/main/java/com/mashibing/common/clients/BeaconCacheClient.java @@ -39,6 +39,9 @@ public interface BeaconCacheClient { @PostMapping("cache/sadd/{key}") void sadd(@PathVariable(value = "key") String key, @RequestBody Map... value); + @PostMapping("cache/saddstr/{key}") + void saddStr(@PathVariable(value = "key") String key, @RequestBody String... value); + @PostMapping("cache/smember/{key}") Set smember(@PathVariable(value = "key") String key); diff --git a/beacon-common/src/main/java/com/mashibing/common/constant/CacheConstant.java b/beacon-common/src/main/java/com/mashibing/common/constant/CacheConstant.java index 11ed65a..e93676c 100644 --- a/beacon-common/src/main/java/com/mashibing/common/constant/CacheConstant.java +++ b/beacon-common/src/main/java/com/mashibing/common/constant/CacheConstant.java @@ -28,4 +28,7 @@ public class CacheConstant { @Description("号段前缀") public static final String PHASE = "phase:"; + + @Description("敏感词key") + public static final String DIRTY_WORD = "dirty_word"; } diff --git a/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQConfig.java b/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQConfig.java new file mode 100644 index 0000000..898c368 --- /dev/null +++ b/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQConfig.java @@ -0,0 +1,26 @@ +package com.mashibing.strategy.config; + +import com.mashibing.common.constant.RabbitMQConstant; +import org.springframework.amqp.core.Queue; +import org.springframework.amqp.core.QueueBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author heqijun + * @ClassName: RabbitMQConfig + * @Description: RabbitMQConfig + * @date 2025/6/8 17:46 + */ + +@Configuration +public class RabbitMQConfig { + + /** + * 构建策略模块发送【手机号归属地和运营商】到后台管理模块的队列名称 + */ + @Bean + public Queue preSendQueue() { + return QueueBuilder.durable(RabbitMQConstant.MOBILE_AREA_OPERATOR).build(); + } +} diff --git a/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQTemplateConfig.java b/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQTemplateConfig.java new file mode 100644 index 0000000..44f96e4 --- /dev/null +++ b/beacon-strategy/src/main/java/com/mashibing/strategy/config/RabbitMQTemplateConfig.java @@ -0,0 +1,43 @@ +package com.mashibing.strategy.config; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.core.Message; +import org.springframework.amqp.rabbit.connection.ConnectionFactory; +import org.springframework.amqp.rabbit.connection.CorrelationData; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author heqijun + * @ClassName: RabbitMQTemplateConfig + * @Description: 配置RabbitMQTemplate的confirm和return机制 + * @date 2025/6/8 17:52 + */ + +@Configuration +@Slf4j +public class RabbitMQTemplateConfig { + + @Bean + public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) { + + //设置connectionFactory + RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory); + + //配置confirm机制回调 + rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> { + //消息妹有发送到交换机 + if (!ack) { + log.error("【策略模块-发送消息】消息没有发送到交换机。。。" + + "\n correlationData={},ack={},cause:{} ", correlationData, ack, cause); + } + }); + + //配置return机制回调 + rabbitTemplate.setReturnCallback((message, replyCode, replyText, exchange, routingKey) -> log.error("【策略模块-发送消息】消息没有路由到指定的队列。。。" + + "\nmessage={},exchange={},routingKey={}", new String(message.getBody()), exchange, routingKey)); + + return rabbitTemplate; + } +} diff --git a/beacon-strategy/src/main/java/com/mashibing/strategy/service/strategyfilter/impl/PhaseStrategyFilter.java b/beacon-strategy/src/main/java/com/mashibing/strategy/service/strategyfilter/impl/PhaseStrategyFilter.java index f586271..e5a6624 100644 --- a/beacon-strategy/src/main/java/com/mashibing/strategy/service/strategyfilter/impl/PhaseStrategyFilter.java +++ b/beacon-strategy/src/main/java/com/mashibing/strategy/service/strategyfilter/impl/PhaseStrategyFilter.java @@ -1,6 +1,7 @@ package com.mashibing.strategy.service.strategyfilter.impl; import com.mashibing.common.constant.CacheConstant; +import com.mashibing.common.constant.RabbitMQConstant; import com.mashibing.common.pojo.StandardSubmit; import com.mashibing.strategy.feignclient.CacheClient; import com.mashibing.strategy.pojo.PhasePojo; @@ -8,6 +9,7 @@ import com.mashibing.strategy.service.strategyfilter.StrategyFilter; import com.mashibing.strategy.utils.PhaseUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; @@ -29,10 +31,13 @@ public class PhaseStrategyFilter implements StrategyFilter { @Autowired private RestTemplate restTemplate; + @Autowired + RabbitTemplate rabbitTemplate; + @Override - public void strategy(StandardSubmit standardSubmit) { + public void strategy(StandardSubmit submit) { log.info("【策略模块-号段补全】开始==============================="); - String mobile7 = standardSubmit.getMobile().substring(0, 7); + String mobile7 = submit.getMobile().substring(0, 7); //缓存中查询号段。如果查询不到,则在三方接口中查询 String s = cacheClient.get(CacheConstant.PHASE + mobile7); PhasePojo phasePojo = new PhasePojo(); @@ -40,6 +45,8 @@ public class PhaseStrategyFilter implements StrategyFilter { log.info("【策略模块-号段补全】缓存中未查询到信息,需要三方查询。。。"); phasePojo = PhaseUtil.phaseMobile360(restTemplate, mobile7); log.info("【策略模块-号段补全】三方查询结果:{}", phasePojo); + //三方查到之后,发送消息到后台管理模块 + rabbitTemplate.convertAndSend(RabbitMQConstant.MOBILE_AREA_OPERATOR, submit.getMobile()); } else { log.info("【策略模块-号段补全】缓存中查询到信息:{}", s); String[] split = s.split(","); @@ -47,8 +54,8 @@ public class PhaseStrategyFilter implements StrategyFilter { phasePojo.setOperatorNa(split[1]); } //查询到号段之后,补全standardSubmit中运营商信息 - standardSubmit.setArea(phasePojo.getArea()); - standardSubmit.setOperatorId(PhaseUtil.getOperatorId(phasePojo.getOperatorNa())); + submit.setArea(phasePojo.getArea()); + submit.setOperatorId(PhaseUtil.getOperatorId(phasePojo.getOperatorNa())); log.info("【策略模块-号段补全】结束==============================="); } } diff --git a/beacon-test/src/main/java/com/mashibing/test/feignClient/BeaconCacheClient.java b/beacon-test/src/main/java/com/mashibing/test/feignClient/BeaconCacheClient.java deleted file mode 100644 index 8e784c7..0000000 --- a/beacon-test/src/main/java/com/mashibing/test/feignClient/BeaconCacheClient.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.mashibing.test.feignClient; - -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.*; - -import java.util.Map; - -/** - * @author heqijun - * @ClassName: BeaconCacheClient - * @Description: 缓存模块openFeignClient接口 - * @date 2025/6/5 20:13 - */ - -@FeignClient("beacon-cache") -@RequestMapping("cache") -public interface BeaconCacheClient { - @GetMapping("get/{key}") - String get(@PathVariable String key); - - @GetMapping("set/{key}/{value}") - void set(@PathVariable String key, @PathVariable String value); - - @GetMapping("hget/{key}") - Map hget(@PathVariable String key); - - @PostMapping("hset/{key}") - void hset(@PathVariable String key, @RequestBody Map hash); - - @PostMapping("/sadd/{key}") - void sadd(@PathVariable(value = "key") String key, @RequestBody Map... maps); - - /** - * 大批量写入String数据 - * - * @param map key是key,value是value - */ - @PostMapping("/pipeline/string") - void pipelineString(@RequestBody Map map); -} diff --git a/beacon-test/src/main/java/com/mashibing/test/feignClient/CacheClient.java b/beacon-test/src/main/java/com/mashibing/test/feignClient/CacheClient.java new file mode 100644 index 0000000..112b793 --- /dev/null +++ b/beacon-test/src/main/java/com/mashibing/test/feignClient/CacheClient.java @@ -0,0 +1,19 @@ +package com.mashibing.test.feignClient; + +import com.mashibing.common.clients.BeaconCacheClient; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @author heqijun + * @ClassName: BeaconCacheClient + * @Description: 缓存模块openFeignClient接口 + * @date 2025/6/5 20:13 + */ + +@FeignClient("beacon-cache") +public interface CacheClient extends BeaconCacheClient { + +} diff --git a/beacon-test/src/main/java/com/mashibing/test/mapper/MobileDirtywordMapper.java b/beacon-test/src/main/java/com/mashibing/test/mapper/MobileDirtywordMapper.java new file mode 100644 index 0000000..8c269ef --- /dev/null +++ b/beacon-test/src/main/java/com/mashibing/test/mapper/MobileDirtywordMapper.java @@ -0,0 +1,19 @@ +package com.mashibing.test.mapper; + +import com.mashibing.test.entity.MobileArea; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * @author heqijun + * @ClassName: MobileAreaMapper + * @Description: TODO(这里用一句话描述这个类的作用) + * @date 2025/6/8 14:47 + */ + +public interface MobileDirtywordMapper { + + @Select("select dirtyword from mobile_dirtyword") + List findAllDirtyword(); +} diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java index 52dbb8d..9e5dd7f 100644 --- a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBalanceMapperTest.java @@ -3,7 +3,7 @@ package com.mashibing.test.mapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.mashibing.test.entity.ClientBalance; -import com.mashibing.test.feignClient.BeaconCacheClient; +import com.mashibing.test.feignClient.CacheClient; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -12,14 +12,12 @@ import org.springframework.test.context.junit4.SpringRunner; import java.util.Map; -import static org.junit.jupiter.api.Assertions.*; - @SpringBootTest @RunWith(SpringRunner.class) class ClientBalanceMapperTest { @Autowired - BeaconCacheClient beaconCacheClient; + CacheClient cacheClient; @Autowired ClientBalanceMapper clientBalanceMapper; @@ -30,6 +28,6 @@ class ClientBalanceMapperTest { System.out.println("balance = " + balance); ObjectMapper objectMapper = new ObjectMapper(); Map map = objectMapper.readValue(objectMapper.writeValueAsString(balance), Map.class); - beaconCacheClient.hset("client_balance:1", map); + cacheClient.hset("client_balance:1", map); } } \ No newline at end of file diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBusinessMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBusinessMapperTest.java index e5fd5c3..fa30f6a 100644 --- a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBusinessMapperTest.java +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientBusinessMapperTest.java @@ -3,7 +3,7 @@ package com.mashibing.test.mapper; import com.fasterxml.jackson.databind.ObjectMapper; import com.mashibing.test.entity.ClientBusiness; -import com.mashibing.test.feignClient.BeaconCacheClient; +import com.mashibing.test.feignClient.CacheClient; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +20,7 @@ class ClientBusinessMapperTest { private ClientBusinessMapper mapper; @Autowired - BeaconCacheClient beaconCacheClient; + CacheClient cacheClient; @Test public void findById() { @@ -29,6 +29,6 @@ class ClientBusinessMapperTest { cb.setClientFilters("phase," + cb.getClientFilters()); System.out.println(cb); ObjectMapper mapper = new ObjectMapper(); - beaconCacheClient.hset("client_business:" + cb.getApikey(), mapper.convertValue(cb, Map.class)); + cacheClient.hset("client_business:" + cb.getApikey(), mapper.convertValue(cb, Map.class)); } } \ No newline at end of file diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientSignMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientSignMapperTest.java index 3d814ec..39427cf 100644 --- a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientSignMapperTest.java +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientSignMapperTest.java @@ -2,20 +2,17 @@ package com.mashibing.test.mapper; import com.fasterxml.jackson.databind.ObjectMapper; import com.mashibing.test.entity.ClientSign; -import com.mashibing.test.feignClient.BeaconCacheClient; +import com.mashibing.test.feignClient.CacheClient; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.*; - @SpringBootTest @RunWith(SpringRunner.class) class ClientSignMapperTest { @@ -24,7 +21,7 @@ class ClientSignMapperTest { private ClientSignMapper mapper; @Autowired - BeaconCacheClient beaconCacheClient; + CacheClient cacheClient; @Test void findAllByClientId() { @@ -36,6 +33,6 @@ class ClientSignMapperTest { .map(clientSign -> mapper.convertValue(clientSign, Map.class)) .collect(Collectors.toList()); - beaconCacheClient.sadd("client_sign:1", maps.toArray(new Map[]{})); + cacheClient.sadd("client_sign:1", maps.toArray(new Map[]{})); } } \ No newline at end of file diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientTemplateMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientTemplateMapperTest.java index 253b37b..90ed635 100644 --- a/beacon-test/src/test/java/com/mashibing/test/mapper/ClientTemplateMapperTest.java +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/ClientTemplateMapperTest.java @@ -2,7 +2,7 @@ package com.mashibing.test.mapper; import com.fasterxml.jackson.databind.ObjectMapper; import com.mashibing.test.entity.ClientTemplate; -import com.mashibing.test.feignClient.BeaconCacheClient; +import com.mashibing.test.feignClient.CacheClient; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -13,14 +13,12 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.*; - @SpringBootTest @RunWith(SpringRunner.class) class ClientTemplateMapperTest { @Autowired - BeaconCacheClient beaconCacheClient; + CacheClient cacheClient; @Autowired ClientTemplateMapper clientTemplateMapper; @@ -36,6 +34,6 @@ class ClientTemplateMapperTest { .stream() .map(clientTemplate -> mapper.convertValue(clientTemplate, Map.class)) .collect(Collectors.toList()); - beaconCacheClient.sadd("client_template:15", maps.toArray(new Map[]{})); + cacheClient.sadd("client_template:15", maps.toArray(new Map[]{})); } } \ No newline at end of file diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/MobileAreaMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/MobileAreaMapperTest.java index 7b2d510..d3e1a54 100644 --- a/beacon-test/src/test/java/com/mashibing/test/mapper/MobileAreaMapperTest.java +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/MobileAreaMapperTest.java @@ -1,7 +1,7 @@ package com.mashibing.test.mapper; import com.mashibing.test.entity.MobileArea; -import com.mashibing.test.feignClient.BeaconCacheClient; +import com.mashibing.test.feignClient.CacheClient; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; @@ -13,14 +13,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.junit.jupiter.api.Assertions.*; - @Slf4j @SpringBootTest @RunWith(SpringRunner.class) class MobileAreaMapperTest { @Autowired - BeaconCacheClient beaconCacheClient; + CacheClient cacheClient; @Autowired MobileAreaMapper mapper; @@ -40,7 +38,7 @@ class MobileAreaMapperTest { endTime = System.currentTimeMillis(); log.info("【List转Map耗时】: {} ms", endTime - startTime); startTime = System.currentTimeMillis(); - beaconCacheClient.pipelineString(map); + cacheClient.pipelineString(map); endTime = System.currentTimeMillis(); log.info("【写入Redis耗时】: {} ms", endTime - startTime); } diff --git a/beacon-test/src/test/java/com/mashibing/test/mapper/MobileDirtywordMapperTest.java b/beacon-test/src/test/java/com/mashibing/test/mapper/MobileDirtywordMapperTest.java new file mode 100644 index 0000000..d2ce2e1 --- /dev/null +++ b/beacon-test/src/test/java/com/mashibing/test/mapper/MobileDirtywordMapperTest.java @@ -0,0 +1,34 @@ +package com.mashibing.test.mapper; + +import com.mashibing.common.constant.CacheConstant; +import com.mashibing.test.feignClient.CacheClient; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@Slf4j +@SpringBootTest +@RunWith(SpringRunner.class) +class MobileDirtywordMapperTest { + + @Autowired + CacheClient cacheClient; + + @Autowired + MobileDirtywordMapper mapper; + + @Test + void findAllDirtyword() { + + List dirtywords = mapper.findAllDirtyword(); + cacheClient.saddStr(CacheConstant.DIRTY_WORD, dirtywords.toArray(new String[]{})); + } +} \ No newline at end of file