🎨 #1233 公众号模板消息设置行业信息接口优化,增加枚举类 WxMpTemplateIndustryEnum 方便使用

This commit is contained in:
Binary Wang
2019-10-18 17:27:24 +08:00
parent 48586de7d9
commit 159347eb9b
6 changed files with 267 additions and 57 deletions

View File

@@ -24,7 +24,9 @@ public interface WxMpTemplateMsgService {
* 详情请见http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN
* </pre>
*
* @param wxMpIndustry 行业信息
* @return 是否成功
* @throws WxErrorException .
*/
boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException;
@@ -35,6 +37,7 @@ public interface WxMpTemplateMsgService {
* </pre>
*
* @return wxMpIndustry
* @throws WxErrorException .
*/
WxMpTemplateIndustry getIndustry() throws WxErrorException;
@@ -44,7 +47,9 @@ public interface WxMpTemplateMsgService {
* 详情请见: http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN
* </pre>
*
* @param templateMessage 模板消息
* @return 消息Id
* @throws WxErrorException .
*/
String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException;
@@ -58,6 +63,7 @@ public interface WxMpTemplateMsgService {
*
* @param shortTemplateId 模板库中模板的编号有“TM**”和“OPENTMTM**”等形式
* @return templateId 模板Id
* @throws WxErrorException .
*/
String addTemplate(String shortTemplateId) throws WxErrorException;
@@ -70,6 +76,7 @@ public interface WxMpTemplateMsgService {
* </pre>
*
* @return templateId 模板Id
* @throws WxErrorException .
*/
List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException;
@@ -82,6 +89,8 @@ public interface WxMpTemplateMsgService {
* </pre>
*
* @param templateId 模板Id
* @return .
* @throws WxErrorException .
*/
boolean delPrivateTemplate(String templateId) throws WxErrorException;
}

View File

@@ -42,8 +42,8 @@ public class WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService {
@Override
public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException {
if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId()
|| null == wxMpIndustry.getSecondIndustry() || null == wxMpIndustry.getSecondIndustry().getId()) {
if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getCode()
|| null == wxMpIndustry.getSecondIndustry() || null == wxMpIndustry.getSecondIndustry().getCode()) {
throw new IllegalArgumentException("行业Id不能为空请核实");
}