Skip to content

Commit

Permalink
🐛 #1438 修复模板消息行业设置类无法解析类似"互联网|电子商务"形式数据的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Jc826 authored Mar 12, 2020
1 parent 9b32271 commit 341f176
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 341f176

Please sign in to comment.