From cb2a8d369d905daa641502e117a068d4af2f2c3f Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 22 Dec 2015 09:59:49 +0800 Subject: [PATCH] 2.5.0-RELEASE --- .classpath | 12 +- .project | 4 +- .settings/org.eclipse.core.resources.prefs | 1 + .settings/org.eclipse.jdt.core.prefs | 280 ++++++++++++++++++ README.md | 8 +- changelog.txt | 10 + pom.xml | 16 +- .../java/weixin/popular/api/MaterialAPI.java | 6 +- .../java/weixin/popular/api/MediaAPI.java | 6 +- src/main/java/weixin/popular/api/MenuAPI.java | 55 +++- .../java/weixin/popular/api/MessageAPI.java | 16 +- src/main/java/weixin/popular/api/PayAPI.java | 2 +- .../java/weixin/popular/api/PayMchAPI.java | 134 ++++++++- .../java/weixin/popular/api/QrcodeAPI.java | 4 +- .../java/weixin/popular/api/ShorturlAPI.java | 2 +- src/main/java/weixin/popular/api/SnsAPI.java | 4 +- .../java/weixin/popular/api/TicketAPI.java | 2 +- .../java/weixin/popular/api/TokenAPI.java | 2 +- src/main/java/weixin/popular/api/UserAPI.java | 8 +- src/main/java/weixin/popular/bean/Menu.java | 16 - .../java/weixin/popular/bean/MenuButtons.java | 73 ----- .../MaterialBatchgetResultItemContent.java | 2 +- .../popular/bean/material/NewsItem.java | 2 +- .../popular/bean/{ => media}/Media.java | 4 +- .../popular/bean/{ => media}/MediaType.java | 2 +- .../bean/{ => media}/UploadimgResult.java | 4 +- .../java/weixin/popular/bean/menu/Button.java | 55 ++++ .../weixin/popular/bean/menu/Matchrule.java | 66 +++++ .../java/weixin/popular/bean/menu/Menu.java | 30 ++ .../weixin/popular/bean/menu/MenuButtons.java | 41 +++ .../popular/bean/menu/TrymatchResult.java | 18 ++ .../bean/{ => menu}/selfmenu/Button.java | 2 +- .../selfmenu/CurrentSelfmenuInfo.java | 2 +- .../bean/{ => menu}/selfmenu/News.java | 2 +- .../bean/{ => menu}/selfmenu/NewsInfo.java | 2 +- .../{ => menu}/selfmenu/SelfmenuInfo.java | 2 +- .../popular/bean/{ => message}/Article.java | 2 +- .../bean/{ => message}/EventMessage.java | 2 +- .../bean/{ => message}/MessageSendResult.java | 4 +- .../bean/{ => message}/Uploadvideo.java | 2 +- .../{ => message}/massmessage/Filter.java | 2 +- .../massmessage/MassImageMessage.java | 2 +- .../massmessage/MassMPnewsMessage.java | 2 +- .../massmessage/MassMPvideoMessage.java | 2 +- .../massmessage/MassMessage.java | 2 +- .../massmessage/MassMusicMessage.java | 2 +- .../massmessage/MassTextMessage.java | 2 +- .../massmessage/MassVideoMessage.java | 4 +- .../massmessage/MassVoiceMessage.java | 2 +- .../message/{ => message}/ImageMessage.java | 2 +- .../bean/message/{ => message}/Message.java | 2 +- .../message/{ => message}/MusicMessage.java | 2 +- .../message/{ => message}/NewsMessage.java | 2 +- .../message/{ => message}/TextMessage.java | 2 +- .../message/{ => message}/VideoMessage.java | 2 +- .../message/{ => message}/VoiceMessage.java | 2 +- .../templatemessage/TemplateMessage.java | 2 +- .../templatemessage/TemplateMessageItem.java | 2 +- .../TemplateMessageResult.java | 2 +- .../popular/bean/{ => pay}/Delivernotify.java | 2 +- .../popular/bean/paymch/MchPayNotify.java | 20 ++ .../bean/paymch/PapayContractbill.java | 121 ++++++++ .../bean/paymch/PapayContractbillResult.java | 22 ++ .../bean/paymch/PapayDeletecontract.java | 92 ++++++ .../paymch/PapayDeletecontractResult.java | 51 ++++ .../popular/bean/paymch/PapayEntrustweb.java | 179 +++++++++++ .../bean/paymch/PapayEntrustwebNotify.java | 101 +++++++ .../bean/paymch/PapayQuerycontract.java | 81 +++++ .../bean/paymch/PapayQuerycontractResult.java | 133 +++++++++ .../popular/bean/paymch/Pappayapply.java | 251 ++++++++++++++++ .../bean/paymch/PappayapplyNotify.java | 165 +++++++++++ .../bean/paymch/PappayapplyResult.java | 43 +++ .../bean/paymch/SendredpackResult.java | 6 +- .../bean/{ => qrcode}/QrcodeTicket.java | 10 +- .../popular/bean/{ => shorturl}/Shorturl.java | 4 +- .../popular/bean/{ => sns}/SnsToken.java | 18 +- .../popular/bean/{ => ticket}/Ticket.java | 4 +- .../popular/bean/{ => token}/Token.java | 4 +- .../popular/bean/{ => user}/FollowResult.java | 4 +- .../weixin/popular/bean/{ => user}/Group.java | 4 +- .../weixin/popular/bean/{ => user}/User.java | 4 +- .../popular/bean/{ => user}/UserInfoList.java | 4 +- .../popular/example/PayMchNotifyServlet.java | 22 +- .../popular/example/ReceiveServlet.java | 15 +- .../popular/example/ReceiveServlet2.java | 15 +- .../weixin/popular/support/ExpireKey.java | 35 +++ .../weixin/popular/support/TicketManager.java | 67 +++-- .../weixin/popular/support/TokenManager.java | 57 +++- .../support/expirekey/DefaultExpireKey.java | 89 ++++++ .../support/expirekey/JedisExpireKey.java | 57 ++++ .../java/weixin/popular/util/ExpireSet.java | 79 ----- .../java/weixin/popular/util/MapUtil.java | 41 --- .../java/weixin/popular/util/PayUtil.java | 16 + .../weixin/popular/util/SignatureUtil.java | 27 ++ .../weixin/popular/util/XMLConverUtil.java | 36 ++- 95 files changed, 2454 insertions(+), 370 deletions(-) delete mode 100644 src/main/java/weixin/popular/bean/Menu.java delete mode 100644 src/main/java/weixin/popular/bean/MenuButtons.java rename src/main/java/weixin/popular/bean/{ => media}/Media.java (81%) rename src/main/java/weixin/popular/bean/{ => media}/MediaType.java (90%) rename src/main/java/weixin/popular/bean/{ => media}/UploadimgResult.java (65%) create mode 100644 src/main/java/weixin/popular/bean/menu/Button.java create mode 100644 src/main/java/weixin/popular/bean/menu/Matchrule.java create mode 100644 src/main/java/weixin/popular/bean/menu/Menu.java create mode 100644 src/main/java/weixin/popular/bean/menu/MenuButtons.java create mode 100644 src/main/java/weixin/popular/bean/menu/TrymatchResult.java rename src/main/java/weixin/popular/bean/{ => menu}/selfmenu/Button.java (89%) rename src/main/java/weixin/popular/bean/{ => menu}/selfmenu/CurrentSelfmenuInfo.java (87%) rename src/main/java/weixin/popular/bean/{ => menu}/selfmenu/News.java (90%) rename src/main/java/weixin/popular/bean/{ => menu}/selfmenu/NewsInfo.java (76%) rename src/main/java/weixin/popular/bean/{ => menu}/selfmenu/SelfmenuInfo.java (78%) rename src/main/java/weixin/popular/bean/{ => message}/Article.java (93%) rename src/main/java/weixin/popular/bean/{ => message}/EventMessage.java (95%) rename src/main/java/weixin/popular/bean/{ => message}/MessageSendResult.java (75%) rename src/main/java/weixin/popular/bean/{ => message}/Uploadvideo.java (88%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/Filter.java (86%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassImageMessage.java (85%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassMPnewsMessage.java (85%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassMPvideoMessage.java (87%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassMessage.java (86%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassMusicMessage.java (85%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassTextMessage.java (85%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassVideoMessage.java (78%) rename src/main/java/weixin/popular/bean/{ => message}/massmessage/MassVoiceMessage.java (85%) rename src/main/java/weixin/popular/bean/message/{ => message}/ImageMessage.java (86%) rename src/main/java/weixin/popular/bean/message/{ => message}/Message.java (85%) rename src/main/java/weixin/popular/bean/message/{ => message}/MusicMessage.java (92%) rename src/main/java/weixin/popular/bean/message/{ => message}/NewsMessage.java (91%) rename src/main/java/weixin/popular/bean/message/{ => message}/TextMessage.java (87%) rename src/main/java/weixin/popular/bean/message/{ => message}/VideoMessage.java (89%) rename src/main/java/weixin/popular/bean/message/{ => message}/VoiceMessage.java (86%) rename src/main/java/weixin/popular/bean/{ => message}/templatemessage/TemplateMessage.java (87%) rename src/main/java/weixin/popular/bean/{ => message}/templatemessage/TemplateMessageItem.java (83%) rename src/main/java/weixin/popular/bean/{ => message}/templatemessage/TemplateMessageResult.java (76%) rename src/main/java/weixin/popular/bean/{ => pay}/Delivernotify.java (92%) create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayContractbill.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayContractbillResult.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayDeletecontract.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayDeletecontractResult.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayEntrustweb.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayEntrustwebNotify.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayQuerycontract.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PapayQuerycontractResult.java create mode 100644 src/main/java/weixin/popular/bean/paymch/Pappayapply.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PappayapplyNotify.java create mode 100644 src/main/java/weixin/popular/bean/paymch/PappayapplyResult.java rename src/main/java/weixin/popular/bean/{ => qrcode}/QrcodeTicket.java (82%) rename src/main/java/weixin/popular/bean/{ => shorturl}/Shorturl.java (68%) rename src/main/java/weixin/popular/bean/{ => sns}/SnsToken.java (86%) rename src/main/java/weixin/popular/bean/{ => ticket}/Ticket.java (77%) rename src/main/java/weixin/popular/bean/{ => token}/Token.java (83%) rename src/main/java/weixin/popular/bean/{ => user}/FollowResult.java (86%) rename src/main/java/weixin/popular/bean/{ => user}/Group.java (86%) rename src/main/java/weixin/popular/bean/{ => user}/User.java (92%) rename src/main/java/weixin/popular/bean/{ => user}/UserInfoList.java (75%) create mode 100644 src/main/java/weixin/popular/support/ExpireKey.java create mode 100644 src/main/java/weixin/popular/support/expirekey/DefaultExpireKey.java create mode 100644 src/main/java/weixin/popular/support/expirekey/JedisExpireKey.java delete mode 100644 src/main/java/weixin/popular/util/ExpireSet.java diff --git a/.classpath b/.classpath index f015a00b..224c495d 100644 --- a/.classpath +++ b/.classpath @@ -6,15 +6,21 @@ - + + - + + + + + + + - diff --git a/.project b/.project index b491ce5b..49f54fac 100644 --- a/.project +++ b/.project @@ -16,12 +16,12 @@ - org.eclipse.m2e.core.maven2Builder + org.eclipse.wst.validation.validationbuilder - org.eclipse.wst.validation.validationbuilder + org.eclipse.m2e.core.maven2Builder diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 1f887b61..2e67b959 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index f4217b01..4a30cc94 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -10,3 +10,283 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/README.md b/README.md index cee0bf72..346c24f1 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ weixin-popular 包括微信公众平台基础API与支付API,提供便捷的API * [TokenAPI](https://github.com/liyiorg/weixin-popular/wiki/TokenAPI) access_token 获取 * [MediaAPI](https://github.com/liyiorg/weixin-popular/wiki/MediaAPI) 多媒体上传下载(临时素材) * [MaterialAPI](https://github.com/liyiorg/weixin-popular/wiki/MaterialAPI) 永久素材 -* [MenuAPI](https://github.com/liyiorg/weixin-popular/wiki/MenuAPI) 菜单 +* [MenuAPI](https://github.com/liyiorg/weixin-popular/wiki/MenuAPI) 菜单、个性化菜单 * [MessageAPI](https://github.com/liyiorg/weixin-popular/wiki/MessageAPI) 信息发送(客服消息、群发消息、模板消息) * [PayAPI](https://github.com/liyiorg/weixin-popular/wiki/PayAPI) 支付订单相关接口 -* [PayMchAPI](https://github.com/liyiorg/weixin-popular/wiki/PayMchAPI) 支付订单、红包、企业付款相关接口(商户平台版) +* [PayMchAPI](https://github.com/liyiorg/weixin-popular/wiki/PayMchAPI) 支付订单、红包、企业付款、代扣费(商户平台版) * [QrcodeAPI](https://github.com/liyiorg/weixin-popular/wiki/QrcodeAPI) 二维码 * [SnsAPI](https://github.com/liyiorg/weixin-popular/wiki/SnsAPI) 网签授权 * [UserAPI](https://github.com/liyiorg/weixin-popular/wiki/UserAPI) 用户管理 @@ -40,6 +40,7 @@ weixin-popular 包括微信公众平台基础API与支付API,提供便捷的API * [TicketManager ticket 自动刷新](https://github.com/liyiorg/weixin-popular/wiki/TicketManager-ticket-自动刷新) * [设置API HttpClient 请求池大小](https://github.com/liyiorg/weixin-popular/wiki/设置API HttpClient 请求池大小) * [设置API MCH KeyStore](https://github.com/liyiorg/weixin-popular/wiki/设置API MCH KeyStore) +* [排除重复的异步通知](https://github.com/liyiorg/weixin-popular/wiki/排除重复的异步通知) ## 参考资料 * [微信公众平台开发者文档](http://mp.weixin.qq.com/wiki/index.php) @@ -47,3 +48,6 @@ weixin-popular 包括微信公众平台基础API与支付API,提供便捷的API * [微信支付开发教程(老版本)](https://mp.weixin.qq.com/paymch/readtemplate?t=mp/business/course2_tmpl&lang=zh_CN&token=6056275) * [微信支付商户平台开发者文档](http://mch.weixin.qq.com/wiki/doc/api/index.html) * [微信开放平台(公众号第三方平台开发)](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&lang=zh_CN) + +## QQ交流群 + 369381797 diff --git a/changelog.txt b/changelog.txt index 6772fb6c..875c14b0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,16 @@ WEIXIN-POPULAR CHANGELOG =========================== https://github.com/liyiorg/weixin-popular +Changes in version 2.5.0 (2015-12-22) +------------------------------------- +*weixin.popular.bean 下的类整理分包。 +*添加ExpireKey接口以及实现类,用于处理重复异步通知。 +*weixin.popular.api.PayMchAPI 添加代扣费接口 +*weixin.popular.api.MenuAPI 添加个性化菜单接口 +*修改weixin.popular.support.TokenManager、weixin.popular.support.TicketManager 调度方式由Timer 改为 ScheduledExecutorService。 +*修改支付异步通知的校验方式。 +*删除weixin.popular.util.ExpireSet + Changes in version 2.4.6 (2015-11-12) ------------------------------------- *修改XmlResponseHandler 解决微信红包接口返回结果中文乱码问题 diff --git a/pom.xml b/pom.xml index bbb960ba..e1b5f87e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 weixin weixin-popular - 2.4.6-RELEASE + 2.5.0-RELEASE https://github.com/liyiorg/weixin-popular @@ -13,6 +13,20 @@ 2.5 provided + + + redis.clients + jedis + 2.7.3 + provided + + + org.apache.commons + commons-pool2 + 2.3 + provided + + com.alibaba fastjson diff --git a/src/main/java/weixin/popular/api/MaterialAPI.java b/src/main/java/weixin/popular/api/MaterialAPI.java index fd07cf23..9ca2701b 100644 --- a/src/main/java/weixin/popular/api/MaterialAPI.java +++ b/src/main/java/weixin/popular/api/MaterialAPI.java @@ -24,14 +24,14 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import weixin.popular.bean.Article; import weixin.popular.bean.BaseResult; -import weixin.popular.bean.Media; -import weixin.popular.bean.MediaType; import weixin.popular.bean.material.Description; import weixin.popular.bean.material.MaterialBatchgetResult; import weixin.popular.bean.material.MaterialcountResult; import weixin.popular.bean.material.NewsItem; +import weixin.popular.bean.media.Media; +import weixin.popular.bean.media.MediaType; +import weixin.popular.bean.message.Article; import weixin.popular.client.LocalHttpClient; import weixin.popular.util.JsonUtil; diff --git a/src/main/java/weixin/popular/api/MediaAPI.java b/src/main/java/weixin/popular/api/MediaAPI.java index 517d3633..20df03a5 100644 --- a/src/main/java/weixin/popular/api/MediaAPI.java +++ b/src/main/java/weixin/popular/api/MediaAPI.java @@ -22,9 +22,9 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import weixin.popular.bean.Media; -import weixin.popular.bean.MediaType; -import weixin.popular.bean.UploadimgResult; +import weixin.popular.bean.media.Media; +import weixin.popular.bean.media.MediaType; +import weixin.popular.bean.media.UploadimgResult; import weixin.popular.client.LocalHttpClient; public class MediaAPI extends BaseAPI{ diff --git a/src/main/java/weixin/popular/api/MenuAPI.java b/src/main/java/weixin/popular/api/MenuAPI.java index 073ddfca..54468dd2 100644 --- a/src/main/java/weixin/popular/api/MenuAPI.java +++ b/src/main/java/weixin/popular/api/MenuAPI.java @@ -7,9 +7,10 @@ import org.apache.http.entity.StringEntity; import weixin.popular.bean.BaseResult; -import weixin.popular.bean.Menu; -import weixin.popular.bean.MenuButtons; -import weixin.popular.bean.selfmenu.CurrentSelfmenuInfo; +import weixin.popular.bean.menu.Menu; +import weixin.popular.bean.menu.MenuButtons; +import weixin.popular.bean.menu.TrymatchResult; +import weixin.popular.bean.menu.selfmenu.CurrentSelfmenuInfo; import weixin.popular.client.LocalHttpClient; import weixin.popular.util.JsonUtil; @@ -86,6 +87,54 @@ public static CurrentSelfmenuInfo get_current_selfmenu_info(String access_token) return LocalHttpClient.executeJsonResult(httpUriRequest,CurrentSelfmenuInfo.class); } + /** + * 创建个性化菜单 + * @param access_token + * @param menuButtons + * @return + */ + public static BaseResult menuAddconditional(String access_token,MenuButtons menuButtons){ + String menuJson = JsonUtil.toJSONString(menuButtons); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(jsonHeader) + .setUri(BASE_URI+"/cgi-bin/menu/addconditional") + .addParameter("access_token", access_token) + .setEntity(new StringEntity(menuJson,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class); + } + + /** + * 删除个性化菜单 + * @param access_token + * @param menuid + * @return + */ + public static BaseResult menuDelconditional(String access_token,String menuid){ + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(jsonHeader) + .setUri(BASE_URI+"/cgi-bin/menu/delconditional") + .addParameter("access_token", access_token) + .setEntity(new StringEntity("{\"menuid\":\""+menuid+"\"}",Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class); + } + + /** + * 测试个性化菜单匹配结果 + * @param access_token + * @param user_id 可以是粉丝的OpenID,也可以是粉丝的微信号。 + * @return + */ + public static TrymatchResult menuTrymatch(String access_token,String user_id){ + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(jsonHeader) + .setUri(BASE_URI+"/cgi-bin/menu/trymatch") + .addParameter("access_token", access_token) + .setEntity(new StringEntity("{\"user_id\":\""+user_id+"\"}",Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeJsonResult(httpUriRequest,TrymatchResult.class); + } } \ No newline at end of file diff --git a/src/main/java/weixin/popular/api/MessageAPI.java b/src/main/java/weixin/popular/api/MessageAPI.java index d7ae46d3..99082ffe 100644 --- a/src/main/java/weixin/popular/api/MessageAPI.java +++ b/src/main/java/weixin/popular/api/MessageAPI.java @@ -7,15 +7,15 @@ import org.apache.http.client.methods.RequestBuilder; import org.apache.http.entity.StringEntity; -import weixin.popular.bean.Article; import weixin.popular.bean.BaseResult; -import weixin.popular.bean.Media; -import weixin.popular.bean.MessageSendResult; -import weixin.popular.bean.Uploadvideo; -import weixin.popular.bean.massmessage.MassMessage; -import weixin.popular.bean.message.Message; -import weixin.popular.bean.templatemessage.TemplateMessage; -import weixin.popular.bean.templatemessage.TemplateMessageResult; +import weixin.popular.bean.media.Media; +import weixin.popular.bean.message.Article; +import weixin.popular.bean.message.MessageSendResult; +import weixin.popular.bean.message.Uploadvideo; +import weixin.popular.bean.message.massmessage.MassMessage; +import weixin.popular.bean.message.message.Message; +import weixin.popular.bean.message.templatemessage.TemplateMessage; +import weixin.popular.bean.message.templatemessage.TemplateMessageResult; import weixin.popular.client.LocalHttpClient; import weixin.popular.util.JsonUtil; diff --git a/src/main/java/weixin/popular/api/PayAPI.java b/src/main/java/weixin/popular/api/PayAPI.java index 7824e10e..bad368f4 100644 --- a/src/main/java/weixin/popular/api/PayAPI.java +++ b/src/main/java/weixin/popular/api/PayAPI.java @@ -10,7 +10,7 @@ import org.apache.http.entity.StringEntity; import weixin.popular.bean.BaseResult; -import weixin.popular.bean.Delivernotify; +import weixin.popular.bean.pay.Delivernotify; import weixin.popular.bean.pay.OrderInfo; import weixin.popular.bean.pay.Orderquery; import weixin.popular.client.LocalHttpClient; diff --git a/src/main/java/weixin/popular/api/PayMchAPI.java b/src/main/java/weixin/popular/api/PayMchAPI.java index a105102c..b6551271 100644 --- a/src/main/java/weixin/popular/api/PayMchAPI.java +++ b/src/main/java/weixin/popular/api/PayMchAPI.java @@ -25,6 +25,14 @@ import weixin.popular.bean.paymch.MchShorturlResult; import weixin.popular.bean.paymch.Micropay; import weixin.popular.bean.paymch.MicropayResult; +import weixin.popular.bean.paymch.PapayContractbill; +import weixin.popular.bean.paymch.PapayContractbillResult; +import weixin.popular.bean.paymch.PapayDeletecontract; +import weixin.popular.bean.paymch.PapayDeletecontractResult; +import weixin.popular.bean.paymch.PapayQuerycontract; +import weixin.popular.bean.paymch.PapayQuerycontractResult; +import weixin.popular.bean.paymch.Pappayapply; +import weixin.popular.bean.paymch.PappayapplyResult; import weixin.popular.bean.paymch.QueryCoupon; import weixin.popular.bean.paymch.QueryCouponResult; import weixin.popular.bean.paymch.QueryCouponStock; @@ -55,17 +63,6 @@ */ public class PayMchAPI extends BaseAPI{ - /** - * 统一下单 - * 请使用 payUnifiedorder(Unifiedorder unifiedorder,String key), - * 自动生成sign - * @param unifiedorder - * @return - */ - @Deprecated - public static UnifiedorderResult payUnifiedorder(Unifiedorder unifiedorder){ - return payUnifiedorder(unifiedorder, null); - } /** * 统一下单 @@ -413,4 +410,119 @@ public static TransfersResult mmpaymkttransfersPromotionTransfers(Transfers tran return LocalHttpClient.keyStoreExecuteXmlResult(transfers.getMchid(),httpUriRequest,TransfersResult.class); } + /** + * 委托代扣-扣款 + * @param pappayapply + * @param key + * @return + */ + public static PappayapplyResult payPappayapply(Pappayapply pappayapply,String key){ + Map map = MapUtil.objectToMap( pappayapply); + String sign = SignatureUtil.generateSign(map,key); + pappayapply.setSign(sign); + String secapiPayRefundXML = XMLConverUtil.convertToXML( pappayapply); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(xmlHeader) + .setUri(MCH_URI + "/pay/pappayapply") + .setEntity(new StringEntity(secapiPayRefundXML,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeXmlResult(httpUriRequest,PappayapplyResult.class); + } + + /** + * 委托代扣-订单查询 + * @param mchOrderquery + * @param key + * @return + */ + public static MchOrderInfoResult payPaporderquery(MchOrderquery mchOrderquery,String key){ + Map map = MapUtil.objectToMap(mchOrderquery); + String sign = SignatureUtil.generateSign(map,key); + mchOrderquery.setSign(sign); + String closeorderXML = XMLConverUtil.convertToXML(mchOrderquery); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(xmlHeader) + .setUri(MCH_URI + "/pay/paporderquery") + .setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeXmlResult(httpUriRequest,MchOrderInfoResult.class); + } + + /** + * 委托代扣-查询签约关系 + * @param papayQuerycontract + * @param key + * @return + */ + public static PapayQuerycontractResult papayQuerycontract(PapayQuerycontract papayQuerycontract,String key){ + Map map = MapUtil.objectToMap(papayQuerycontract); + String sign = SignatureUtil.generateSign(map,key); + papayQuerycontract.setSign(sign); + String closeorderXML = XMLConverUtil.convertToXML(papayQuerycontract); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(xmlHeader) + .setUri(MCH_URI + "/papay/querycontract") + .setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeXmlResult(httpUriRequest,PapayQuerycontractResult.class); + } + + /** + * 委托代扣-解约 + * @param papayDeletecontract + * @param key + * @return + */ + public static PapayDeletecontractResult papayDeletecontract(PapayDeletecontract papayDeletecontract,String key){ + Map map = MapUtil.objectToMap(papayDeletecontract); + String sign = SignatureUtil.generateSign(map,key); + papayDeletecontract.setSign(sign); + String closeorderXML = XMLConverUtil.convertToXML(papayDeletecontract); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(xmlHeader) + .setUri(MCH_URI + "/papay/deletecontract") + .setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.executeXmlResult(httpUriRequest,PapayDeletecontractResult.class); + } + + /** + * 委托代扣-对账单查询 + * @param papayContractbill + * @param key + * @return + */ + public static PapayContractbillResult papayContractbill(PapayContractbill papayContractbill,String key){ + Map map = MapUtil.objectToMap(papayContractbill); + String sign = SignatureUtil.generateSign(map,key); + papayContractbill.setSign(sign); + String closeorderXML = XMLConverUtil.convertToXML(papayContractbill); + HttpUriRequest httpUriRequest = RequestBuilder.post() + .setHeader(xmlHeader) + .setUri(MCH_URI + "/papay/contractbill") + .setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8"))) + .build(); + return LocalHttpClient.execute(httpUriRequest,new ResponseHandler() { + + @Override + public PapayContractbillResult handleResponse(HttpResponse response) + throws ClientProtocolException, IOException { + int status = response.getStatusLine().getStatusCode(); + if (status >= 200 && status < 300) { + HttpEntity entity = response.getEntity(); + String str = EntityUtils.toString(entity,"utf-8"); + if(str.startsWith("")){ + return XMLConverUtil.convertToObject(PapayContractbillResult.class,str); + }else{ + PapayContractbillResult dr = new PapayContractbillResult(); + dr.setData(str); + return dr; + } + } else { + throw new ClientProtocolException("Unexpected response status: " + status); + } + } + }); + } + } diff --git a/src/main/java/weixin/popular/api/QrcodeAPI.java b/src/main/java/weixin/popular/api/QrcodeAPI.java index 8794e4dd..1e371057 100644 --- a/src/main/java/weixin/popular/api/QrcodeAPI.java +++ b/src/main/java/weixin/popular/api/QrcodeAPI.java @@ -13,7 +13,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.util.EntityUtils; -import weixin.popular.bean.QrcodeTicket; +import weixin.popular.bean.qrcode.QrcodeTicket; import weixin.popular.client.LocalHttpClient; /** @@ -56,7 +56,7 @@ private static QrcodeTicket qrcodeCreate(String access_token,Integer expire_seco /** * 创建临时二维码 * @param access_token - * @param expire_seconds 不超过604800秒 + * @param expire_seconds 最大不超过2592000 秒(即30天) * @param scene_id 场景值ID,32位非0整型 * @return */ diff --git a/src/main/java/weixin/popular/api/ShorturlAPI.java b/src/main/java/weixin/popular/api/ShorturlAPI.java index 1f166aed..4e825d7a 100644 --- a/src/main/java/weixin/popular/api/ShorturlAPI.java +++ b/src/main/java/weixin/popular/api/ShorturlAPI.java @@ -6,7 +6,7 @@ import org.apache.http.client.methods.RequestBuilder; import org.apache.http.entity.StringEntity; -import weixin.popular.bean.Shorturl; +import weixin.popular.bean.shorturl.Shorturl; import weixin.popular.client.LocalHttpClient; public class ShorturlAPI extends BaseAPI{ diff --git a/src/main/java/weixin/popular/api/SnsAPI.java b/src/main/java/weixin/popular/api/SnsAPI.java index a93036dc..2230fc14 100644 --- a/src/main/java/weixin/popular/api/SnsAPI.java +++ b/src/main/java/weixin/popular/api/SnsAPI.java @@ -6,8 +6,8 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.RequestBuilder; -import weixin.popular.bean.SnsToken; -import weixin.popular.bean.User; +import weixin.popular.bean.sns.SnsToken; +import weixin.popular.bean.user.User; import weixin.popular.client.LocalHttpClient; /** diff --git a/src/main/java/weixin/popular/api/TicketAPI.java b/src/main/java/weixin/popular/api/TicketAPI.java index d175aab4..53cc1ae7 100644 --- a/src/main/java/weixin/popular/api/TicketAPI.java +++ b/src/main/java/weixin/popular/api/TicketAPI.java @@ -3,7 +3,7 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.RequestBuilder; -import weixin.popular.bean.Ticket; +import weixin.popular.bean.ticket.Ticket; import weixin.popular.client.LocalHttpClient; /** diff --git a/src/main/java/weixin/popular/api/TokenAPI.java b/src/main/java/weixin/popular/api/TokenAPI.java index 29d8bfcb..122ba694 100644 --- a/src/main/java/weixin/popular/api/TokenAPI.java +++ b/src/main/java/weixin/popular/api/TokenAPI.java @@ -3,7 +3,7 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.RequestBuilder; -import weixin.popular.bean.Token; +import weixin.popular.bean.token.Token; import weixin.popular.client.LocalHttpClient; public class TokenAPI extends BaseAPI{ diff --git a/src/main/java/weixin/popular/api/UserAPI.java b/src/main/java/weixin/popular/api/UserAPI.java index 472518be..e2de7f57 100644 --- a/src/main/java/weixin/popular/api/UserAPI.java +++ b/src/main/java/weixin/popular/api/UserAPI.java @@ -8,10 +8,10 @@ import org.apache.http.entity.StringEntity; import weixin.popular.bean.BaseResult; -import weixin.popular.bean.FollowResult; -import weixin.popular.bean.Group; -import weixin.popular.bean.User; -import weixin.popular.bean.UserInfoList; +import weixin.popular.bean.user.FollowResult; +import weixin.popular.bean.user.Group; +import weixin.popular.bean.user.User; +import weixin.popular.bean.user.UserInfoList; import weixin.popular.client.LocalHttpClient; import weixin.popular.util.JsonUtil; diff --git a/src/main/java/weixin/popular/bean/Menu.java b/src/main/java/weixin/popular/bean/Menu.java deleted file mode 100644 index 3bed4e81..00000000 --- a/src/main/java/weixin/popular/bean/Menu.java +++ /dev/null @@ -1,16 +0,0 @@ -package weixin.popular.bean; - -public class Menu extends BaseResult{ - - private MenuButtons menu; - - public MenuButtons getMenu() { - return menu; - } - - public void setMenu(MenuButtons menu) { - this.menu = menu; - } - - -} diff --git a/src/main/java/weixin/popular/bean/MenuButtons.java b/src/main/java/weixin/popular/bean/MenuButtons.java deleted file mode 100644 index 316e63fe..00000000 --- a/src/main/java/weixin/popular/bean/MenuButtons.java +++ /dev/null @@ -1,73 +0,0 @@ -package weixin.popular.bean; - -import java.util.List; - -/** - * 自定义菜单最多包括3个一级菜单,每个一级菜单最多包含5个二级菜单。一级菜单最多4个汉字,二级菜单最多7个汉字,多出来的部分将会以“...”代替。请注意,创建自定义菜单后,由于微信客户端缓存,需要24小时微信客户端才会展现出来。建议测试时可以尝试取消关注公众账号后再次关注,则可以看到创建后的效果。 - * @author LiYi - */ -public class MenuButtons { - - private Button[] button; - - - public Button[] getButton() { - return button; - } - - public void setButton(Button[] button) { - this.button = button; - } - - public static class Button{ - - private String type; //click|view - private String name; - private String key; - private String url; - - private List