diff --git a/src/main/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApi.java b/src/main/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApi.java index 476a6cd6ed6c30987a984de304d1e293d5de865c..d97206c63c4f5521edeaeb4af75b64deeccb7a47 100644 --- a/src/main/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApi.java +++ b/src/main/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApi.java @@ -129,7 +129,7 @@ public class WxaSubscribeMsgApi { return new ApiResult(jsonResult); } - public class SubTemplateItem extends HashMap { + public static class SubTemplateItem extends HashMap { private static final long serialVersionUID = -3728490424738325020L; public SubTemplateItem() { @@ -140,7 +140,7 @@ public class WxaSubscribeMsgApi { } } - public class Item { + public static class Item { private Object value; public Object getValue() { diff --git a/src/test/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApiTest.java b/src/test/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApiTest.java index d202490ae584c49bd15768f3bfabd810de931c47..ad3b5951814fb4f9c90aca6fb787ead39d3bb9d6 100644 --- a/src/test/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApiTest.java +++ b/src/test/java/com/jfinal/wxaapp/api/WxaSubscribeMsgApiTest.java @@ -32,12 +32,11 @@ public class WxaSubscribeMsgApiTest { System.out.println(templateKeyWords); - WxaSubscribeMsgApi wxaSubscribeMsgApi = new WxaSubscribeMsgApi(); - WxaSubscribeMsgApi.SubTemplateItem subTemplateItem = wxaSubscribeMsgApi.new SubTemplateItem(); - subTemplateItem.put("phrase3", wxaSubscribeMsgApi.new Item("允许参与")); - subTemplateItem.put("thing4", wxaSubscribeMsgApi.new Item("IJPay 线下聚会")); - subTemplateItem.put("date5", wxaSubscribeMsgApi.new Item("2020-02-02 14:30")); - subTemplateItem.put("thing6", wxaSubscribeMsgApi.new Item("深圳")); + WxaSubscribeMsgApi.SubTemplateItem subTemplateItem = new WxaSubscribeMsgApi.SubTemplateItem(); + subTemplateItem.put("phrase3", new WxaSubscribeMsgApi.Item("允许参与")); + subTemplateItem.put("thing4", new WxaSubscribeMsgApi.Item("IJPay 线下聚会")); + subTemplateItem.put("date5", new WxaSubscribeMsgApi.Item("2020-02-02 14:30")); + subTemplateItem.put("thing6", new WxaSubscribeMsgApi.Item("深圳")); ApiResult send = WxaSubscribeMsgApi.send( "oUikW0Tmx9FYrSDc7SGMYqWJMClo",