mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 01:18:36 +08:00
🐛 修复几个问题
1.修复微信公众号无法模板消息行业:其他 2.修复第三方平台无法上传标准模板的代码到小程序 3.修复小程序代码模板类型类字段拼写错误
This commit is contained in:
@ -2,6 +2,9 @@ package me.chanjar.weixin.mp.bean.template;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 模版消息行业枚举.
|
||||
@ -195,15 +198,19 @@ public enum WxMpTemplateIndustryEnum {
|
||||
*
|
||||
* @param firstClass 主行业名称
|
||||
* @param secondClass 副行业名称
|
||||
* @return .
|
||||
* @return 如果找不到, 返回null
|
||||
*/
|
||||
@Nullable
|
||||
public static WxMpTemplateIndustryEnum findByClass(String firstClass, String secondClass) {
|
||||
for (WxMpTemplateIndustryEnum industryEnum : WxMpTemplateIndustryEnum.values()) {
|
||||
if (industryEnum.firstClass.equals(firstClass) && industryEnum.secondClass.contains(secondClass)) {
|
||||
return industryEnum;
|
||||
}
|
||||
}
|
||||
|
||||
if (Objects.equals(firstClass, "其他") && Objects.equals(secondClass, "其他")) {
|
||||
//微信返回的其他行业实际上为"其他",而非"其它",此处兼容处理
|
||||
return OTHER;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user