From fd5304f8df33c77f9dfbad17856da074b3205dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E6=88=90?= Date: Wed, 11 Mar 2020 18:08:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=20=E8=A7=A3=E5=86=B3=20=E4=BA=92?= =?UTF-8?q?=E8=81=94=E7=BD=91|=E7=94=B5=E5=AD=90=E5=95=86=E5=8A=A1=20?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=A7=A3=E6=9E=90bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/mp/bean/template/WxMpTemplateIndustryEnum.java | 2 +- .../weixin/mp/bean/template/WxMpTemplateIndustryTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryEnum.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryEnum.java index 8a0a91371b..b3bfcba1be 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryEnum.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryEnum.java @@ -198,7 +198,7 @@ public enum WxMpTemplateIndustryEnum { */ public static WxMpTemplateIndustryEnum findBySecondary(String industry) { for (WxMpTemplateIndustryEnum industryEnum : WxMpTemplateIndustryEnum.values()) { - if (industryEnum.secondClass.equals(industry)) { + if (industryEnum.secondClass.contains(industry)) { return industryEnum; } } diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryTest.java index d5affa288b..eddcfd31bc 100644 --- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryTest.java +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateIndustryTest.java @@ -15,7 +15,7 @@ public class WxMpTemplateIndustryTest { @Test public void testFromJson() { - String json="{\"primary_industry\":{\"first_class\":\"IT科技\",\"second_class\":\"IT软件与服务\"},\"secondary_industry\":{\"first_class\":\"房地产\",\"second_class\":\"房地产|建筑\"}}"; + String json="{\"primary_industry\":{\"first_class\":\"IT科技\",\"second_class\":\"互联网|电子商务\"},\"secondary_industry\":{\"first_class\":\"房地产\",\"second_class\":\"房地产|建筑\"}}"; final WxMpTemplateIndustry industry = WxMpTemplateIndustry.fromJson(json); assertThat(industry).isNotNull(); System.out.println(industry);