Showing preview only (269K chars total). Download the full file or copy to clipboard to get everything.
Repository: honeyzhaoAliyun/WeixinMultiPlatform
Branch: master
Commit: 1ff6c7ace782
Files: 130
Total size: 228.4 KB
Directory structure:
gitextract_caiphvtt/
├── .gitignore
├── .mymetadata
├── LICENSE
├── README.md
├── pom.xml
└── src/
├── main/
│ ├── java/
│ │ └── org/
│ │ └── hamster/
│ │ └── weixinmp/
│ │ ├── config/
│ │ │ └── WxConfig.java
│ │ ├── constant/
│ │ │ ├── WxMediaType.java
│ │ │ ├── WxMediaTypeEnum.java
│ │ │ ├── WxMenuBtnType.java
│ │ │ ├── WxMenuBtnTypeEnum.java
│ │ │ ├── WxMsgEventType.java
│ │ │ ├── WxMsgEventTypeEnum.java
│ │ │ ├── WxMsgRespType.java
│ │ │ ├── WxMsgRespTypeEnum.java
│ │ │ ├── WxMsgType.java
│ │ │ └── WxMsgTypeEnum.java
│ │ ├── controller/
│ │ │ ├── WxController.java
│ │ │ └── util/
│ │ │ ├── WxJsonUtil.java
│ │ │ └── WxXmlUtil.java
│ │ ├── dao/
│ │ │ ├── entity/
│ │ │ │ ├── auth/
│ │ │ │ │ ├── WxAuth.java
│ │ │ │ │ └── WxAuthReq.java
│ │ │ │ ├── base/
│ │ │ │ │ ├── WxBaseEntity.java
│ │ │ │ │ ├── WxBaseItemMediaEntity.java
│ │ │ │ │ ├── WxBaseMsgEntity.java
│ │ │ │ │ └── WxBaseRespEntity.java
│ │ │ │ ├── item/
│ │ │ │ │ ├── WxItemImageEntity.java
│ │ │ │ │ ├── WxItemMusicEntity.java
│ │ │ │ │ ├── WxItemPicDescEntity.java
│ │ │ │ │ ├── WxItemThumbEntity.java
│ │ │ │ │ ├── WxItemVideoEntity.java
│ │ │ │ │ └── WxItemVoiceEntity.java
│ │ │ │ ├── menu/
│ │ │ │ │ └── WxMenuBtnEntity.java
│ │ │ │ ├── msg/
│ │ │ │ │ ├── WxMsgEventEntity.java
│ │ │ │ │ ├── WxMsgImageEntity.java
│ │ │ │ │ ├── WxMsgLinkEntity.java
│ │ │ │ │ ├── WxMsgLocEntity.java
│ │ │ │ │ ├── WxMsgTextEntity.java
│ │ │ │ │ ├── WxMsgVideoEntity.java
│ │ │ │ │ └── WxMsgVoiceEntity.java
│ │ │ │ ├── qr/
│ │ │ │ │ └── WxQrEntity.java
│ │ │ │ ├── resp/
│ │ │ │ │ ├── WxRespImageEntity.java
│ │ │ │ │ ├── WxRespMusicEntity.java
│ │ │ │ │ ├── WxRespPicDescEntity.java
│ │ │ │ │ ├── WxRespTextEntity.java
│ │ │ │ │ ├── WxRespVideoEntity.java
│ │ │ │ │ └── WxRespVoiceEntity.java
│ │ │ │ └── user/
│ │ │ │ ├── WxGroupEntity.java
│ │ │ │ └── WxUserEntity.java
│ │ │ └── repository/
│ │ │ ├── auth/
│ │ │ │ ├── WxAuthDao.java
│ │ │ │ └── WxAuthReqDao.java
│ │ │ ├── item/
│ │ │ │ ├── WxItemImageDao.java
│ │ │ │ ├── WxItemMusicDao.java
│ │ │ │ ├── WxItemPicDescDao.java
│ │ │ │ ├── WxItemThumbDao.java
│ │ │ │ ├── WxItemVideoDao.java
│ │ │ │ └── WxItemVoiceDao.java
│ │ │ ├── menu/
│ │ │ │ └── WxMenuBtnDao.java
│ │ │ ├── msg/
│ │ │ │ ├── WxBaseMsgDao.java
│ │ │ │ ├── WxMsgEventDao.java
│ │ │ │ ├── WxMsgImageDao.java
│ │ │ │ ├── WxMsgLinkDao.java
│ │ │ │ ├── WxMsgLocDao.java
│ │ │ │ ├── WxMsgTextDao.java
│ │ │ │ ├── WxMsgVideoDao.java
│ │ │ │ └── WxMsgVoiceDao.java
│ │ │ ├── resp/
│ │ │ │ ├── WxRespImageDao.java
│ │ │ │ ├── WxRespMusicDao.java
│ │ │ │ ├── WxRespPicDescDao.java
│ │ │ │ ├── WxRespTextDao.java
│ │ │ │ ├── WxRespVideoDao.java
│ │ │ │ └── WxRespVoiceDao.java
│ │ │ └── user/
│ │ │ ├── WxGroupDao.java
│ │ │ └── WxUserDao.java
│ │ ├── exception/
│ │ │ └── WxException.java
│ │ ├── gson/
│ │ │ └── WxMenuBtnSerializer.java
│ │ ├── model/
│ │ │ ├── WxAccessTokenJson.java
│ │ │ ├── WxRespCode.java
│ │ │ ├── menu/
│ │ │ │ ├── WxMenuCreateJson.java
│ │ │ │ └── WxMenuGetJson.java
│ │ │ ├── qr/
│ │ │ │ ├── WxQrActionInfoJson.java
│ │ │ │ ├── WxQrCreateJson.java
│ │ │ │ └── WxQrSceneJson.java
│ │ │ ├── send/
│ │ │ │ ├── SendImageJson.java
│ │ │ │ ├── SendItemPicDescJson.java
│ │ │ │ ├── SendMusicJson.java
│ │ │ │ ├── SendTextJson.java
│ │ │ │ ├── SendVideoJson.java
│ │ │ │ ├── SendVoiceJson.java
│ │ │ │ └── item/
│ │ │ │ ├── SendItemArticleJson.java
│ │ │ │ ├── SendItemImageJson.java
│ │ │ │ ├── SendItemMusicJson.java
│ │ │ │ ├── SendItemTextJson.java
│ │ │ │ ├── SendItemVideoJson.java
│ │ │ │ ├── SendItemVoiceJson.java
│ │ │ │ └── wrapper/
│ │ │ │ └── WxSendItemArticleWrapper.java
│ │ │ └── user/
│ │ │ ├── WxOpenIdListJson.java
│ │ │ └── WxUserGetJson.java
│ │ ├── service/
│ │ │ ├── WxAuthService.java
│ │ │ ├── WxMediaService.java
│ │ │ ├── WxMenuService.java
│ │ │ ├── WxMessageService.java
│ │ │ ├── WxQrService.java
│ │ │ ├── WxStorageService.java
│ │ │ ├── WxUserGroupService.java
│ │ │ ├── WxUserService.java
│ │ │ └── handler/
│ │ │ └── WxMessageHandlerIfc.java
│ │ └── util/
│ │ └── WxUtil.java
│ ├── resources/
│ │ ├── applicationContext-weixinmp.xml
│ │ └── wx.properties
│ └── webapp/
│ ├── META-INF/
│ │ └── MANIFEST.MF
│ ├── MyHtml.html
│ ├── WEB-INF/
│ │ ├── classes/
│ │ │ └── weixin/
│ │ │ └── popular/
│ │ │ └── example/
│ │ │ └── pay_example.jsp.jsp
│ │ └── web.xml
│ ├── default/
│ │ └── index.html
│ └── index.jsp
└── test/
├── java/
│ └── org/
│ └── hamster/
│ └── weixinmp/
│ └── test/
│ ├── base/
│ │ ├── AbstractServiceTest.java
│ │ └── AbstractWxServiceTest.java
│ ├── controller/
│ │ └── WxControllerManualTest.java
│ ├── service/
│ │ ├── WxGroupServceTest.java
│ │ ├── WxMediaServiceTest.java
│ │ ├── WxMenuServiceTest.java
│ │ ├── WxQrServiceTest.java
│ │ ├── WxServiceTest.java
│ │ └── WxUserServiceTest.java
│ └── xml/
│ └── WxXMLUtilTest.java
└── resources/
├── .gitignore
├── application.development.properties
├── applicationContext-test-weixinmp.xml
├── log4j.properties
└── sql/
└── import-data.sql
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
target/
.project
.settings/
.classpath
/logs
================================================
FILE: .mymetadata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project-module
type="WEB"
name="WeixinMultiPlatform"
id="myeclipse.1418610851099"
context-root="/weixin-mp"
j2ee-spec="5.0"
archive="WeixinMultiPlatform.war">
<attributes>
<attribute name="webrootdir" value="src/main/webapp" />
</attributes>
</project-module>
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# WeixinMultiPlatform
weixin-mp-java 基于Java,Spring,Maven实现的微信公众平台一整套代码,从前端Controller到后端的Dao的实现<br /> ============== 1.0.1 2013-1月更新: 支持上传下载多媒体文件 支持接收消息(语音似乎总有问题,同时收到来自微信两个服务器的空的POST的请求,论坛上也有很多人反映此情况) 支持用户管理 支持自定义菜单CRD 支持推广支持接口 强化测试代码 优化代码结构,增加WxMessageHandlerIfc, 只要实现该接口的所有spring bean在收到消息后都会被自动调用. ============== 实现功能:消息接口,通用接口和菜单接口(没有内测号无法测试)<br /> ============== 由于涉及的框架比较杂乱,在此一一解释:<br /> 1. 简便实用的前置条件:<br /> 你的项目是基于Spring,Maven,Hibernate架构;<br /> 你的项目至少有一个已经存在的配置文件;<br /> 需要在配置文件(例子:application.properties)中添加<br /> wx_token=your_token<br /> wx_appid=asdf<br /> wx_appsecret=secret<br /> 没有在线的Maven仓库,强烈建议clone代码到本地作为子工程使用;<br /> 2. 如果你是通过spring-annotation配置bean的话,那么只要在你的Spring xml配置文件里加入以下两句便可:<br /> &lt;context:component-scan base-package="com.hamster.weixinmp" /&gt;<br /> &lt;util:properties id="wxProperties" location="classpath:/application.properties"/&gt;<br /> 如果没有util的话,在beans xml声明中加入:<br /> xmlns:util="http://www.springframework.org/schema/util"<br /> xsi:schemaLocation="…..<br /> http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"<br /> 在org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean的packageToScan中添加org.hamster.weixinmp.dao 3. 如果不想用数据库,那么只扫描com.hamster.weixinmp.service和com.hamster.weixinmp.controller即可,所有的dao在wxService中配置模式均为可选,如果没有注入,则不会执行存储操作;<br /> 4. 项目使用了lombok生成Getter/Setter, toString, hashCode, equals方法,lombok有eclipse插件,具体怎么安装请看这里:http://projectlombok.org/download.html,如果不想用lombok的话那么就手动删掉那些注解并用eclipse等工具重新生成一下这些方法便可。<br /> 5. 如果你的项目是通过xml的方式配置的话,你需要将所有的dao,service和controller配置到xml中(浩大的工程= =)<br /> 6. 数据库的前缀为wx_,一般来说不会有冲突,真冲突了那就自己手动改改吧,反正也不麻烦<br /> 7. 数据库有些额外的字段,比如自增长的id,created_date等,用不到就无视吧<br /> 8. 如果你不用maven的话……那就把java代码都拷贝到自己的工程里面去吧……<br />
================================================
FILE: pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>weixin-mp</artifactId>
<name>Weixin Multi Platform</name>
<version>1.0.2</version>
<groupId>org.hamster</groupId>
<packaging>war</packaging>
<url>http://maven.apache.org</url>
<properties>
<!-- version definitions of dependencies -->
<spring-data-jpa.version>1.3.2.RELEASE</spring-data-jpa.version>
<cglib.version>2.2.2</cglib.version>
<spring.version>3.1.3.RELEASE</spring.version>
<slf4j.version>1.7.2</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<commons-io.version>2.4</commons-io.version>
<httpclient.version>4.3.1</httpclient.version>
<commons-lang3.version>3.1</commons-lang3.version>
<hibernate.version>3.6.10.Final</hibernate.version>
<commons-httpclient.version>3.0.1</commons-httpclient.version>
<h2.version>1.3.170</h2.version>
<junit.version>4.11</junit.version>
<gson.version>2.2.4</gson.version>
<guava.version>15.0</guava.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<!-- third party dependencies -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data-jpa.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${cglib.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<!-- web begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<!-- web end -->
<!-- LOGGING begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- LOGGING end -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- Test Begin -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- third party dependencies -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version><!--$NO-MVN-MAN-VER$-->
<type>pom</type>
</dependency>
<!-- web begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<!-- web end -->
<!-- LOGGING begin -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<!-- LOGGING end -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<!-- Test Begin -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
================================================
FILE: src/main/java/org/hamster/weixinmp/config/WxConfig.java
================================================
/**
*
*/
package org.hamster.weixinmp.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* @author honey.zhao@aliyun.com
* @version Jul 29, 2013
*
*/
@Configuration
public class WxConfig {
public static final String TABLE_PREFIX = "wx_";
public static final int COL_LEN_URL = 1024;
public static final int COL_LEN_CONTENT = 4000;
public static final int COL_LEN_TITLE = 200;
public static final int COL_LEN_USER_NAME = 100;
public static final int COL_LEN_INDICATOR = 64;
private @Value("#{wxProperties.wx_token}") String token;
private @Value("#{wxProperties.wx_appid}") String appid;
private @Value("#{wxProperties.wx_appsecret}") String appsecret;
private @Value("#{wxProperties.wx_menu_create_url}") String menuCreateUrl;
private @Value("#{wxProperties.wx_menu_get_url}") String menuGetUrl;
private @Value("#{wxProperties.wx_menu_delete_url}") String menuDeleteUrl;
private @Value("#{wxProperties.wx_access_token_create_url}") String accessTokenCreateUrl;
private @Value("#{wxProperties.wx_custom_send_url}") String customSendUrl;
private @Value("#{wxProperties.wx_media_upload_url}") String mediaUploadUrl;
private @Value("#{wxProperties.wx_qrcode_create_url}") String qrcodeCreateUrl;
private @Value("#{wxProperties.wx_user_info_url}") String userInfoUrl;
private @Value("#{wxProperties.wx_user_get_url}") String userGetUrl;
private @Value("#{wxProperties.wx_groups_create_url}") String groupsCreateUrl;
private @Value("#{wxProperties.wx_groups_get_url}") String groupsGetUrl;
private @Value("#{wxProperties.wx_groups_getid_url}") String groupsGetIdUrl;
private @Value("#{wxProperties.wx_groups_update_url}") String groupsUpdateUrl;
private @Value("#{wxProperties.wx_groups_members_update_url}") String groupsMembersUpdateUrl;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getAppsecret() {
return appsecret;
}
public void setAppsecret(String appsecret) {
this.appsecret = appsecret;
}
public String getMenuCreateUrl() {
return menuCreateUrl;
}
public void setMenuCreateUrl(String menuCreateUrl) {
this.menuCreateUrl = menuCreateUrl;
}
public String getMenuGetUrl() {
return menuGetUrl;
}
public void setMenuGetUrl(String menuGetUrl) {
this.menuGetUrl = menuGetUrl;
}
public String getMenuDeleteUrl() {
return menuDeleteUrl;
}
public void setMenuDeleteUrl(String menuDeleteUrl) {
this.menuDeleteUrl = menuDeleteUrl;
}
public String getAccessTokenCreateUrl() {
return accessTokenCreateUrl;
}
public void setAccessTokenCreateUrl(String accessTokenCreateUrl) {
this.accessTokenCreateUrl = accessTokenCreateUrl;
}
public String getCustomSendUrl() {
return customSendUrl;
}
public void setCustomSendUrl(String customSendUrl) {
this.customSendUrl = customSendUrl;
}
public String getMediaUploadUrl() {
return mediaUploadUrl;
}
public void setMediaUploadUrl(String mediaUploadUrl) {
this.mediaUploadUrl = mediaUploadUrl;
}
public String getQrcodeCreateUrl() {
return qrcodeCreateUrl;
}
public void setQrcodeCreateUrl(String qrcodeCreateUrl) {
this.qrcodeCreateUrl = qrcodeCreateUrl;
}
public String getUserInfoUrl() {
return userInfoUrl;
}
public void setUserInfoUrl(String userInfoUrl) {
this.userInfoUrl = userInfoUrl;
}
public String getUserGetUrl() {
return userGetUrl;
}
public void setUserGetUrl(String userGetUrl) {
this.userGetUrl = userGetUrl;
}
public String getGroupsCreateUrl() {
return groupsCreateUrl;
}
public void setGroupsCreateUrl(String groupsCreateUrl) {
this.groupsCreateUrl = groupsCreateUrl;
}
public String getGroupsGetUrl() {
return groupsGetUrl;
}
public void setGroupsGetUrl(String groupsGetUrl) {
this.groupsGetUrl = groupsGetUrl;
}
public String getGroupsGetIdUrl() {
return groupsGetIdUrl;
}
public void setGroupsGetIdUrl(String groupsGetIdUrl) {
this.groupsGetIdUrl = groupsGetIdUrl;
}
public String getGroupsUpdateUrl() {
return groupsUpdateUrl;
}
public void setGroupsUpdateUrl(String groupsUpdateUrl) {
this.groupsUpdateUrl = groupsUpdateUrl;
}
public String getGroupsMembersUpdateUrl() {
return groupsMembersUpdateUrl;
}
public void setGroupsMembersUpdateUrl(String groupsMembersUpdateUrl) {
this.groupsMembersUpdateUrl = groupsMembersUpdateUrl;
}
public static String getTablePrefix() {
return TABLE_PREFIX;
}
public static int getColLenUrl() {
return COL_LEN_URL;
}
public static int getColLenContent() {
return COL_LEN_CONTENT;
}
public static int getColLenTitle() {
return COL_LEN_TITLE;
}
public static int getColLenUserName() {
return COL_LEN_USER_NAME;
}
public static int getColLenIndicator() {
return COL_LEN_INDICATOR;
}
public WxConfig() {
super();
// TODO Auto-generated constructor stub
}
public WxConfig(String token, String appid, String appsecret,
String menuCreateUrl, String menuGetUrl, String menuDeleteUrl,
String accessTokenCreateUrl, String customSendUrl,
String mediaUploadUrl, String qrcodeCreateUrl, String userInfoUrl,
String userGetUrl, String groupsCreateUrl, String groupsGetUrl,
String groupsGetIdUrl, String groupsUpdateUrl,
String groupsMembersUpdateUrl) {
super();
this.token = token;
this.appid = appid;
this.appsecret = appsecret;
this.menuCreateUrl = menuCreateUrl;
this.menuGetUrl = menuGetUrl;
this.menuDeleteUrl = menuDeleteUrl;
this.accessTokenCreateUrl = accessTokenCreateUrl;
this.customSendUrl = customSendUrl;
this.mediaUploadUrl = mediaUploadUrl;
this.qrcodeCreateUrl = qrcodeCreateUrl;
this.userInfoUrl = userInfoUrl;
this.userGetUrl = userGetUrl;
this.groupsCreateUrl = groupsCreateUrl;
this.groupsGetUrl = groupsGetUrl;
this.groupsGetIdUrl = groupsGetIdUrl;
this.groupsUpdateUrl = groupsUpdateUrl;
this.groupsMembersUpdateUrl = groupsMembersUpdateUrl;
}
@Override
public String toString() {
return "WxConfig [token=" + token + ", appid=" + appid + ", appsecret="
+ appsecret + ", menuCreateUrl=" + menuCreateUrl
+ ", menuGetUrl=" + menuGetUrl + ", menuDeleteUrl="
+ menuDeleteUrl + ", accessTokenCreateUrl="
+ accessTokenCreateUrl + ", customSendUrl=" + customSendUrl
+ ", mediaUploadUrl=" + mediaUploadUrl + ", qrcodeCreateUrl="
+ qrcodeCreateUrl + ", userInfoUrl=" + userInfoUrl
+ ", userGetUrl=" + userGetUrl + ", groupsCreateUrl="
+ groupsCreateUrl + ", groupsGetUrl=" + groupsGetUrl
+ ", groupsGetIdUrl=" + groupsGetIdUrl + ", groupsUpdateUrl="
+ groupsUpdateUrl + ", groupsMembersUpdateUrl="
+ groupsMembersUpdateUrl + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime
* result
+ ((accessTokenCreateUrl == null) ? 0 : accessTokenCreateUrl
.hashCode());
result = prime * result + ((appid == null) ? 0 : appid.hashCode());
result = prime * result
+ ((appsecret == null) ? 0 : appsecret.hashCode());
result = prime * result
+ ((customSendUrl == null) ? 0 : customSendUrl.hashCode());
result = prime * result
+ ((groupsCreateUrl == null) ? 0 : groupsCreateUrl.hashCode());
result = prime * result
+ ((groupsGetIdUrl == null) ? 0 : groupsGetIdUrl.hashCode());
result = prime * result
+ ((groupsGetUrl == null) ? 0 : groupsGetUrl.hashCode());
result = prime
* result
+ ((groupsMembersUpdateUrl == null) ? 0
: groupsMembersUpdateUrl.hashCode());
result = prime * result
+ ((groupsUpdateUrl == null) ? 0 : groupsUpdateUrl.hashCode());
result = prime * result
+ ((mediaUploadUrl == null) ? 0 : mediaUploadUrl.hashCode());
result = prime * result
+ ((menuCreateUrl == null) ? 0 : menuCreateUrl.hashCode());
result = prime * result
+ ((menuDeleteUrl == null) ? 0 : menuDeleteUrl.hashCode());
result = prime * result
+ ((menuGetUrl == null) ? 0 : menuGetUrl.hashCode());
result = prime * result
+ ((qrcodeCreateUrl == null) ? 0 : qrcodeCreateUrl.hashCode());
result = prime * result + ((token == null) ? 0 : token.hashCode());
result = prime * result
+ ((userGetUrl == null) ? 0 : userGetUrl.hashCode());
result = prime * result
+ ((userInfoUrl == null) ? 0 : userInfoUrl.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WxConfig other = (WxConfig) obj;
if (accessTokenCreateUrl == null) {
if (other.accessTokenCreateUrl != null)
return false;
} else if (!accessTokenCreateUrl.equals(other.accessTokenCreateUrl))
return false;
if (appid == null) {
if (other.appid != null)
return false;
} else if (!appid.equals(other.appid))
return false;
if (appsecret == null) {
if (other.appsecret != null)
return false;
} else if (!appsecret.equals(other.appsecret))
return false;
if (customSendUrl == null) {
if (other.customSendUrl != null)
return false;
} else if (!customSendUrl.equals(other.customSendUrl))
return false;
if (groupsCreateUrl == null) {
if (other.groupsCreateUrl != null)
return false;
} else if (!groupsCreateUrl.equals(other.groupsCreateUrl))
return false;
if (groupsGetIdUrl == null) {
if (other.groupsGetIdUrl != null)
return false;
} else if (!groupsGetIdUrl.equals(other.groupsGetIdUrl))
return false;
if (groupsGetUrl == null) {
if (other.groupsGetUrl != null)
return false;
} else if (!groupsGetUrl.equals(other.groupsGetUrl))
return false;
if (groupsMembersUpdateUrl == null) {
if (other.groupsMembersUpdateUrl != null)
return false;
} else if (!groupsMembersUpdateUrl.equals(other.groupsMembersUpdateUrl))
return false;
if (groupsUpdateUrl == null) {
if (other.groupsUpdateUrl != null)
return false;
} else if (!groupsUpdateUrl.equals(other.groupsUpdateUrl))
return false;
if (mediaUploadUrl == null) {
if (other.mediaUploadUrl != null)
return false;
} else if (!mediaUploadUrl.equals(other.mediaUploadUrl))
return false;
if (menuCreateUrl == null) {
if (other.menuCreateUrl != null)
return false;
} else if (!menuCreateUrl.equals(other.menuCreateUrl))
return false;
if (menuDeleteUrl == null) {
if (other.menuDeleteUrl != null)
return false;
} else if (!menuDeleteUrl.equals(other.menuDeleteUrl))
return false;
if (menuGetUrl == null) {
if (other.menuGetUrl != null)
return false;
} else if (!menuGetUrl.equals(other.menuGetUrl))
return false;
if (qrcodeCreateUrl == null) {
if (other.qrcodeCreateUrl != null)
return false;
} else if (!qrcodeCreateUrl.equals(other.qrcodeCreateUrl))
return false;
if (token == null) {
if (other.token != null)
return false;
} else if (!token.equals(other.token))
return false;
if (userGetUrl == null) {
if (other.userGetUrl != null)
return false;
} else if (!userGetUrl.equals(other.userGetUrl))
return false;
if (userInfoUrl == null) {
if (other.userInfoUrl != null)
return false;
} else if (!userInfoUrl.equals(other.userInfoUrl))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMediaType.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
public class WxMediaType {
public static final String VIDEO = "Video";
public static final String VOICE = "Voice";
public static final String MUSIC = "Music";
public static final String THUMB = "Thumb";
public static final String IMAGE = "Image";
public static final String PIC_DESC = "Article";
public static final String DEFAULT = "Default";
private WxMediaType() {
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMediaTypeEnum.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public enum WxMediaTypeEnum {
IMAGE(WxMediaType.IMAGE),
MUSIC(WxMediaType.MUSIC),
PIC_DESC(WxMediaType.PIC_DESC),
THUMB(WxMediaType.THUMB),
VIDEO(WxMediaType.VIDEO),
VOICE(WxMediaType.VOICE),
DEFAULT(WxMediaType.DEFAULT),
;
/**
* @param text
*/
WxMediaTypeEnum(final String text) {
this._text = text;
}
private final String _text;
/*
* (non-Javadoc)
*
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return _text;
}
public static WxMediaTypeEnum inst(String strVal) {
for (WxMediaTypeEnum type : WxMediaTypeEnum.values()) {
if (type.toString().equalsIgnoreCase(strVal)) {
return type;
}
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMenuBtnType.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
public class WxMenuBtnType {
public static final String VIEW = "view";
public static final String CLICK = "click";
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMenuBtnTypeEnum.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public enum WxMenuBtnTypeEnum {
VIEW(WxMenuBtnType.VIEW), CLICK(WxMenuBtnType.CLICK);
/**
* @param text
*/
WxMenuBtnTypeEnum(final String text) {
this._text = text;
}
private final String _text;
/*
* (non-Javadoc)
*
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return _text;
}
public static WxMenuBtnTypeEnum inst(String strVal) {
for (WxMenuBtnTypeEnum type : WxMenuBtnTypeEnum.values()) {
if (type.toString().equalsIgnoreCase(strVal)) {
return type;
}
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgEventType.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class WxMsgEventType {
public static final String SUBSCRIBE = "subscribe";
public static final String UNSUBSCRIBE = "unsubscribe";
public static final String SCAN = "scan";
public static final String LOCATION = "LOCATION"; // wtf??
public static final String CLICK = "CLICK"; // wtf??
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgEventTypeEnum.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
public enum WxMsgEventTypeEnum {
SUBSCRIBE(WxMsgEventType.SUBSCRIBE),
UNSUBSCRIBE(WxMsgEventType.UNSUBSCRIBE),
SCAN(WxMsgEventType.SCAN),
LOCATION(WxMsgEventType.LOCATION),
CLICK(WxMsgEventType.CLICK);
/**
* @param text
*/
WxMsgEventTypeEnum(final String text) {
this._text = text;
}
private final String _text;
/*
* (non-Javadoc)
*
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return _text;
}
public static WxMsgEventTypeEnum inst(String strVal) {
for (WxMsgEventTypeEnum type : WxMsgEventTypeEnum.values()) {
if (type.toString().equalsIgnoreCase(strVal)) {
return type;
}
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgRespType.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
public class WxMsgRespType {
public static final String TEXT = "text";
public static final String IMAGE = "image";
public static final String VOICE = "voice";
public static final String VIDEO = "video";
public static final String MUSIC = "music";
public static final String NEWS = "news";
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgRespTypeEnum.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
public enum WxMsgRespTypeEnum {
TEXT(WxMsgRespType.TEXT), IMAGE(WxMsgRespType.IMAGE), MUSIC(WxMsgRespType.MUSIC),
NEWS(WxMsgRespType.NEWS), VIDEO(WxMsgRespType.VIDEO), VOICE(WxMsgRespType.VOICE);
/**
* @param text
*/
private WxMsgRespTypeEnum(final String text) {
this._text = text;
}
private final String _text;
/*
* (non-Javadoc)
*
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return _text;
}
public static WxMsgRespTypeEnum inst(String strVal) {
for (WxMsgRespTypeEnum type : WxMsgRespTypeEnum.values()) {
if (type.toString().equalsIgnoreCase(strVal)) {
return type;
}
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgType.java
================================================
/**
*
*/
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class WxMsgType {
public static final String TEXT = "text";
public static final String IMAGE = "image";
public static final String LOCATION = "location";
public static final String LINK = "link";
public static final String EVENT = "event";
public static final String VIDEO = "video";
public static final String VOICE = "voice";
}
================================================
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgTypeEnum.java
================================================
package org.hamster.weixinmp.constant;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public enum WxMsgTypeEnum {
TEXT(WxMsgType.TEXT), IMAGE(WxMsgType.IMAGE), LOCATION(WxMsgType.LOCATION),
LINK(WxMsgType.LINK), EVENT(WxMsgType.EVENT), VIDEO(WxMsgType.VIDEO), VOICE(WxMsgType.VOICE);
/**
* @param text
*/
private WxMsgTypeEnum(final String text) {
this._text = text;
}
private final String _text;
/*
* (non-Javadoc)
*
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return _text;
}
public static WxMsgTypeEnum inst(String strVal) {
for (WxMsgTypeEnum type : WxMsgTypeEnum.values()) {
if (type.toString().equalsIgnoreCase(strVal)) {
return type;
}
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/controller/WxController.java
================================================
/**
*
*/
package org.hamster.weixinmp.controller;
import org.apache.log4j.Logger;
import org.dom4j.DocumentException;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.service.WxAuthService;
import org.hamster.weixinmp.service.WxMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Controller
@RequestMapping("/rest/weixinmp")
public class WxController {
private static final Logger log = Logger.getLogger(WxController.class);
@Autowired
private WxAuthService authService;
@Autowired
private WxMessageService messageService;
@RequestMapping(method = {RequestMethod.GET,})
public @ResponseBody
String authGet(@RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce,
@RequestParam("echostr") String echostr) throws WxException {
if (authService.validateAuth(signature, timestamp, nonce, echostr)) {
log.info("received authentication message from Weixin Server.");
return echostr;
}
return null;
}
@RequestMapping(method = RequestMethod.POST)
public @ResponseBody
String post(@RequestBody String requestBody) throws DocumentException, WxException {
WxBaseMsgEntity msg = messageService.parseXML(requestBody);
log.info("received " + msg.getMsgType() + " message.");
WxBaseRespEntity resp = messageService.handleMessage(msg);
return messageService.parseRespXML(resp).asXML();
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/controller/util/WxJsonUtil.java
================================================
/**
*
*/
package org.hamster.weixinmp.controller.util;
import java.util.List;
import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity;
import org.hamster.weixinmp.model.WxAccessTokenJson;
import org.hamster.weixinmp.model.WxRespCode;
import org.hamster.weixinmp.model.menu.WxMenuCreateJson;
import com.google.gson.Gson;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
public class WxJsonUtil {
private WxJsonUtil() {
}
public static final String toMenuCreateReqBody(List<WxMenuBtnEntity> wxMenuBtnList) {
Gson gson = new Gson();
WxMenuCreateJson wxMenuCreateJson = new WxMenuCreateJson();
wxMenuCreateJson.setButton(wxMenuBtnList);
return gson.toJson(wxMenuCreateJson);
}
public static final WxRespCode toWxErrorJson(String errorResult) {
if (errorResult != null && (errorResult.startsWith("{\"errcode")
|| errorResult.startsWith("{\"errmsg"))) {
return new Gson().fromJson(errorResult, WxRespCode.class);
}
return null;
}
public static final WxAccessTokenJson toAccessTokenJson(String result) {
return new Gson().fromJson(result, WxAccessTokenJson.class);
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/controller/util/WxXmlUtil.java
================================================
/**
*
*/
package org.hamster.weixinmp.controller.util;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.hamster.weixinmp.constant.WxMsgTypeEnum;
import org.hamster.weixinmp.dao.entity.auth.WxAuthReq;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemImageEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemPicDescEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemThumbEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVideoEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVoiceEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgEventEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLinkEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLocEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgTextEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgVideoEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgVoiceEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespMusicEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespTextEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespVideoEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespVoiceEntity;
import org.hamster.weixinmp.util.WxUtil;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public class WxXmlUtil {
private WxXmlUtil() {
}
public static WxAuthReq getAuthReq(String signature, String timestamp,
String nonce, String echostr) {
WxAuthReq result = new WxAuthReq();
result.setSignature(signature);
result.setTimestamp(timestamp);
result.setNonce(nonce);
result.setEchostr(echostr);
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></
* FromUserName> <br />
* <CreateTime>1348831860</CreateTime><br />
* <MsgType><![CDATA[text]]></MsgType><br />
* <Content><![CDATA[this is a
* test]]></Content><br />
* <MsgId>1234567890123456</MsgId><br />
* </xml><br />
* </code>
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgTextEntity getMsgText(Element ele) throws DocumentException {
WxMsgTextEntity result = msgEntityFactory(WxMsgTextEntity.class, ele);
result.setMsgId(longVal(ele, "MsgId"));
result.setContent(strVal(ele, "Content"));
return result;
}
/**
* <code>
* <xml>
* <ToUserName><![CDATA[toUser]]></ToUserName>
* <FromUserName><![CDATA[fromUser]]></FromUserName>
* <CreateTime>1348831860</CreateTime>
* <MsgType><![CDATA[image]]></MsgType>
* <PicUrl><![CDATA[this is a url]]></PicUrl>
* <MediaId><![CDATA[media_id]]></MediaId>
* <MsgId>1234567890123456</MsgId>
* </xml>
* </code>
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgImageEntity getMsgImage(Element ele) throws DocumentException {
WxMsgImageEntity result = msgEntityFactory(WxMsgImageEntity.class, ele);
WxItemImageEntity image = new WxItemImageEntity();
image.setMediaId(strVal(ele, "MediaId"));
image.setPicUrl(strVal(ele, "PicUrl"));
result.setImage(image);
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>1357290913</CreateTime><br />
* <MsgType><![CDATA[voice]]></MsgType><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* <Format><![CDATA[Format]]></Format><br />
* <MsgId>1234567890123456</MsgId><br />
* </xml>
* </code>
*
* @param ele
* @return
* @throws DocumentException
*/
public static WxMsgVoiceEntity getMsgVoice(Element ele) throws DocumentException {
WxMsgVoiceEntity result = msgEntityFactory(WxMsgVideoEntity.class, ele);
WxItemVoiceEntity voice = new WxItemVoiceEntity();
voice.setMediaId(strVal(ele, "MediaId"));
voice.setFormat(strVal(ele, "Format"));
if (!StringUtils.isEmpty(ele.elementText("Recognition"))) {
voice.setRecognition(strVal(ele, "Recognition"));
}
result.setVoice(voice);
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>1357290913</CreateTime><br />
* <MsgType><![CDATA[video]]></MsgType><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* <ThumbMediaId><![CDATA[thumb_media_id]]></ThumbMediaId><br />
* <MsgId>1234567890123456</MsgId><br />
* </xml>
* </code>
* @param ele
* @return
* @throws DocumentException
*/
public static WxMsgVideoEntity getMsgVideo(Element ele) throws DocumentException {
WxMsgVideoEntity result = msgEntityFactory(WxMsgVideoEntity.class, ele);
WxItemVideoEntity video = new WxItemVideoEntity();
video.setMediaId(strVal(ele, "MediaId"));
WxItemThumbEntity thumb = new WxItemThumbEntity();
thumb.setMediaId(strVal(ele, "ThumbMediaId"));
video.setThumb(thumb);
result.setVideo(video);
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>1351776360</CreateTime><br />
* <MsgType><![CDATA[location]]></MsgType><br />
* <Location_X>23.134521</Location_X><br />
* <Location_Y>113.358803</Location_Y><br />
* <Scale>20</Scale><br />
* <Label><![CDATA[Location Information]]></Label><br />
* <MsgId>1234567890123456</MsgId><br />
* </xml>
* </code>
*
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgLocEntity getMsgLoc(Element ele) throws DocumentException {
WxMsgLocEntity result = msgEntityFactory(WxMsgLocEntity.class, ele);
result.setLabel(strVal(ele, "Label"));
result.setLocationX(doubleVal(ele, "Location_X"));
result.setLocationY(doubleVal(ele, "Location_Y"));
result.setScale(doubleVal(ele, "Scale"));
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>1351776360</CreateTime><br />
* <MsgType><![CDATA[link]]></MsgType><br />
* <Title><![CDATA[公众平台官网链接]]></Title><br />
* <Description><![CDATA[公众平台官网链接]]></Description><br />
* <Url><![CDATA[url]]></Url><br />
* <MsgId>1234567890123456</MsgId><br />
* </xml>
* </code>
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgLinkEntity getMsgLink(Element ele) throws DocumentException {
WxMsgLinkEntity result = msgEntityFactory(WxMsgLinkEntity.class, ele);
result.setTitle(strVal(ele, "Title"));
result.setDescription(strVal(ele, "Description"));
result.setUrl(strVal(ele, "Url"));
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[FromUser]]></FromUserName><br />
* <CreateTime>123456789</CreateTime><br />
* <MsgType><![CDATA[event]]></MsgType><br />
* <Event><![CDATA[EVENT]]></Event><br />
* <EventKey><![CDATA[EVENTKEY]]></EventKey><br />
* </xml>
* </code>
*
* @param xmlstr
* @return
* @throws DocumentException
*/
public static WxMsgEventEntity getMsgEvent(Element ele) throws DocumentException {
WxMsgEventEntity result = msgEntityFactory(WxMsgEventEntity.class, ele);
result.setEvent(strVal(ele, "Event"));
if (ele.elementText("EventKey") != null) {
result.setEventKey(strVal(ele, "EventKey"));
}
if (ele.elementText("Ticket") != null) {
result.setEventKey(strVal(ele, "Ticket"));
}
return result;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[text]]></MsgType><br />
* <Content><![CDATA[content]]></Content><br />
* <FuncFlag>0</FuncFlag><br />
* </xml>
* </code>
*
* @param respText
* @return
* @throws DocumentException
*/
public static Element getRespTextXML(WxRespTextEntity respText) throws DocumentException {
Element ele = respEntityFactory(respText);
ele.addElement("Content").addCDATA(respText.getContent());
return ele;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[image]]></MsgType><br />
* <Image><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* </Image><br />
* </xml><br />
* </code>
*
* @param respImage
* @return
* @throws DocumentException
*/
public static Element getRespImage(WxRespImageEntity respImage) throws DocumentException {
Element ele = respEntityFactory(respImage);
Element imageEle = ele.addElement("Image");
imageEle.addElement("MediaId").addCDATA(respImage.getImage().getMediaId());
return ele;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[voice]]></MsgType><br />
* <Voice><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* </Voice><br />
* </xml><br />
* </code>
*
* @param respVoice
* @return
* @throws DocumentException
*/
public static Element getRespVoice(WxRespVoiceEntity respVoice) throws DocumentException {
Element ele = respEntityFactory(respVoice);
Element voiceEle = ele.addElement("Voice");
voiceEle.addElement("MediaId").addCDATA(respVoice.getVoice().getMediaId());
return ele;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[video]]></MsgType><br />
* <Video><br />
* <MediaId><![CDATA[media_id]]></MediaId><br />
* <Title><![CDATA[title]]></Title><br />
* <Description><![CDATA[description]]></Description><br />
* </Video><br />
* </xml><br />
* </code>
*
* @param respVideo
* @return
* @throws DocumentException
*/
public static Element getRespVideo(WxRespVideoEntity respVideo) throws DocumentException {
Element ele = respEntityFactory(respVideo);
Element videoEle = ele.addElement("Video");
videoEle.addElement("MediaId").addCDATA(respVideo.getVideo().getMediaId());
videoEle.addElement("Title").addCDATA(StringUtils.defaultString(respVideo.getVideo().getTitle()));
videoEle.addElement("Description").addCDATA(StringUtils.defaultString(respVideo.getVideo().getDescription()));
return ele;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[music]]></MsgType><br />
* <Music><br />
* <Title><![CDATA[TITLE]]></Title><br />
* <Description><![CDATA[DESCRIPTION]]></Description><br />
* <MusicUrl><![CDATA[MUSIC_Url]]></MusicUrl><br />
* <HQMusicUrl><![CDATA[HQ_MUSIC_Url]]></HQMusicUrl><br />
* <ThumbMediaId><![CDATA[media_id]]></ThumbMediaId><br />
* </Music><br />
* <FuncFlag>0</FuncFlag><br />
* </xml>
* </code>
*
* @param respMusic
* @return
* @throws DocumentException
*/
public static Element getRespMusic(WxRespMusicEntity respMusic, WxItemThumbEntity thumb) throws DocumentException {
Element ele = respEntityFactory(respMusic);
Element musicEle = ele.addElement("Music");
musicEle.addElement("Title").addCDATA(StringUtils.defaultString(respMusic.getMusic().getTitle()));
musicEle.addElement("Description").addCDATA(StringUtils.defaultString(respMusic.getMusic().getDescription()));
musicEle.addElement("MusicUrl").addCDATA(StringUtils.defaultString(respMusic.getMusic().getMusicUrl()));
musicEle.addElement("HQMusicUrl").addCDATA(StringUtils.defaultString(respMusic.getMusic().getHqMusicUrl()));
musicEle.addElement("ThumbMediaId").addCDATA(thumb.getMediaId());
return ele;
}
/**
* <code>
* <xml><br />
* <ToUserName><![CDATA[toUser]]></ToUserName><br />
* <FromUserName><![CDATA[fromUser]]></FromUserName><br />
* <CreateTime>12345678</CreateTime><br />
* <MsgType><![CDATA[news]]></MsgType><br />
* <ArticleCount>2</ArticleCount><br />
* <Articles><br />
* <item><br />
* <Title><![CDATA[title1]]></Title><br />
* <Description><![CDATA[description1]]></Description><br />
* <PicUrl><![CDATA[picurl]]></PicUrl><br />
* <Url><![CDATA[url]]></Url><br />
* </item><br />
* <item><br />
* <Title><![CDATA[title]]></Title><br />
* <Description><![CDATA[description]]></Description><br />
* <PicUrl><![CDATA[picurl]]></PicUrl><br />
* <Url><![CDATA[url]]></Url><br />
* </item><br />
* </Articles><br />
* <FuncFlag>1</FuncFlag><br />
* </xml>
* </code>
*
* @param respPicDesc
* @return
* @throws DocumentException
*/
public static Element getRespPicDesc(WxRespPicDescEntity respPicDesc) throws DocumentException {
Element ele = respEntityFactory(respPicDesc);
ele.addElement("ArticleCount").addText(String.valueOf(respPicDesc.getArticles().size()));
Element articlesEle = ele.addElement("Articles");
for (WxItemPicDescEntity item : respPicDesc.getArticles()) {
Element itemEle = articlesEle.addElement("item");
itemEle.addElement("Title").addCDATA(item.getTitle());
itemEle.addElement("Description").addCDATA(item.getDescription());
itemEle.addElement("PicUrl").addCDATA(item.getPicUrl());
itemEle.addElement("HQMusicUrl").addCDATA(item.getUrl());
}
return ele;
}
public static Element toXML(String xmlstr) throws DocumentException {
Document doc = DocumentHelper.parseText(xmlstr);
return doc.getRootElement();
}
public static WxMsgTypeEnum getReqType(Element ele) {
String type = ele.element("MsgType").getTextTrim();
return WxMsgTypeEnum.inst(type);
}
//////////////////////////////////////////////////
// Private Methods //
//////////////////////////////////////////////////
@SuppressWarnings("unchecked")
private static <T> T msgEntityFactory(
Class<? extends WxBaseMsgEntity> clazz, Element ele) {
WxBaseMsgEntity result;
try {
result = clazz.newInstance();
result.setToUserName(strVal(ele, "ToUserName"));
result.setFromUserName(strVal(ele, "FromUserName"));
result.setCreateTime(longVal(ele, "CreateTime"));
result.setCreatedDate(new Date());
result.setMsgType(strVal(ele, "MsgType"));
if (ele.element("MsgId") != null) {
result.setMsgId(longVal(ele, "MsgId"));
}
return (T) result;
} catch (Exception e) {
// never occurs
return null;
}
}
private static Element respEntityFactory(WxBaseRespEntity entity) {
Element ele = DocumentHelper.createElement("xml");
ele.addElement("ToUserName").addCDATA(entity.getToUserName());
ele.addElement("FromUserName").addCDATA(entity.getFromUserName());
String createTime = String.valueOf(entity.getCreateTime());
if (StringUtils.isBlank(createTime)) {
Long currentTime = WxUtil.currentTimeInSec();
entity.setCreateTime(currentTime);
createTime = String.valueOf(currentTime);
}
ele.addElement("CreateTime").setText(createTime);
ele.addElement("MsgType").addCDATA(entity.getMsgType());
ele.addElement("FuncFlag").setText(String.valueOf(entity.getFuncFlag()));
return ele;
}
private static String strVal(Element ele, String name) {
return ele.element(name).getStringValue();
}
private static Long longVal(Element ele, String name) {
return Long.valueOf(ele.element(name).getStringValue());
}
private static Double doubleVal(Element ele, String name) {
return Double.valueOf(ele.element(name).getStringValue());
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuth.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.auth;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
import com.google.gson.annotations.SerializedName;
/**
*
*
* @author honey.zhao@aliyun.com
* @version Aug 3, 2013
*
*/
@Entity
@Table(name = "wx_auth")
public class WxAuth extends WxBaseEntity {
@Column(name = "grant_type", length = 50, nullable = false)
private String grantType;
@Column(name = "appid", length = 100, nullable = false)
private String appid;
@Column(name = "secret", length = 100, nullable = false)
private String secret;
@SerializedName("access_token")
@Column(name = "access_token", length = 200, nullable = false)
private String accessToken;
@SerializedName("expires_in")
@Column(name = "expires_in", nullable = false)
private Long expiresIn;
public String getGrantType() {
return grantType;
}
public void setGrantType(String grantType) {
this.grantType = grantType;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public Long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
}
public WxAuth() {
super();
// TODO Auto-generated constructor stub
}
public WxAuth(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxAuth(String grantType, String appid, String secret,
String accessToken, Long expiresIn) {
super();
this.grantType = grantType;
this.appid = appid;
this.secret = secret;
this.accessToken = accessToken;
this.expiresIn = expiresIn;
}
@Override
public String toString() {
return "WxAuth [grantType=" + grantType + ", appid=" + appid
+ ", secret=" + secret + ", accessToken=" + accessToken
+ ", expiresIn=" + expiresIn + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((accessToken == null) ? 0 : accessToken.hashCode());
result = prime * result + ((appid == null) ? 0 : appid.hashCode());
result = prime * result
+ ((expiresIn == null) ? 0 : expiresIn.hashCode());
result = prime * result
+ ((grantType == null) ? 0 : grantType.hashCode());
result = prime * result + ((secret == null) ? 0 : secret.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxAuth other = (WxAuth) obj;
if (accessToken == null) {
if (other.accessToken != null)
return false;
} else if (!accessToken.equals(other.accessToken))
return false;
if (appid == null) {
if (other.appid != null)
return false;
} else if (!appid.equals(other.appid))
return false;
if (expiresIn == null) {
if (other.expiresIn != null)
return false;
} else if (!expiresIn.equals(other.expiresIn))
return false;
if (grantType == null) {
if (other.grantType != null)
return false;
} else if (!grantType.equals(other.grantType))
return false;
if (secret == null) {
if (other.secret != null)
return false;
} else if (!secret.equals(other.secret))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuthReq.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.auth;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 27, 2013
*/
@Entity
@Table(name = "wx_auth_req")
public class WxAuthReq extends WxBaseEntity {
@Column(name = "signature", length = 100, nullable = false)
private String signature;
@Column(name = "timestamp", length = 50, nullable = false)
private String timestamp;
@Column(name = "nonce", length = 50, nullable = false)
private String nonce;
@Column(name = "echostr", length = 200, nullable = false)
private String echostr;
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
public String getNonce() {
return nonce;
}
public void setNonce(String nonce) {
this.nonce = nonce;
}
public String getEchostr() {
return echostr;
}
public void setEchostr(String echostr) {
this.echostr = echostr;
}
public WxAuthReq() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "WxAuthReq [signature=" + signature + ", timestamp=" + timestamp
+ ", nonce=" + nonce + ", echostr=" + echostr + "]";
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.base;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @author honey.zhao@aliyun.com
* @version Jul 27, 2013
*
*/
@MappedSuperclass
public abstract class WxBaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose(serialize = false, deserialize = false)
@SerializedName("_id")
protected Long id;
@Column(name = "created_date")
@Expose(serialize = false, deserialize = false)
@SerializedName("_createddate")
protected Date createdDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public WxBaseEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxBaseEntity(Long id, Date createdDate) {
super();
this.id = id;
this.createdDate = createdDate;
}
@Override
public String toString() {
return "WxBaseEntity [id=" + id + ", createdDate=" + createdDate + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((createdDate == null) ? 0 : createdDate.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WxBaseEntity other = (WxBaseEntity) obj;
if (createdDate == null) {
if (other.createdDate != null)
return false;
} else if (!createdDate.equals(other.createdDate))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseItemMediaEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.base;
import javax.persistence.MappedSuperclass;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@MappedSuperclass
public class WxBaseItemMediaEntity extends WxBaseEntity {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseMsgEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.base;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_base")
@DiscriminatorColumn(name = "msg_type", length = 20)
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class WxBaseMsgEntity extends WxBaseEntity {
@Column(name = "to_user_name", length = WxConfig.COL_LEN_USER_NAME, nullable = false)
protected String toUserName;
@Column(name = "from_user_name", length = WxConfig.COL_LEN_USER_NAME, nullable = false)
protected String fromUserName;
@Column(name = "create_time", nullable = false)
protected Long createTime;
@Column(name = "msg_type", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
protected String msgType;
@Column(name = "msg_id", nullable = true)
protected Long msgId;
public String getToUserName() {
return toUserName;
}
public void setToUserName(String toUserName) {
this.toUserName = toUserName;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public Long getMsgId() {
return msgId;
}
public void setMsgId(Long msgId) {
this.msgId = msgId;
}
public WxBaseMsgEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super();
this.toUserName = toUserName;
this.fromUserName = fromUserName;
this.createTime = createTime;
this.msgType = msgType;
this.msgId = msgId;
}
public WxBaseMsgEntity() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "WxBaseMsgEntity [toUserName=" + toUserName + ", fromUserName="
+ fromUserName + ", createTime=" + createTime + ", msgType="
+ msgType + ", msgId=" + msgId + "]";
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseRespEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.base;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import org.hamster.weixinmp.config.WxConfig;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@MappedSuperclass
public abstract class WxBaseRespEntity extends WxBaseEntity {
@Column(name="func_flag", nullable = false)
protected Integer funcFlag;
@Column(name = "to_user_name", length = WxConfig.COL_LEN_USER_NAME, nullable = false)
protected String toUserName;
@Column(name = "from_user_name", length = WxConfig.COL_LEN_USER_NAME, nullable = false)
protected String fromUserName;
@Column(name = "create_time", nullable = false)
protected Long createTime;
@Column(name = "msg_type", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
protected String msgType;
public WxBaseRespEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxBaseRespEntity(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxBaseRespEntity(Integer funcFlag, String toUserName,
String fromUserName, Long createTime, String msgType) {
super();
this.funcFlag = funcFlag;
this.toUserName = toUserName;
this.fromUserName = fromUserName;
this.createTime = createTime;
this.msgType = msgType;
}
@Override
public String toString() {
return "WxBaseRespEntity [funcFlag=" + funcFlag + ", toUserName="
+ toUserName + ", fromUserName=" + fromUserName
+ ", createTime=" + createTime + ", msgType=" + msgType + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((createTime == null) ? 0 : createTime.hashCode());
result = prime * result
+ ((fromUserName == null) ? 0 : fromUserName.hashCode());
result = prime * result
+ ((funcFlag == null) ? 0 : funcFlag.hashCode());
result = prime * result + ((msgType == null) ? 0 : msgType.hashCode());
result = prime * result
+ ((toUserName == null) ? 0 : toUserName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxBaseRespEntity other = (WxBaseRespEntity) obj;
if (createTime == null) {
if (other.createTime != null)
return false;
} else if (!createTime.equals(other.createTime))
return false;
if (fromUserName == null) {
if (other.fromUserName != null)
return false;
} else if (!fromUserName.equals(other.fromUserName))
return false;
if (funcFlag == null) {
if (other.funcFlag != null)
return false;
} else if (!funcFlag.equals(other.funcFlag))
return false;
if (msgType == null) {
if (other.msgType != null)
return false;
} else if (!msgType.equals(other.msgType))
return false;
if (toUserName == null) {
if (other.toUserName != null)
return false;
} else if (!toUserName.equals(other.toUserName))
return false;
return true;
}
public Integer getFuncFlag() {
return funcFlag;
}
public void setFuncFlag(Integer funcFlag) {
this.funcFlag = funcFlag;
}
public String getToUserName() {
return toUserName;
}
public void setToUserName(String toUserName) {
this.toUserName = toUserName;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemImageEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name=WxConfig.TABLE_PREFIX + "item_image")
public class WxItemImageEntity extends WxBaseItemMediaEntity {
@Column(name = "media_id", length = WxConfig.COL_LEN_INDICATOR, nullable = true)
private String mediaId;
@Column(name="pic_url", length=WxConfig.COL_LEN_URL, nullable=true)
private String picUrl;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public WxItemImageEntity(String mediaId, String picUrl) {
super();
this.mediaId = mediaId;
this.picUrl = picUrl;
}
public WxItemImageEntity() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "WxItemImageEntity [mediaId=" + mediaId + ", picUrl=" + picUrl
+ "]";
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemMusicEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name=WxConfig.TABLE_PREFIX + "item_music")
public class WxItemMusicEntity extends WxBaseItemMediaEntity {
@Column(name = "media_id", length = WxConfig.COL_LEN_INDICATOR, nullable = true)
private String mediaId;
@Column(name="title", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String title;
@Column(name="description", length = WxConfig.COL_LEN_CONTENT, nullable = true)
private String description;
@Column(name="music_url", length = WxConfig.COL_LEN_URL, nullable = true)
private String musicUrl;
@Column(name="hq_music_url", length = WxConfig.COL_LEN_URL, nullable = true)
private String hqMusicUrl;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMusicUrl() {
return musicUrl;
}
public void setMusicUrl(String musicUrl) {
this.musicUrl = musicUrl;
}
public String getHqMusicUrl() {
return hqMusicUrl;
}
public void setHqMusicUrl(String hqMusicUrl) {
this.hqMusicUrl = hqMusicUrl;
}
public WxItemMusicEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxItemMusicEntity(String mediaId, String title, String description,
String musicUrl, String hqMusicUrl) {
super();
this.mediaId = mediaId;
this.title = title;
this.description = description;
this.musicUrl = musicUrl;
this.hqMusicUrl = hqMusicUrl;
}
@Override
public String toString() {
return "WxItemMusicEntity [mediaId=" + mediaId + ", title=" + title
+ ", description=" + description + ", musicUrl=" + musicUrl
+ ", hqMusicUrl=" + hqMusicUrl + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result
+ ((hqMusicUrl == null) ? 0 : hqMusicUrl.hashCode());
result = prime * result + ((mediaId == null) ? 0 : mediaId.hashCode());
result = prime * result
+ ((musicUrl == null) ? 0 : musicUrl.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxItemMusicEntity other = (WxItemMusicEntity) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (hqMusicUrl == null) {
if (other.hqMusicUrl != null)
return false;
} else if (!hqMusicUrl.equals(other.hqMusicUrl))
return false;
if (mediaId == null) {
if (other.mediaId != null)
return false;
} else if (!mediaId.equals(other.mediaId))
return false;
if (musicUrl == null) {
if (other.musicUrl != null)
return false;
} else if (!musicUrl.equals(other.musicUrl))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemPicDescEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name=WxConfig.TABLE_PREFIX + "wx_item_pic_desc")
public class WxItemPicDescEntity extends WxBaseItemMediaEntity {
@Column(name="title", length = WxConfig.COL_LEN_TITLE, nullable = false)
private String title;
@Column(name="description", length = WxConfig.COL_LEN_CONTENT, nullable = false)
private String description;
@Column(name="pic_url", length = WxConfig.COL_LEN_URL, nullable = false)
private String picUrl;
@Column(name="url", length = WxConfig.COL_LEN_URL, nullable = false)
private String url;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public WxItemPicDescEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxItemPicDescEntity(String title, String description, String picUrl,
String url) {
super();
this.title = title;
this.description = description;
this.picUrl = picUrl;
this.url = url;
}
@Override
public String toString() {
return "WxItemPicDescEntity [title=" + title + ", description="
+ description + ", picUrl=" + picUrl + ", url=" + url + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + ((picUrl == null) ? 0 : picUrl.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxItemPicDescEntity other = (WxItemPicDescEntity) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (picUrl == null) {
if (other.picUrl != null)
return false;
} else if (!picUrl.equals(other.picUrl))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (url == null) {
if (other.url != null)
return false;
} else if (!url.equals(other.url))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemThumbEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name=WxConfig.TABLE_PREFIX + "item_thumb")
public class WxItemThumbEntity extends WxBaseItemMediaEntity {
@Column(name = "media_id", length = WxConfig.COL_LEN_INDICATOR, nullable = true)
private String mediaId;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public WxItemThumbEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxItemThumbEntity(String mediaId) {
super();
this.mediaId = mediaId;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((mediaId == null) ? 0 : mediaId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxItemThumbEntity other = (WxItemThumbEntity) obj;
if (mediaId == null) {
if (other.mediaId != null)
return false;
} else if (!mediaId.equals(other.mediaId))
return false;
return true;
}
@Override
public String toString() {
return "WxItemThumbEntity [mediaId=" + mediaId + "]";
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVideoEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "item_video")
public class WxItemVideoEntity extends WxBaseItemMediaEntity {
@Column(name = "media_id", length = WxConfig.COL_LEN_INDICATOR, nullable = true)
private String mediaId;
@Column(name = "title", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String title;
@Column(name = "description", length = WxConfig.COL_LEN_CONTENT, nullable = true)
private String description;
@ManyToOne
@JoinColumn(name = "thumb_id", nullable = true)
WxItemThumbEntity thumb;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public WxItemThumbEntity getThumb() {
return thumb;
}
public void setThumb(WxItemThumbEntity thumb) {
this.thumb = thumb;
}
public WxItemVideoEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxItemVideoEntity(String mediaId, String title, String description,
WxItemThumbEntity thumb) {
super();
this.mediaId = mediaId;
this.title = title;
this.description = description;
this.thumb = thumb;
}
@Override
public String toString() {
return "WxItemVideoEntity [mediaId=" + mediaId + ", title=" + title
+ ", description=" + description + ", thumb=" + thumb + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + ((mediaId == null) ? 0 : mediaId.hashCode());
result = prime * result + ((thumb == null) ? 0 : thumb.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxItemVideoEntity other = (WxItemVideoEntity) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (mediaId == null) {
if (other.mediaId != null)
return false;
} else if (!mediaId.equals(other.mediaId))
return false;
if (thumb == null) {
if (other.thumb != null)
return false;
} else if (!thumb.equals(other.thumb))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVoiceEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.item;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name=WxConfig.TABLE_PREFIX + "item_voice")
public class WxItemVoiceEntity extends WxBaseItemMediaEntity {
@Column(name = "media_id", length = WxConfig.COL_LEN_INDICATOR, nullable = true)
private String mediaId;
@Column(name = "format", length = 10, nullable = true)
private String format;
@Column(name = "recognition", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String recognition;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getRecognition() {
return recognition;
}
public void setRecognition(String recognition) {
this.recognition = recognition;
}
public WxItemVoiceEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxItemVoiceEntity(String mediaId, String format, String recognition) {
super();
this.mediaId = mediaId;
this.format = format;
this.recognition = recognition;
}
@Override
public String toString() {
return "WxItemVoiceEntity [mediaId=" + mediaId + ", format=" + format
+ ", recognition=" + recognition + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((format == null) ? 0 : format.hashCode());
result = prime * result + ((mediaId == null) ? 0 : mediaId.hashCode());
result = prime * result
+ ((recognition == null) ? 0 : recognition.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxItemVoiceEntity other = (WxItemVoiceEntity) obj;
if (format == null) {
if (other.format != null)
return false;
} else if (!format.equals(other.format))
return false;
if (mediaId == null) {
if (other.mediaId != null)
return false;
} else if (!mediaId.equals(other.mediaId))
return false;
if (recognition == null) {
if (other.recognition != null)
return false;
} else if (!recognition.equals(other.recognition))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/menu/WxMenuBtnEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.menu;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "menu_btn")
public class WxMenuBtnEntity extends WxBaseEntity {
@Column(name = "key_", length = 128, nullable = false)
private String key;
@Column(name = "url", length = 256, nullable = false)
private String url;
@Column(name = "name", length = 80, nullable = false)
private String name;
@Column(name = "type", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String type;
@ManyToOne(cascade = { CascadeType.ALL })
@JoinColumn(name = "parent_button_id")
@Expose(serialize = false, deserialize = false)
private WxMenuBtnEntity parentButton;
@OneToMany(mappedBy = "parentButton")
@SerializedName("sub_button")
private List<WxMenuBtnEntity> subButtons;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public WxMenuBtnEntity getParentButton() {
return parentButton;
}
public void setParentButton(WxMenuBtnEntity parentButton) {
this.parentButton = parentButton;
}
public List<WxMenuBtnEntity> getSubButtons() {
return subButtons;
}
public void setSubButtons(List<WxMenuBtnEntity> subButtons) {
this.subButtons = subButtons;
}
public WxMenuBtnEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMenuBtnEntity(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxMenuBtnEntity(String key, String url, String name, String type,
WxMenuBtnEntity parentButton, List<WxMenuBtnEntity> subButtons) {
super();
this.key = key;
this.url = url;
this.name = name;
this.type = type;
this.parentButton = parentButton;
this.subButtons = subButtons;
}
@Override
public String toString() {
return "WxMenuBtnEntity [key=" + key + ", url=" + url + ", name="
+ name + ", type=" + type + ", parentButton=" + parentButton
+ ", subButtons=" + subButtons + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result
+ ((parentButton == null) ? 0 : parentButton.hashCode());
result = prime * result
+ ((subButtons == null) ? 0 : subButtons.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMenuBtnEntity other = (WxMenuBtnEntity) obj;
if (key == null) {
if (other.key != null)
return false;
} else if (!key.equals(other.key))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (parentButton == null) {
if (other.parentButton != null)
return false;
} else if (!parentButton.equals(other.parentButton))
return false;
if (subButtons == null) {
if (other.subButtons != null)
return false;
} else if (!subButtons.equals(other.subButtons))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
if (url == null) {
if (other.url != null)
return false;
} else if (!url.equals(other.url))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgEventEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_event")
public class WxMsgEventEntity extends WxBaseMsgEntity {
@Column(name = "event", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String event;
@Column(name = "event_key", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String eventKey;
@Column(name = "ticket", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String ticket;
@Column(name = "latitude", nullable = true)
private Double latitude;
@Column(name = "longitude", nullable = true)
private Double longitude;
@Column(name = "precisions", nullable = true)
private Double precisions;
public String getEvent() {
return event;
}
public void setEvent(String event) {
this.event = event;
}
public String getEventKey() {
return eventKey;
}
public void setEventKey(String eventKey) {
this.eventKey = eventKey;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getPrecisions() {
return precisions;
}
public void setPrecisions(Double precisions) {
this.precisions = precisions;
}
public WxMsgEventEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgEventEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgEventEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, String event,
String eventKey, String ticket, Double latitude, Double longitude,
Double precisions) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.event = event;
this.eventKey = eventKey;
this.ticket = ticket;
this.latitude = latitude;
this.longitude = longitude;
this.precisions = precisions;
}
@Override
public String toString() {
return "WxMsgEventEntity [event=" + event + ", eventKey=" + eventKey
+ ", ticket=" + ticket + ", latitude=" + latitude
+ ", longitude=" + longitude + ", precisions=" + precisions + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((event == null) ? 0 : event.hashCode());
result = prime * result
+ ((eventKey == null) ? 0 : eventKey.hashCode());
result = prime * result
+ ((latitude == null) ? 0 : latitude.hashCode());
result = prime * result
+ ((longitude == null) ? 0 : longitude.hashCode());
result = prime * result
+ ((precisions == null) ? 0 : precisions.hashCode());
result = prime * result + ((ticket == null) ? 0 : ticket.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgEventEntity other = (WxMsgEventEntity) obj;
if (event == null) {
if (other.event != null)
return false;
} else if (!event.equals(other.event))
return false;
if (eventKey == null) {
if (other.eventKey != null)
return false;
} else if (!eventKey.equals(other.eventKey))
return false;
if (latitude == null) {
if (other.latitude != null)
return false;
} else if (!latitude.equals(other.latitude))
return false;
if (longitude == null) {
if (other.longitude != null)
return false;
} else if (!longitude.equals(other.longitude))
return false;
if (precisions == null) {
if (other.precisions != null)
return false;
} else if (!precisions.equals(other.precisions))
return false;
if (ticket == null) {
if (other.ticket != null)
return false;
} else if (!ticket.equals(other.ticket))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgImageEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemImageEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_image")
@DiscriminatorValue(WxMsgType.IMAGE)
public class WxMsgImageEntity extends WxBaseMsgEntity {
@ManyToOne
@JoinColumn(name = "image_id")
private WxItemImageEntity image;
public WxItemImageEntity getImage() {
return image;
}
public void setImage(WxItemImageEntity image) {
this.image = image;
}
public WxMsgImageEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgImageEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgImageEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, WxItemImageEntity image) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.image = image;
}
@Override
public String toString() {
return "WxMsgImageEntity [image=" + image + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((image == null) ? 0 : image.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgImageEntity other = (WxMsgImageEntity) obj;
if (image == null) {
if (other.image != null)
return false;
} else if (!image.equals(other.image))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLinkEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_link")
@DiscriminatorValue(WxMsgType.LINK)
public class WxMsgLinkEntity extends WxBaseMsgEntity {
@Column(name = "title", length = WxConfig.COL_LEN_TITLE, nullable = false)
private String title;
@Column(name = "description", length = WxConfig.COL_LEN_CONTENT, nullable = false)
private String description;
@Column(name = "url", length = WxConfig.COL_LEN_URL, nullable = false)
private String url;
public WxMsgLinkEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgLinkEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgLinkEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, String title,
String description, String url) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.title = title;
this.description = description;
this.url = url;
}
@Override
public String toString() {
return "WxMsgLinkEntity [title=" + title + ", description="
+ description + ", url=" + url + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgLinkEntity other = (WxMsgLinkEntity) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (url == null) {
if (other.url != null)
return false;
} else if (!url.equals(other.url))
return false;
return true;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLocEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_loc")
@DiscriminatorValue(WxMsgType.LOCATION)
public class WxMsgLocEntity extends WxBaseMsgEntity {
@Column(name = "location_x", nullable = false)
private Double locationX;
@Column(name = "location_y", nullable = false)
private Double locationY;
@Column(name = "scale", nullable = false)
private Double scale;
@Column(name = "label", length = WxConfig.COL_LEN_TITLE, nullable = false)
private String label;
public Double getLocationX() {
return locationX;
}
public void setLocationX(Double locationX) {
this.locationX = locationX;
}
public Double getLocationY() {
return locationY;
}
public void setLocationY(Double locationY) {
this.locationY = locationY;
}
public Double getScale() {
return scale;
}
public void setScale(Double scale) {
this.scale = scale;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public WxMsgLocEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgLocEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgLocEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, Double locationX,
Double locationY, Double scale, String label) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.locationX = locationX;
this.locationY = locationY;
this.scale = scale;
this.label = label;
}
@Override
public String toString() {
return "WxMsgLocEntity [locationX=" + locationX + ", locationY="
+ locationY + ", scale=" + scale + ", label=" + label + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((label == null) ? 0 : label.hashCode());
result = prime * result
+ ((locationX == null) ? 0 : locationX.hashCode());
result = prime * result
+ ((locationY == null) ? 0 : locationY.hashCode());
result = prime * result + ((scale == null) ? 0 : scale.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgLocEntity other = (WxMsgLocEntity) obj;
if (label == null) {
if (other.label != null)
return false;
} else if (!label.equals(other.label))
return false;
if (locationX == null) {
if (other.locationX != null)
return false;
} else if (!locationX.equals(other.locationX))
return false;
if (locationY == null) {
if (other.locationY != null)
return false;
} else if (!locationY.equals(other.locationY))
return false;
if (scale == null) {
if (other.scale != null)
return false;
} else if (!scale.equals(other.scale))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgTextEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_text")
@DiscriminatorValue(WxMsgType.TEXT)
public class WxMsgTextEntity extends WxBaseMsgEntity {
@Column(name = "content", length = WxConfig.COL_LEN_CONTENT, nullable = false)
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public WxMsgTextEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgTextEntity(String content) {
super();
this.content = content;
}
@Override
public String toString() {
return "WxMsgTextEntity [content=" + content + "]";
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVideoEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVideoEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 24, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_video")
@DiscriminatorValue(WxMsgType.VIDEO)
public class WxMsgVideoEntity extends WxBaseMsgEntity {
@ManyToOne
@JoinColumn(name="video_id")
private WxItemVideoEntity video;
public WxItemVideoEntity getVideo() {
return video;
}
public void setVideo(WxItemVideoEntity video) {
this.video = video;
}
public WxMsgVideoEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgVideoEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgVideoEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, WxItemVideoEntity video) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.video = video;
}
@Override
public String toString() {
return "WxMsgVideoEntity [video=" + video + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((video == null) ? 0 : video.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgVideoEntity other = (WxMsgVideoEntity) obj;
if (video == null) {
if (other.video != null)
return false;
} else if (!video.equals(other.video))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVoiceEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.msg;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgType;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVoiceEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 24, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "msg_voice")
@DiscriminatorValue(WxMsgType.VOICE)
public class WxMsgVoiceEntity extends WxBaseMsgEntity {
@ManyToOne
@JoinColumn(name="voice_id")
WxItemVoiceEntity voice;
public WxItemVoiceEntity getVoice() {
return voice;
}
public void setVoice(WxItemVoiceEntity voice) {
this.voice = voice;
}
public WxMsgVoiceEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxMsgVoiceEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId) {
super(toUserName, fromUserName, createTime, msgType, msgId);
// TODO Auto-generated constructor stub
}
public WxMsgVoiceEntity(String toUserName, String fromUserName,
Long createTime, String msgType, Long msgId, WxItemVoiceEntity voice) {
super(toUserName, fromUserName, createTime, msgType, msgId);
this.voice = voice;
}
@Override
public String toString() {
return "WxMsgVoiceEntity [voice=" + voice + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((voice == null) ? 0 : voice.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxMsgVoiceEntity other = (WxMsgVoiceEntity) obj;
if (voice == null) {
if (other.voice != null)
return false;
} else if (!voice.equals(other.voice))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/qr/WxQrEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.qr;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
import com.google.gson.annotations.SerializedName;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "qr")
public class WxQrEntity extends WxBaseEntity {
@Column(name = "ticket", length = WxConfig.COL_LEN_TITLE, nullable = true)
private String ticket;
@Column(name = "scene", nullable = false)
private Long scene;
@Column(name = "expire_seconds", nullable = true)
@SerializedName("expire_seconds")
private Long expireSeconds;
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public Long getScene() {
return scene;
}
public void setScene(Long scene) {
this.scene = scene;
}
public Long getExpireSeconds() {
return expireSeconds;
}
public void setExpireSeconds(Long expireSeconds) {
this.expireSeconds = expireSeconds;
}
public WxQrEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxQrEntity(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxQrEntity(String ticket, Long scene, Long expireSeconds) {
super();
this.ticket = ticket;
this.scene = scene;
this.expireSeconds = expireSeconds;
}
@Override
public String toString() {
return "WxQrEntity [ticket=" + ticket + ", scene=" + scene
+ ", expireSeconds=" + expireSeconds + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((expireSeconds == null) ? 0 : expireSeconds.hashCode());
result = prime * result + ((scene == null) ? 0 : scene.hashCode());
result = prime * result + ((ticket == null) ? 0 : ticket.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxQrEntity other = (WxQrEntity) obj;
if (expireSeconds == null) {
if (other.expireSeconds != null)
return false;
} else if (!expireSeconds.equals(other.expireSeconds))
return false;
if (scene == null) {
if (other.scene != null)
return false;
} else if (!scene.equals(other.scene))
return false;
if (ticket == null) {
if (other.ticket != null)
return false;
} else if (!ticket.equals(other.ticket))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespImageEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemImageEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_music")
public class WxRespImageEntity extends WxBaseRespEntity {
@ManyToOne
@JoinColumn(name = "image_id")
WxItemImageEntity image;
public WxItemImageEntity getImage() {
return image;
}
public void setImage(WxItemImageEntity image) {
this.image = image;
}
public WxRespImageEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxRespImageEntity(WxItemImageEntity image) {
super();
this.image = image;
}
@Override
public String toString() {
return "WxRespImageEntity [image=" + image + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((image == null) ? 0 : image.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespImageEntity other = (WxRespImageEntity) obj;
if (image == null) {
if (other.image != null)
return false;
} else if (!image.equals(other.image))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespMusicEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemMusicEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemThumbEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_music")
public class WxRespMusicEntity extends WxBaseRespEntity {
@ManyToOne
@JoinColumn(name = "music_id", nullable = false)
private WxItemMusicEntity music;
@ManyToOne
@JoinColumn(name = "thumb_id", nullable = false)
private WxItemThumbEntity thumb;
public WxItemMusicEntity getMusic() {
return music;
}
public void setMusic(WxItemMusicEntity music) {
this.music = music;
}
public WxItemThumbEntity getThumb() {
return thumb;
}
public void setThumb(WxItemThumbEntity thumb) {
this.thumb = thumb;
}
public WxRespMusicEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxRespMusicEntity(WxItemMusicEntity music, WxItemThumbEntity thumb) {
super();
this.music = music;
this.thumb = thumb;
}
@Override
public String toString() {
return "WxRespMusicEntity [music=" + music + ", thumb=" + thumb + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((music == null) ? 0 : music.hashCode());
result = prime * result + ((thumb == null) ? 0 : thumb.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespMusicEntity other = (WxRespMusicEntity) obj;
if (music == null) {
if (other.music != null)
return false;
} else if (!music.equals(other.music))
return false;
if (thumb == null) {
if (other.thumb != null)
return false;
} else if (!thumb.equals(other.thumb))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespPicDescEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemPicDescEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_pic_desc")
public class WxRespPicDescEntity extends WxBaseRespEntity {
@ManyToMany
@JoinTable(name = "wx_resp_pic_desc_item")
private List<WxItemPicDescEntity> articles;
public List<WxItemPicDescEntity> getArticles() {
return articles;
}
public void setArticles(List<WxItemPicDescEntity> articles) {
this.articles = articles;
}
public WxRespPicDescEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxRespPicDescEntity(List<WxItemPicDescEntity> articles) {
super();
this.articles = articles;
}
@Override
public String toString() {
return "WxRespPicDescEntity [articles=" + articles + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result
+ ((articles == null) ? 0 : articles.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespPicDescEntity other = (WxRespPicDescEntity) obj;
if (articles == null) {
if (other.articles != null)
return false;
} else if (!articles.equals(other.articles))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespTextEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_text")
public class WxRespTextEntity extends WxBaseRespEntity {
@Column(name = "content", length = WxConfig.COL_LEN_CONTENT, nullable = false)
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public WxRespTextEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxRespTextEntity(String content) {
super();
this.content = content;
}
@Override
public String toString() {
return "WxRespTextEntity [content=" + content + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((content == null) ? 0 : content.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespTextEntity other = (WxRespTextEntity) obj;
if (content == null) {
if (other.content != null)
return false;
} else if (!content.equals(other.content))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVideoEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVideoEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_video")
public class WxRespVideoEntity extends WxBaseRespEntity {
@ManyToOne
@JoinColumn(name = "video_id")
WxItemVideoEntity video;
public WxItemVideoEntity getVideo() {
return video;
}
public void setVideo(WxItemVideoEntity video) {
this.video = video;
}
public WxRespVideoEntity() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "WxRespVideoEntity [video=" + video + "]";
}
public WxRespVideoEntity(WxItemVideoEntity video) {
super();
this.video = video;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((video == null) ? 0 : video.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespVideoEntity other = (WxRespVideoEntity) obj;
if (video == null) {
if (other.video != null)
return false;
} else if (!video.equals(other.video))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVoiceEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.resp;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVoiceEntity;
/**
* @author honey.zhao@aliyun.com
* @version Dec 29, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "resp_voice")
public class WxRespVoiceEntity extends WxBaseRespEntity {
@ManyToOne
@JoinColumn(name = "voice_id")
private WxItemVoiceEntity voice;
public WxItemVoiceEntity getVoice() {
return voice;
}
public void setVoice(WxItemVoiceEntity voice) {
this.voice = voice;
}
public WxRespVoiceEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxRespVoiceEntity(WxItemVoiceEntity voice) {
super();
this.voice = voice;
}
@Override
public String toString() {
return "WxRespVoiceEntity [voice=" + voice + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((voice == null) ? 0 : voice.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxRespVoiceEntity other = (WxRespVoiceEntity) obj;
if (voice == null) {
if (other.voice != null)
return false;
} else if (!voice.equals(other.voice))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/user/WxGroupEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.user;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
import com.google.gson.annotations.SerializedName;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "user_group")
public class WxGroupEntity extends WxBaseEntity {
@SerializedName("id")
@Column(name="wx_id", nullable=false)
private Long wxId;
@Column(name="name", length=WxConfig.COL_LEN_TITLE, nullable=false)
private String name;
@Column(name="count", nullable=false)
private String count;
public Long getWxId() {
return wxId;
}
public void setWxId(Long wxId) {
this.wxId = wxId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public WxGroupEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxGroupEntity(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxGroupEntity(Long wxId, String name, String count) {
super();
this.wxId = wxId;
this.name = name;
this.count = count;
}
@Override
public String toString() {
return "WxGroupEntity [wxId=" + wxId + ", name=" + name + ", count="
+ count + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((count == null) ? 0 : count.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((wxId == null) ? 0 : wxId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxGroupEntity other = (WxGroupEntity) obj;
if (count == null) {
if (other.count != null)
return false;
} else if (!count.equals(other.count))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (wxId == null) {
if (other.wxId != null)
return false;
} else if (!wxId.equals(other.wxId))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/entity/user/WxUserEntity.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.entity.user;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.base.WxBaseEntity;
import com.google.gson.annotations.SerializedName;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
@Entity
@Table(name = WxConfig.TABLE_PREFIX + "user")
public class WxUserEntity extends WxBaseEntity {
@SerializedName("openid")
@Column(name = "open_id", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String openId;
@Column(name = "subscribe", nullable = false)
private Integer subscribe;
@SerializedName("nickname")
@Column(name = "nickname", length = WxConfig.COL_LEN_USER_NAME, nullable = false)
private String nickName;
@Column(name = "sex", nullable = false)
private Integer sex;
@Column(name = "language", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String language;
@Column(name = "city", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String city;
@Column(name = "province", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String province;
@Column(name = "country", length = WxConfig.COL_LEN_INDICATOR, nullable = false)
private String country;
@SerializedName("headimgurl")
@Column(name = "head_img_url", length = WxConfig.COL_LEN_URL, nullable = false)
private String headImgUrl;
@SerializedName("subscribe_time")
@Column(name = "subscribe_time", nullable = false)
private Long subscribeTime;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public Integer getSubscribe() {
return subscribe;
}
public void setSubscribe(Integer subscribe) {
this.subscribe = subscribe;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getHeadImgUrl() {
return headImgUrl;
}
public void setHeadImgUrl(String headImgUrl) {
this.headImgUrl = headImgUrl;
}
public Long getSubscribeTime() {
return subscribeTime;
}
public void setSubscribeTime(Long subscribeTime) {
this.subscribeTime = subscribeTime;
}
public WxUserEntity() {
super();
// TODO Auto-generated constructor stub
}
public WxUserEntity(Long id, Date createdDate) {
super(id, createdDate);
// TODO Auto-generated constructor stub
}
public WxUserEntity(String openId, Integer subscribe, String nickName,
Integer sex, String language, String city, String province,
String country, String headImgUrl, Long subscribeTime) {
super();
this.openId = openId;
this.subscribe = subscribe;
this.nickName = nickName;
this.sex = sex;
this.language = language;
this.city = city;
this.province = province;
this.country = country;
this.headImgUrl = headImgUrl;
this.subscribeTime = subscribeTime;
}
@Override
public String toString() {
return "WxUserEntity [openId=" + openId + ", subscribe=" + subscribe
+ ", nickName=" + nickName + ", sex=" + sex + ", language="
+ language + ", city=" + city + ", province=" + province
+ ", country=" + country + ", headImgUrl=" + headImgUrl
+ ", subscribeTime=" + subscribeTime + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((city == null) ? 0 : city.hashCode());
result = prime * result + ((country == null) ? 0 : country.hashCode());
result = prime * result
+ ((headImgUrl == null) ? 0 : headImgUrl.hashCode());
result = prime * result
+ ((language == null) ? 0 : language.hashCode());
result = prime * result
+ ((nickName == null) ? 0 : nickName.hashCode());
result = prime * result + ((openId == null) ? 0 : openId.hashCode());
result = prime * result
+ ((province == null) ? 0 : province.hashCode());
result = prime * result + ((sex == null) ? 0 : sex.hashCode());
result = prime * result
+ ((subscribe == null) ? 0 : subscribe.hashCode());
result = prime * result
+ ((subscribeTime == null) ? 0 : subscribeTime.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
WxUserEntity other = (WxUserEntity) obj;
if (city == null) {
if (other.city != null)
return false;
} else if (!city.equals(other.city))
return false;
if (country == null) {
if (other.country != null)
return false;
} else if (!country.equals(other.country))
return false;
if (headImgUrl == null) {
if (other.headImgUrl != null)
return false;
} else if (!headImgUrl.equals(other.headImgUrl))
return false;
if (language == null) {
if (other.language != null)
return false;
} else if (!language.equals(other.language))
return false;
if (nickName == null) {
if (other.nickName != null)
return false;
} else if (!nickName.equals(other.nickName))
return false;
if (openId == null) {
if (other.openId != null)
return false;
} else if (!openId.equals(other.openId))
return false;
if (province == null) {
if (other.province != null)
return false;
} else if (!province.equals(other.province))
return false;
if (sex == null) {
if (other.sex != null)
return false;
} else if (!sex.equals(other.sex))
return false;
if (subscribe == null) {
if (other.subscribe != null)
return false;
} else if (!subscribe.equals(other.subscribe))
return false;
if (subscribeTime == null) {
if (other.subscribeTime != null)
return false;
} else if (!subscribeTime.equals(other.subscribeTime))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.auth;
import org.hamster.weixinmp.dao.entity.auth.WxAuth;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
@Repository
public interface WxAuthDao extends PagingAndSortingRepository<WxAuth, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthReqDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.auth;
import org.hamster.weixinmp.dao.entity.auth.WxAuthReq;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxAuthReqDao extends PagingAndSortingRepository<WxAuthReq, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemImageDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import org.hamster.weixinmp.dao.entity.item.WxItemImageEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
@Repository
public interface WxItemImageDao extends
PagingAndSortingRepository<WxItemImageEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemMusicDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import org.hamster.weixinmp.dao.entity.item.WxItemMusicEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxItemMusicDao extends PagingAndSortingRepository<WxItemMusicEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemPicDescDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import java.util.List;
import org.hamster.weixinmp.dao.entity.item.WxItemPicDescEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxItemPicDescDao extends PagingAndSortingRepository<WxItemPicDescEntity, Long> {
/**
*
* @param ids
* @return
*/
List<WxItemPicDescEntity> findByIdIn(List<Long> ids);
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemThumbDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import org.hamster.weixinmp.dao.entity.item.WxItemThumbEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
@Repository
public interface WxItemThumbDao extends
PagingAndSortingRepository<WxItemThumbEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVideoDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import org.hamster.weixinmp.dao.entity.item.WxItemVideoEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
@Repository
public interface WxItemVideoDao extends
PagingAndSortingRepository<WxItemVideoEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVoiceDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.item;
import org.hamster.weixinmp.dao.entity.item.WxItemVoiceEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
@Repository
public interface WxItemVoiceDao extends
PagingAndSortingRepository<WxItemVoiceEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/menu/WxMenuBtnDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.menu;
import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
@Repository
public interface WxMenuBtnDao extends PagingAndSortingRepository<WxMenuBtnEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxBaseMsgDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
@Repository
public interface WxBaseMsgDao extends PagingAndSortingRepository<WxBaseMsgEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgEventDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgEventEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgEventDao extends PagingAndSortingRepository<WxMsgEventEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgImageDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgImageDao extends PagingAndSortingRepository<WxMsgImageEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLinkDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLinkEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgLinkDao extends PagingAndSortingRepository<WxMsgLinkEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLocDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLocEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgLocDao extends PagingAndSortingRepository<WxMsgLocEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgTextDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgTextEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgTextDao extends PagingAndSortingRepository<WxMsgTextEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVideoDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgVideoEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxMsgVideoDao extends PagingAndSortingRepository<WxMsgVideoEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVoiceDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.msg;
import org.hamster.weixinmp.dao.entity.msg.WxMsgVoiceEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jan 5, 2014
*
*/
public interface WxMsgVoiceDao extends PagingAndSortingRepository<WxMsgVoiceEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespImageDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public interface WxRespImageDao extends PagingAndSortingRepository<WxRespImageEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespMusicDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespMusicEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public interface WxRespMusicDao extends PagingAndSortingRepository<WxRespMusicEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespPicDescDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public interface WxRespPicDescDao extends PagingAndSortingRepository<WxRespPicDescEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespTextDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespTextEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public interface WxRespTextDao extends PagingAndSortingRepository<WxRespTextEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVideoDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespVideoEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public interface WxRespVideoDao extends PagingAndSortingRepository<WxRespVideoEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVoiceDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.resp;
import org.hamster.weixinmp.dao.entity.resp.WxRespVoiceEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
@Repository
public interface WxRespVoiceDao extends PagingAndSortingRepository<WxRespVoiceEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/user/WxGroupDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.user;
import org.hamster.weixinmp.dao.entity.user.WxGroupEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*
*/
@Repository
public interface WxGroupDao extends PagingAndSortingRepository<WxGroupEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/dao/repository/user/WxUserDao.java
================================================
/**
*
*/
package org.hamster.weixinmp.dao.repository.user;
import org.hamster.weixinmp.dao.entity.user.WxUserEntity;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*
*/
@Repository
public interface WxUserDao extends PagingAndSortingRepository<WxUserEntity, Long> {
}
================================================
FILE: src/main/java/org/hamster/weixinmp/exception/WxException.java
================================================
/**
*
*/
package org.hamster.weixinmp.exception;
import org.hamster.weixinmp.model.WxRespCode;
/**
* @author honey.zhao@aliyun.com
* @version Jul 28, 2013
*
*/
public class WxException extends Exception {
private static final long serialVersionUID = -5181800588832010641L;
private WxRespCode error;
/**
*
*/
public WxException() {
}
/**
* @param message
*/
public WxException(String message) {
super(message);
}
/**
* @param cause
*/
public WxException(Throwable cause) {
super(cause);
}
/**
* @param message
* @param cause
*/
public WxException(String message, Throwable cause) {
super(message, cause);
}
/**
*
*/
public WxException(WxRespCode errorJson) {
super(errorJson.getErrmsg());
this.error = errorJson;
}
public WxRespCode getError() {
return error;
}
public void setError(WxRespCode error) {
this.error = error;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/gson/WxMenuBtnSerializer.java
================================================
/**
*
*/
package org.hamster.weixinmp.gson;
import java.lang.reflect.Type;
import org.hamster.weixinmp.constant.WxMenuBtnTypeEnum;
import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity;
import org.springframework.util.CollectionUtils;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxMenuBtnSerializer implements JsonSerializer<WxMenuBtnEntity> {
/*
* (non-Javadoc)
*
* @see com.google.gson.JsonSerializer#serialize(java.lang.Object,
* java.lang.reflect.Type, com.google.gson.JsonSerializationContext)
*/
public JsonElement serialize(WxMenuBtnEntity src, Type typeOfSrc,
JsonSerializationContext context) {
return recursiveParse(src);
}
public JsonObject recursiveParse(WxMenuBtnEntity parentEntity) {
JsonObject parent = new JsonObject();
parent.addProperty("type", parentEntity.getType());
parent.addProperty("name", parentEntity.getName());
WxMenuBtnTypeEnum type = WxMenuBtnTypeEnum.valueOf(parentEntity
.getType());
switch (type) {
case CLICK:
parent.addProperty("key", parentEntity.getKey());
break;
case VIEW:
parent.addProperty("url", parentEntity.getUrl());
break;
default:
break;
}
if (!CollectionUtils.isEmpty(parentEntity.getSubButtons())) {
JsonArray children = new JsonArray();
for (WxMenuBtnEntity child : parentEntity.getSubButtons()) {
children.add(recursiveParse(child));
}
parent.add("sub_button", children);
}
return parent;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/WxAccessTokenJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
public class WxAccessTokenJson {
private String access_token;
private String expires_in;
public String getAccess_token() {
return access_token;
}
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
public String getExpires_in() {
return expires_in;
}
public void setExpires_in(String expires_in) {
this.expires_in = expires_in;
}
public WxAccessTokenJson() {
super();
// TODO Auto-generated constructor stub
}
public WxAccessTokenJson(String access_token, String expires_in) {
super();
this.access_token = access_token;
this.expires_in = expires_in;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/WxRespCode.java
================================================
/**
*
*/
package org.hamster.weixinmp.model;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
public class WxRespCode {
private Integer errcode;
private String errmsg;
public Integer getErrcode() {
return errcode;
}
public void setErrcode(Integer errcode) {
this.errcode = errcode;
}
public String getErrmsg() {
return errmsg;
}
public void setErrmsg(String errmsg) {
this.errmsg = errmsg;
}
public WxRespCode() {
super();
// TODO Auto-generated constructor stub
}
public WxRespCode(Integer errcode, String errmsg) {
super();
this.errcode = errcode;
this.errmsg = errmsg;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/menu/WxMenuCreateJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.menu;
import java.util.List;
import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity;
/**
* @author honey.zhao@aliyun.com
* @version Aug 4, 2013
*
*/
public class WxMenuCreateJson {
private List<WxMenuBtnEntity> button;
public List<WxMenuBtnEntity> getButton() {
return button;
}
public void setButton(List<WxMenuBtnEntity> button) {
this.button = button;
}
public WxMenuCreateJson() {
super();
// TODO Auto-generated constructor stub
}
public WxMenuCreateJson(List<WxMenuBtnEntity> button) {
super();
this.button = button;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/menu/WxMenuGetJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.menu;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxMenuGetJson {
private WxMenuCreateJson menu;
public WxMenuCreateJson getMenu() {
return menu;
}
public void setMenu(WxMenuCreateJson menu) {
this.menu = menu;
}
public WxMenuGetJson() {
super();
// TODO Auto-generated constructor stub
}
public WxMenuGetJson(WxMenuCreateJson menu) {
super();
this.menu = menu;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrActionInfoJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.qr;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxQrActionInfoJson {
private WxQrSceneJson scene;
public WxQrSceneJson getScene() {
return scene;
}
public void setScene(WxQrSceneJson scene) {
this.scene = scene;
}
public WxQrActionInfoJson(WxQrSceneJson scene) {
super();
this.scene = scene;
}
public WxQrActionInfoJson() {
super();
// TODO Auto-generated constructor stub
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrCreateJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.qr;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxQrCreateJson {
private String action_name;
private Long expire_seconds;
private WxQrActionInfoJson action_info;
public String getAction_name() {
return action_name;
}
public void setAction_name(String action_name) {
this.action_name = action_name;
}
public Long getExpire_seconds() {
return expire_seconds;
}
public void setExpire_seconds(Long expire_seconds) {
this.expire_seconds = expire_seconds;
}
public WxQrActionInfoJson getAction_info() {
return action_info;
}
public void setAction_info(WxQrActionInfoJson action_info) {
this.action_info = action_info;
}
public WxQrCreateJson() {
super();
// TODO Auto-generated constructor stub
}
public WxQrCreateJson(String action_name, Long expire_seconds,
WxQrActionInfoJson action_info) {
super();
this.action_name = action_name;
this.expire_seconds = expire_seconds;
this.action_info = action_info;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrSceneJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.qr;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxQrSceneJson {
private Long scene_id;
public Long getScene_id() {
return scene_id;
}
public void setScene_id(Long scene_id) {
this.scene_id = scene_id;
}
public WxQrSceneJson() {
super();
// TODO Auto-generated constructor stub
}
public WxQrSceneJson(Long scene_id) {
super();
this.scene_id = scene_id;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendImageJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.SendItemImageJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendImageJson {
private String touser;
private String msgtype;
private SendItemImageJson image;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public SendItemImageJson getImage() {
return image;
}
public void setImage(SendItemImageJson image) {
this.image = image;
}
public SendImageJson() {
super();
// TODO Auto-generated constructor stub
}
public SendImageJson(String touser, String msgtype, SendItemImageJson image) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.image = image;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendItemPicDescJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.wrapper.WxSendItemArticleWrapper;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemPicDescJson {
private String touser;
private String msgtype;
private WxSendItemArticleWrapper news;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public WxSendItemArticleWrapper getNews() {
return news;
}
public void setNews(WxSendItemArticleWrapper news) {
this.news = news;
}
public SendItemPicDescJson(String touser, String msgtype,
WxSendItemArticleWrapper news) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.news = news;
}
public SendItemPicDescJson() {
super();
// TODO Auto-generated constructor stub
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendMusicJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.SendItemMusicJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendMusicJson {
private String touser;
private String msgtype;
private SendItemMusicJson music;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public SendItemMusicJson getMusic() {
return music;
}
public void setMusic(SendItemMusicJson music) {
this.music = music;
}
public SendMusicJson() {
super();
// TODO Auto-generated constructor stub
}
public SendMusicJson(String touser, String msgtype, SendItemMusicJson music) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.music = music;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendTextJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.SendItemTextJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendTextJson {
private String touser;
private String msgtype;
private SendItemTextJson content;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public SendItemTextJson getContent() {
return content;
}
public void setContent(SendItemTextJson content) {
this.content = content;
}
public SendTextJson() {
super();
// TODO Auto-generated constructor stub
}
public SendTextJson(String touser, String msgtype, SendItemTextJson content) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.content = content;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendVideoJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.SendItemVoiceJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendVideoJson {
private String touser;
private String msgtype;
private SendItemVoiceJson voice;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public SendItemVoiceJson getVoice() {
return voice;
}
public void setVoice(SendItemVoiceJson voice) {
this.voice = voice;
}
public SendVideoJson() {
super();
// TODO Auto-generated constructor stub
}
public SendVideoJson(String touser, String msgtype, SendItemVoiceJson voice) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.voice = voice;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/SendVoiceJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send;
import org.hamster.weixinmp.model.send.item.SendItemVideoJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendVoiceJson {
private String touser;
private String msgtype;
private SendItemVideoJson video;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public SendItemVideoJson getVideo() {
return video;
}
public void setVideo(SendItemVideoJson video) {
this.video = video;
}
public SendVoiceJson(String touser, String msgtype, SendItemVideoJson video) {
super();
this.touser = touser;
this.msgtype = msgtype;
this.video = video;
}
public SendVoiceJson() {
super();
// TODO Auto-generated constructor stub
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemArticleJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemArticleJson {
private String title;
private String description;
private String url;
private String picurl;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getPicurl() {
return picurl;
}
public void setPicurl(String picurl) {
this.picurl = picurl;
}
public SendItemArticleJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemArticleJson(String title, String description, String url,
String picurl) {
super();
this.title = title;
this.description = description;
this.url = url;
this.picurl = picurl;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemImageJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemImageJson {
private String mediaId;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public SendItemImageJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemImageJson(String mediaId) {
super();
this.mediaId = mediaId;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemMusicJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemMusicJson {
private String title;
private String description;
private String musicurl;
private String hqmusicurl;
private String thumb_media_id;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMusicurl() {
return musicurl;
}
public void setMusicurl(String musicurl) {
this.musicurl = musicurl;
}
public String getHqmusicurl() {
return hqmusicurl;
}
public void setHqmusicurl(String hqmusicurl) {
this.hqmusicurl = hqmusicurl;
}
public String getThumb_media_id() {
return thumb_media_id;
}
public void setThumb_media_id(String thumb_media_id) {
this.thumb_media_id = thumb_media_id;
}
public SendItemMusicJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemMusicJson(String title, String description, String musicurl,
String hqmusicurl, String thumb_media_id) {
super();
this.title = title;
this.description = description;
this.musicurl = musicurl;
this.hqmusicurl = hqmusicurl;
this.thumb_media_id = thumb_media_id;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemTextJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemTextJson {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public SendItemTextJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemTextJson(String text) {
super();
this.text = text;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemVideoJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemVideoJson {
private String mediaId;
private String title;
private String description;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public SendItemVideoJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemVideoJson(String mediaId, String title, String description) {
super();
this.mediaId = mediaId;
this.title = title;
this.description = description;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemVoiceJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class SendItemVoiceJson {
private String mediaId;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public SendItemVoiceJson() {
super();
// TODO Auto-generated constructor stub
}
public SendItemVoiceJson(String mediaId) {
super();
this.mediaId = mediaId;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/send/item/wrapper/WxSendItemArticleWrapper.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.send.item.wrapper;
import java.util.List;
import org.hamster.weixinmp.model.send.item.SendItemArticleJson;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
public class WxSendItemArticleWrapper {
private List<SendItemArticleJson> articles;
public List<SendItemArticleJson> getArticles() {
return articles;
}
public void setArticles(List<SendItemArticleJson> articles) {
this.articles = articles;
}
public WxSendItemArticleWrapper() {
super();
// TODO Auto-generated constructor stub
}
public WxSendItemArticleWrapper(List<SendItemArticleJson> articles) {
super();
this.articles = articles;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/user/WxOpenIdListJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.user;
import java.util.List;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxOpenIdListJson {
private List<String> openid;
public List<String> getOpenid() {
return openid;
}
public void setOpenid(List<String> openid) {
this.openid = openid;
}
public WxOpenIdListJson() {
super();
// TODO Auto-generated constructor stub
}
public WxOpenIdListJson(List<String> openid) {
super();
this.openid = openid;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/model/user/WxUserGetJson.java
================================================
/**
*
*/
package org.hamster.weixinmp.model.user;
/**
* {"total":2,"count":2,"data":{"openid":["","OPENID1","OPENID2"]},"next_openid":"NEXT_OPENID"}
*
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
public class WxUserGetJson {
private Long total;
private Long count;
WxOpenIdListJson data;
private String next_openid;
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public WxOpenIdListJson getData() {
return data;
}
public void setData(WxOpenIdListJson data) {
this.data = data;
}
public String getNext_openid() {
return next_openid;
}
public void setNext_openid(String next_openid) {
this.next_openid = next_openid;
}
public WxUserGetJson() {
super();
// TODO Auto-generated constructor stub
}
public WxUserGetJson(Long total, Long count, WxOpenIdListJson data,
String next_openid) {
super();
this.total = total;
this.count = count;
this.data = data;
this.next_openid = next_openid;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxAuthService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.auth.WxAuth;
import org.hamster.weixinmp.dao.entity.auth.WxAuthReq;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.util.WxUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
/**
* @author honey.zhao@aliyun.com
* @version Jan 1, 2014
*
*/
@Service
public class WxAuthService {
private static final Logger log = LoggerFactory.getLogger(WxAuthService.class);
@Autowired
protected WxConfig config;
public WxAuth getAccessToken(String appid, String appsecret)
throws WxException {
Map<String, String> paramsJson = new HashMap<String, String>();
paramsJson.put("grant_type", "client_credential");
paramsJson.put("appid", appid);
paramsJson.put("secret", appsecret);
WxAuth result = WxUtil.sendRequest(config.getAccessTokenCreateUrl(),
HttpMethod.GET, paramsJson, null, WxAuth.class);
result.setGrantType("client_credential");
result.setAppid(appid);
result.setSecret(appsecret);
return result;
}
public boolean validateAuth(String signature, String timestamp,
String nonce, String echostr) throws WxException {
WxAuthReq authReq = new WxAuthReq();
authReq.setCreatedDate(new Date());
authReq.setSignature(signature);
authReq.setTimestamp(timestamp);
authReq.setNonce(nonce);
authReq.setEchostr(echostr);
String excepted = hash(getStringToHash(timestamp, nonce,
config.getToken()));
if (signature == null || !signature.equals(excepted)) {
log.error("Authentication failed! excepted echostr ->" + excepted);
log.error(" actual ->" + signature);
return false;
}
return true;
}
protected static String getStringToHash(String timestamp, String nonce,
String token) {
List<String> list = new ArrayList<String>();
list.add(timestamp);
list.add(nonce);
list.add(token);
String result = "";
Collections.sort(list);
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i));
result += list.get(i);
}
return result;
}
protected static String hash(String str) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] b = md.digest(str.getBytes());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < b.length; i++) {
sb.append(Integer.toString((b[i] & 0xff) + 0x100, 16)
.substring(1));
}
return sb.toString();
} catch (NoSuchAlgorithmException e) {
// never happens
}
return null;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxMediaService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import java.util.Date;
import java.util.Map;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.ContentBody;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMediaTypeEnum;
import org.hamster.weixinmp.dao.entity.base.WxBaseItemMediaEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemImageEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemThumbEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVideoEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemVoiceEntity;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.util.WxUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
@Service
public class WxMediaService {
@Autowired
WxConfig config;
public WxBaseItemMediaEntity remoteMediaUpload(String accessToken,
WxMediaTypeEnum type, byte[] content) throws WxException {
MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create();
String typeString = null;
switch (type) {
case IMAGE:
case THUMB:
case VIDEO:
case VOICE:
typeString = type.toString().toLowerCase();
break;
case MUSIC:
case DEFAULT:
case PIC_DESC:
throw new WxException("Not supported upload type : "
+ type.toString());
default:
break;
}
Map<String, String> params = WxUtil.getAccessTokenParams(accessToken);
System.out.println(typeString);
params.put("type", typeString);
ContentBody contentBody = new ByteArrayBody(content, ContentType.MULTIPART_FORM_DATA, "name.jpg");
entityBuilder.addPart("media", contentBody);
MediaResultMapper result = WxUtil.sendRequest(
config.getMediaUploadUrl(), HttpMethod.POST, params,
entityBuilder.build(), MediaResultMapper.class);
WxBaseItemMediaEntity resultEntity = null;
switch (type) {
case IMAGE:
WxItemImageEntity imageEntity = new WxItemImageEntity();
imageEntity.setMediaId(result.getMedia_id());
imageEntity.setCreatedDate(new Date(result.getCreated_at() * 1000));
resultEntity = imageEntity;
break;
case THUMB:
WxItemThumbEntity thumbEntity = new WxItemThumbEntity();
thumbEntity.setMediaId(result.getMedia_id());
thumbEntity.setCreatedDate(new Date(result.getCreated_at() * 1000));
resultEntity = thumbEntity;
break;
case VIDEO:
WxItemVideoEntity videoEntity = new WxItemVideoEntity();
videoEntity.setMediaId(result.getMedia_id());
videoEntity.setCreatedDate(new Date(result.getCreated_at() * 1000));
resultEntity = videoEntity;
break;
case VOICE:
WxItemVoiceEntity voiceEntity = new WxItemVoiceEntity();
voiceEntity.setMediaId(result.getMedia_id());
voiceEntity.setCreatedDate(new Date(result.getCreated_at() * 1000));
resultEntity = voiceEntity;
break;
case MUSIC:
case DEFAULT:
case PIC_DESC:
throw new WxException("Not supported upload type : "
+ type.toString());
default:
break;
}
return resultEntity;
}
}
class MediaResultMapper {
private String type;
private String media_id;
private Long created_at;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMedia_id() {
return media_id;
}
public void setMedia_id(String media_id) {
this.media_id = media_id;
}
public Long getCreated_at() {
return created_at;
}
public void setCreated_at(Long created_at) {
this.created_at = created_at;
}
public MediaResultMapper() {
super();
// TODO Auto-generated constructor stub
}
public MediaResultMapper(String type, String media_id, Long created_at) {
super();
this.type = type;
this.media_id = media_id;
this.created_at = created_at;
}
@Override
public String toString() {
return "MediaResultMapper [type=" + type + ", media_id=" + media_id
+ ", created_at=" + created_at + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((created_at == null) ? 0 : created_at.hashCode());
result = prime * result
+ ((media_id == null) ? 0 : media_id.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MediaResultMapper other = (MediaResultMapper) obj;
if (created_at == null) {
if (other.created_at != null)
return false;
} else if (!created_at.equals(other.created_at))
return false;
if (media_id == null) {
if (other.media_id != null)
return false;
} else if (!media_id.equals(other.media_id))
return false;
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
return true;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxMenuService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;
import static org.hamster.weixinmp.util.WxUtil.sendRequest;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
import org.apache.http.entity.StringEntity;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEntity;
import org.hamster.weixinmp.dao.entity.user.WxUserEntity;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.gson.WxMenuBtnSerializer;
import org.hamster.weixinmp.model.WxRespCode;
import org.hamster.weixinmp.model.menu.WxMenuCreateJson;
import org.hamster.weixinmp.model.menu.WxMenuGetJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
@Service
public class WxMenuService {
@Autowired
WxConfig config;
public WxRespCode menuCreate(String accessToken, List<WxMenuBtnEntity> entities)
throws WxException {
Map<String, String> params = getAccessTokenParams(accessToken);
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(WxUserEntity.class,
new WxMenuBtnSerializer());
Gson gson = gsonBuilder.create();
WxMenuCreateJson wrapper = new WxMenuCreateJson();
wrapper.setButton(entities);
try {
return sendRequest(config.getMenuCreateUrl(), HttpMethod.POST, params,
new StringEntity(gson.toJson(wrapper)),
WxRespCode.class);
} catch (UnsupportedEncodingException e) {
throw new WxException(e);
}
}
public List<WxMenuBtnEntity> menuGet(String accessToken) throws WxException {
Map<String, String> params = getAccessTokenParams(accessToken);
return sendRequest(config.getMenuGetUrl(), HttpMethod.GET, params, null,
WxMenuGetJson.class).getMenu().getButton();
}
public WxRespCode menuDelete(String accessToken) throws WxException {
Map<String, String> params = getAccessTokenParams(accessToken);
return sendRequest(config.getMenuDeleteUrl(), HttpMethod.GET, params, null,
WxRespCode.class);
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxMessageService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.hamster.weixinmp.constant.WxMsgRespType;
import org.hamster.weixinmp.constant.WxMsgRespTypeEnum;
import org.hamster.weixinmp.constant.WxMsgTypeEnum;
import org.hamster.weixinmp.controller.util.WxXmlUtil;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespImageEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespMusicEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespTextEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespVideoEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespVoiceEntity;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.service.handler.WxMessageHandlerIfc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author honey.zhao@aliyun.com
* @version Dec 30, 2013
*
*/
@Service
public class WxMessageService {
@Autowired(required=false)
List<WxMessageHandlerIfc> handlers;
public WxBaseMsgEntity parseXML(String xml) throws DocumentException,
WxException {
Element ele = DocumentHelper.parseText(xml).getRootElement();
String msgType = null;
if ((msgType = ele.elementText("MsgType")) == null) {
throw new WxException("cannot find MsgType Node!\n" + xml);
}
WxMsgTypeEnum msgTypeEnum = WxMsgTypeEnum.inst(msgType);
switch (msgTypeEnum) {
case EVENT:
return WxXmlUtil.getMsgEvent(ele);
case IMAGE:
return WxXmlUtil.getMsgImage(ele);
case LINK:
return WxXmlUtil.getMsgLink(ele);
case LOCATION:
return WxXmlUtil.getMsgLoc(ele);
case TEXT:
return WxXmlUtil.getMsgText(ele);
case VIDEO:
return WxXmlUtil.getMsgVideo(ele);
case VOICE:
return WxXmlUtil.getMsgVoice(ele);
default:
// never happens
break;
}
return null;
}
public WxBaseRespEntity handleMessage(WxBaseMsgEntity msg) {
List<WxMessageHandlerIfc> handlerList = new ArrayList<WxMessageHandlerIfc>();
if(handlers!=null){
handlerList.addAll(handlers);
}
Collections.sort(handlerList, new WxMessageHandlerComparator());
Map<String, Object> context = new HashMap<String, Object>();
WxBaseRespEntity result = null;
for (WxMessageHandlerIfc handler : handlerList) {
result = handler.handle(msg, context);
}
if (result == null) {
result = defaultResult(msg.getToUserName(), msg.getFromUserName());
}
return result;
}
public Element parseRespXML(WxBaseRespEntity resp) throws DocumentException {
WxMsgRespTypeEnum type = WxMsgRespTypeEnum.inst(resp.getMsgType());
switch (type) {
case IMAGE:
return WxXmlUtil.getRespImage((WxRespImageEntity) resp);
case MUSIC:
return WxXmlUtil.getRespMusic((WxRespMusicEntity) resp, ((WxRespMusicEntity) resp).getThumb());
case NEWS:
return WxXmlUtil.getRespPicDesc((WxRespPicDescEntity) resp);
case TEXT:
return WxXmlUtil.getRespTextXML((WxRespTextEntity) resp);
case VIDEO:
return WxXmlUtil.getRespVideo((WxRespVideoEntity) resp);
case VOICE:
return WxXmlUtil.getRespVoice((WxRespVoiceEntity) resp);
default:
break;
}
return null;
}
protected WxRespTextEntity defaultResult(String fromUserName, String toUserName) {
WxRespTextEntity result = new WxRespTextEntity();
result.setContent("您好,您的消息已收到.");
result.setCreatedDate(new Date());
result.setCreateTime(new Date().getTime() / 1000);
result.setFromUserName(fromUserName);
result.setMsgType(WxMsgRespType.TEXT);
result.setToUserName(toUserName);
return result;
}
}
class WxMessageHandlerComparator implements Comparator<WxMessageHandlerIfc> {
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(WxMessageHandlerIfc o1, WxMessageHandlerIfc o2) {
if (o1.priority() > o2.priority()) {
return -1;
} else if (o1.priority() < o2.priority()) {
return 1;
} else {
return 0;
}
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxQrService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;
import static org.hamster.weixinmp.util.WxUtil.sendRequest;
import static org.hamster.weixinmp.util.WxUtil.toJsonStringEntity;
import java.util.Map;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.dao.entity.qr.WxQrEntity;
import org.hamster.weixinmp.exception.WxException;
import org.hamster.weixinmp.model.qr.WxQrActionInfoJson;
import org.hamster.weixinmp.model.qr.WxQrCreateJson;
import org.hamster.weixinmp.model.qr.WxQrSceneJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
/**
* @author honey.zhao@aliyun.com
* @version Jan 4, 2014
*
*/
@Service
public class WxQrService {
@Autowired
private WxConfig config;
public WxQrEntity remoteQrcodeCreate(String accessToken,
boolean isTemporary, Long sceneId, Long expire_seconds)
throws WxException {
Map<String, String> params = getAccessTokenParams(accessToken);
WxQrSceneJson scene = new WxQrSceneJson();
scene.setScene_id(sceneId);
WxQrActionInfoJson action = new WxQrActionInfoJson();
action.setScene(scene);
WxQrCreateJson requestJson = new WxQrCreateJson();
requestJson.setAction_name(isTemporary ? "QR_LIMIT_SCENE" : "QR_SCENE");
requestJson.setAction_info(action);
if (isTemporary) {
requestJson.setExpire_seconds(expire_seconds);
}
WxQrEntity result = sendRequest(config.getQrcodeCreateUrl(),
HttpMethod.POST, params, toJsonStringEntity(requestJson),
WxQrEntity.class);
result.setScene(sceneId);
return result;
}
}
================================================
FILE: src/main/java/org/hamster/weixinmp/service/WxStorageService.java
================================================
/**
*
*/
package org.hamster.weixinmp.service;
import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.hamster.weixinmp.config.WxConfig;
import org.hamster.weixinmp.constant.WxMsgRespType;
import org.hamster.weixinmp.controller.util.WxXmlUtil;
import org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity;
import org.hamster.weixinmp.dao.entity.base.WxBaseRespEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemMusicEntity;
import org.hamster.weixinmp.dao.entity.item.WxItemPicDescEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgEventEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLinkEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgLocEntity;
import org.hamster.weixinmp.dao.entity.msg.WxMsgTextEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespMusicEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespPicDescEntity;
import org.hamster.weixinmp.dao.entity.resp.WxRespTextEntity;
import org.hamster.weixinmp.dao.repository.auth.WxAuthDao;
import org.hamster.weixinmp.dao.repository.auth.WxAuthReqDao;
import org.hamster.weixinmp.dao.repository.item.WxItemImageDao;
import org.hamster.weixinmp.dao.repository.item.WxItemMusicDao;
import org.hamster.weixinmp.dao.repository.item.WxItemPicDescDao;
import org.hamster.weixinmp.dao.repository.item.WxItemThumbDao;
import org.hamster.weixinmp.dao.repository.item.WxItemVideoDao;
import org.hamster.weixinmp.dao.repository.item.WxItemVoiceDao;
import org.hamster.weixinmp.dao.repository.menu.WxMenuBtnDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgEventDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgImageDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgLinkDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgLocDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgTextDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgVideoDao;
import org.hamster.weixinmp.dao.repository.msg.WxMsgVoiceDao;
import org.hamster.weixinmp.dao.repository.resp.WxRespImageDao;
import org.hamster.weixinmp.dao.repository.resp.WxRespMusicDao;
import org.hamster.weixinmp.dao.repository.resp.WxRespPicDescDao;
import org.hamster.weixinmp.dao.repository.resp.WxRespTextDao;
import org.hamste
gitextract_caiphvtt/
├── .gitignore
├── .mymetadata
├── LICENSE
├── README.md
├── pom.xml
└── src/
├── main/
│ ├── java/
│ │ └── org/
│ │ └── hamster/
│ │ └── weixinmp/
│ │ ├── config/
│ │ │ └── WxConfig.java
│ │ ├── constant/
│ │ │ ├── WxMediaType.java
│ │ │ ├── WxMediaTypeEnum.java
│ │ │ ├── WxMenuBtnType.java
│ │ │ ├── WxMenuBtnTypeEnum.java
│ │ │ ├── WxMsgEventType.java
│ │ │ ├── WxMsgEventTypeEnum.java
│ │ │ ├── WxMsgRespType.java
│ │ │ ├── WxMsgRespTypeEnum.java
│ │ │ ├── WxMsgType.java
│ │ │ └── WxMsgTypeEnum.java
│ │ ├── controller/
│ │ │ ├── WxController.java
│ │ │ └── util/
│ │ │ ├── WxJsonUtil.java
│ │ │ └── WxXmlUtil.java
│ │ ├── dao/
│ │ │ ├── entity/
│ │ │ │ ├── auth/
│ │ │ │ │ ├── WxAuth.java
│ │ │ │ │ └── WxAuthReq.java
│ │ │ │ ├── base/
│ │ │ │ │ ├── WxBaseEntity.java
│ │ │ │ │ ├── WxBaseItemMediaEntity.java
│ │ │ │ │ ├── WxBaseMsgEntity.java
│ │ │ │ │ └── WxBaseRespEntity.java
│ │ │ │ ├── item/
│ │ │ │ │ ├── WxItemImageEntity.java
│ │ │ │ │ ├── WxItemMusicEntity.java
│ │ │ │ │ ├── WxItemPicDescEntity.java
│ │ │ │ │ ├── WxItemThumbEntity.java
│ │ │ │ │ ├── WxItemVideoEntity.java
│ │ │ │ │ └── WxItemVoiceEntity.java
│ │ │ │ ├── menu/
│ │ │ │ │ └── WxMenuBtnEntity.java
│ │ │ │ ├── msg/
│ │ │ │ │ ├── WxMsgEventEntity.java
│ │ │ │ │ ├── WxMsgImageEntity.java
│ │ │ │ │ ├── WxMsgLinkEntity.java
│ │ │ │ │ ├── WxMsgLocEntity.java
│ │ │ │ │ ├── WxMsgTextEntity.java
│ │ │ │ │ ├── WxMsgVideoEntity.java
│ │ │ │ │ └── WxMsgVoiceEntity.java
│ │ │ │ ├── qr/
│ │ │ │ │ └── WxQrEntity.java
│ │ │ │ ├── resp/
│ │ │ │ │ ├── WxRespImageEntity.java
│ │ │ │ │ ├── WxRespMusicEntity.java
│ │ │ │ │ ├── WxRespPicDescEntity.java
│ │ │ │ │ ├── WxRespTextEntity.java
│ │ │ │ │ ├── WxRespVideoEntity.java
│ │ │ │ │ └── WxRespVoiceEntity.java
│ │ │ │ └── user/
│ │ │ │ ├── WxGroupEntity.java
│ │ │ │ └── WxUserEntity.java
│ │ │ └── repository/
│ │ │ ├── auth/
│ │ │ │ ├── WxAuthDao.java
│ │ │ │ └── WxAuthReqDao.java
│ │ │ ├── item/
│ │ │ │ ├── WxItemImageDao.java
│ │ │ │ ├── WxItemMusicDao.java
│ │ │ │ ├── WxItemPicDescDao.java
│ │ │ │ ├── WxItemThumbDao.java
│ │ │ │ ├── WxItemVideoDao.java
│ │ │ │ └── WxItemVoiceDao.java
│ │ │ ├── menu/
│ │ │ │ └── WxMenuBtnDao.java
│ │ │ ├── msg/
│ │ │ │ ├── WxBaseMsgDao.java
│ │ │ │ ├── WxMsgEventDao.java
│ │ │ │ ├── WxMsgImageDao.java
│ │ │ │ ├── WxMsgLinkDao.java
│ │ │ │ ├── WxMsgLocDao.java
│ │ │ │ ├── WxMsgTextDao.java
│ │ │ │ ├── WxMsgVideoDao.java
│ │ │ │ └── WxMsgVoiceDao.java
│ │ │ ├── resp/
│ │ │ │ ├── WxRespImageDao.java
│ │ │ │ ├── WxRespMusicDao.java
│ │ │ │ ├── WxRespPicDescDao.java
│ │ │ │ ├── WxRespTextDao.java
│ │ │ │ ├── WxRespVideoDao.java
│ │ │ │ └── WxRespVoiceDao.java
│ │ │ └── user/
│ │ │ ├── WxGroupDao.java
│ │ │ └── WxUserDao.java
│ │ ├── exception/
│ │ │ └── WxException.java
│ │ ├── gson/
│ │ │ └── WxMenuBtnSerializer.java
│ │ ├── model/
│ │ │ ├── WxAccessTokenJson.java
│ │ │ ├── WxRespCode.java
│ │ │ ├── menu/
│ │ │ │ ├── WxMenuCreateJson.java
│ │ │ │ └── WxMenuGetJson.java
│ │ │ ├── qr/
│ │ │ │ ├── WxQrActionInfoJson.java
│ │ │ │ ├── WxQrCreateJson.java
│ │ │ │ └── WxQrSceneJson.java
│ │ │ ├── send/
│ │ │ │ ├── SendImageJson.java
│ │ │ │ ├── SendItemPicDescJson.java
│ │ │ │ ├── SendMusicJson.java
│ │ │ │ ├── SendTextJson.java
│ │ │ │ ├── SendVideoJson.java
│ │ │ │ ├── SendVoiceJson.java
│ │ │ │ └── item/
│ │ │ │ ├── SendItemArticleJson.java
│ │ │ │ ├── SendItemImageJson.java
│ │ │ │ ├── SendItemMusicJson.java
│ │ │ │ ├── SendItemTextJson.java
│ │ │ │ ├── SendItemVideoJson.java
│ │ │ │ ├── SendItemVoiceJson.java
│ │ │ │ └── wrapper/
│ │ │ │ └── WxSendItemArticleWrapper.java
│ │ │ └── user/
│ │ │ ├── WxOpenIdListJson.java
│ │ │ └── WxUserGetJson.java
│ │ ├── service/
│ │ │ ├── WxAuthService.java
│ │ │ ├── WxMediaService.java
│ │ │ ├── WxMenuService.java
│ │ │ ├── WxMessageService.java
│ │ │ ├── WxQrService.java
│ │ │ ├── WxStorageService.java
│ │ │ ├── WxUserGroupService.java
│ │ │ ├── WxUserService.java
│ │ │ └── handler/
│ │ │ └── WxMessageHandlerIfc.java
│ │ └── util/
│ │ └── WxUtil.java
│ ├── resources/
│ │ ├── applicationContext-weixinmp.xml
│ │ └── wx.properties
│ └── webapp/
│ ├── META-INF/
│ │ └── MANIFEST.MF
│ ├── MyHtml.html
│ ├── WEB-INF/
│ │ ├── classes/
│ │ │ └── weixin/
│ │ │ └── popular/
│ │ │ └── example/
│ │ │ └── pay_example.jsp.jsp
│ │ └── web.xml
│ ├── default/
│ │ └── index.html
│ └── index.jsp
└── test/
├── java/
│ └── org/
│ └── hamster/
│ └── weixinmp/
│ └── test/
│ ├── base/
│ │ ├── AbstractServiceTest.java
│ │ └── AbstractWxServiceTest.java
│ ├── controller/
│ │ └── WxControllerManualTest.java
│ ├── service/
│ │ ├── WxGroupServceTest.java
│ │ ├── WxMediaServiceTest.java
│ │ ├── WxMenuServiceTest.java
│ │ ├── WxQrServiceTest.java
│ │ ├── WxServiceTest.java
│ │ └── WxUserServiceTest.java
│ └── xml/
│ └── WxXMLUtilTest.java
└── resources/
├── .gitignore
├── application.development.properties
├── applicationContext-test-weixinmp.xml
├── log4j.properties
└── sql/
└── import-data.sql
SYMBOL INDEX (805 symbols across 112 files)
FILE: src/main/java/org/hamster/weixinmp/config/WxConfig.java
class WxConfig (line 14) | @Configuration
method getToken (line 47) | public String getToken() {
method setToken (line 50) | public void setToken(String token) {
method getAppid (line 53) | public String getAppid() {
method setAppid (line 56) | public void setAppid(String appid) {
method getAppsecret (line 59) | public String getAppsecret() {
method setAppsecret (line 62) | public void setAppsecret(String appsecret) {
method getMenuCreateUrl (line 65) | public String getMenuCreateUrl() {
method setMenuCreateUrl (line 68) | public void setMenuCreateUrl(String menuCreateUrl) {
method getMenuGetUrl (line 71) | public String getMenuGetUrl() {
method setMenuGetUrl (line 74) | public void setMenuGetUrl(String menuGetUrl) {
method getMenuDeleteUrl (line 77) | public String getMenuDeleteUrl() {
method setMenuDeleteUrl (line 80) | public void setMenuDeleteUrl(String menuDeleteUrl) {
method getAccessTokenCreateUrl (line 83) | public String getAccessTokenCreateUrl() {
method setAccessTokenCreateUrl (line 86) | public void setAccessTokenCreateUrl(String accessTokenCreateUrl) {
method getCustomSendUrl (line 89) | public String getCustomSendUrl() {
method setCustomSendUrl (line 92) | public void setCustomSendUrl(String customSendUrl) {
method getMediaUploadUrl (line 95) | public String getMediaUploadUrl() {
method setMediaUploadUrl (line 98) | public void setMediaUploadUrl(String mediaUploadUrl) {
method getQrcodeCreateUrl (line 101) | public String getQrcodeCreateUrl() {
method setQrcodeCreateUrl (line 104) | public void setQrcodeCreateUrl(String qrcodeCreateUrl) {
method getUserInfoUrl (line 107) | public String getUserInfoUrl() {
method setUserInfoUrl (line 110) | public void setUserInfoUrl(String userInfoUrl) {
method getUserGetUrl (line 113) | public String getUserGetUrl() {
method setUserGetUrl (line 116) | public void setUserGetUrl(String userGetUrl) {
method getGroupsCreateUrl (line 119) | public String getGroupsCreateUrl() {
method setGroupsCreateUrl (line 122) | public void setGroupsCreateUrl(String groupsCreateUrl) {
method getGroupsGetUrl (line 125) | public String getGroupsGetUrl() {
method setGroupsGetUrl (line 128) | public void setGroupsGetUrl(String groupsGetUrl) {
method getGroupsGetIdUrl (line 131) | public String getGroupsGetIdUrl() {
method setGroupsGetIdUrl (line 134) | public void setGroupsGetIdUrl(String groupsGetIdUrl) {
method getGroupsUpdateUrl (line 137) | public String getGroupsUpdateUrl() {
method setGroupsUpdateUrl (line 140) | public void setGroupsUpdateUrl(String groupsUpdateUrl) {
method getGroupsMembersUpdateUrl (line 143) | public String getGroupsMembersUpdateUrl() {
method setGroupsMembersUpdateUrl (line 146) | public void setGroupsMembersUpdateUrl(String groupsMembersUpdateUrl) {
method getTablePrefix (line 149) | public static String getTablePrefix() {
method getColLenUrl (line 152) | public static int getColLenUrl() {
method getColLenContent (line 155) | public static int getColLenContent() {
method getColLenTitle (line 158) | public static int getColLenTitle() {
method getColLenUserName (line 161) | public static int getColLenUserName() {
method getColLenIndicator (line 164) | public static int getColLenIndicator() {
method WxConfig (line 167) | public WxConfig() {
method WxConfig (line 171) | public WxConfig(String token, String appid, String appsecret,
method toString (line 197) | @Override
method hashCode (line 212) | @Override
method equals (line 254) | @Override
FILE: src/main/java/org/hamster/weixinmp/constant/WxMediaType.java
class WxMediaType (line 11) | public class WxMediaType {
method WxMediaType (line 21) | private WxMediaType() {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMediaTypeEnum.java
type WxMediaTypeEnum (line 11) | public enum WxMediaTypeEnum {
method WxMediaTypeEnum (line 24) | WxMediaTypeEnum(final String text) {
method toString (line 35) | @Override
method inst (line 40) | public static WxMediaTypeEnum inst(String strVal) {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMenuBtnType.java
class WxMenuBtnType (line 11) | public class WxMenuBtnType {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMenuBtnTypeEnum.java
type WxMenuBtnTypeEnum (line 11) | public enum WxMenuBtnTypeEnum {
method WxMenuBtnTypeEnum (line 16) | WxMenuBtnTypeEnum(final String text) {
method toString (line 27) | @Override
method inst (line 32) | public static WxMenuBtnTypeEnum inst(String strVal) {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgEventType.java
class WxMsgEventType (line 11) | public class WxMsgEventType {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgEventTypeEnum.java
type WxMsgEventTypeEnum (line 11) | public enum WxMsgEventTypeEnum {
method WxMsgEventTypeEnum (line 21) | WxMsgEventTypeEnum(final String text) {
method toString (line 32) | @Override
method inst (line 37) | public static WxMsgEventTypeEnum inst(String strVal) {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgRespType.java
class WxMsgRespType (line 11) | public class WxMsgRespType {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgRespTypeEnum.java
type WxMsgRespTypeEnum (line 11) | public enum WxMsgRespTypeEnum {
method WxMsgRespTypeEnum (line 17) | private WxMsgRespTypeEnum(final String text) {
method toString (line 28) | @Override
method inst (line 33) | public static WxMsgRespTypeEnum inst(String strVal) {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgType.java
class WxMsgType (line 11) | public class WxMsgType {
FILE: src/main/java/org/hamster/weixinmp/constant/WxMsgTypeEnum.java
type WxMsgTypeEnum (line 8) | public enum WxMsgTypeEnum {
method WxMsgTypeEnum (line 16) | private WxMsgTypeEnum(final String text) {
method toString (line 27) | @Override
method inst (line 32) | public static WxMsgTypeEnum inst(String strVal) {
FILE: src/main/java/org/hamster/weixinmp/controller/WxController.java
class WxController (line 27) | @Controller
method authGet (line 37) | @RequestMapping(method = {RequestMethod.GET,})
method post (line 50) | @RequestMapping(method = RequestMethod.POST)
FILE: src/main/java/org/hamster/weixinmp/controller/util/WxJsonUtil.java
class WxJsonUtil (line 21) | public class WxJsonUtil {
method WxJsonUtil (line 23) | private WxJsonUtil() {
method toMenuCreateReqBody (line 26) | public static final String toMenuCreateReqBody(List<WxMenuBtnEntity> w...
method toWxErrorJson (line 33) | public static final WxRespCode toWxErrorJson(String errorResult) {
method toAccessTokenJson (line 41) | public static final WxAccessTokenJson toAccessTokenJson(String result) {
FILE: src/main/java/org/hamster/weixinmp/controller/util/WxXmlUtil.java
class WxXmlUtil (line 43) | public class WxXmlUtil {
method WxXmlUtil (line 45) | private WxXmlUtil() {
method getAuthReq (line 48) | public static WxAuthReq getAuthReq(String signature, String timestamp,
method getMsgText (line 76) | public static WxMsgTextEntity getMsgText(Element ele) throws DocumentE...
method getMsgImage (line 100) | public static WxMsgImageEntity getMsgImage(Element ele) throws Documen...
method getMsgVoice (line 126) | public static WxMsgVoiceEntity getMsgVoice(Element ele) throws Documen...
method getMsgVideo (line 155) | public static WxMsgVideoEntity getMsgVideo(Element ele) throws Documen...
method getMsgLoc (line 186) | public static WxMsgLocEntity getMsgLoc(Element ele) throws DocumentExc...
method getMsgLink (line 213) | public static WxMsgLinkEntity getMsgLink(Element ele) throws DocumentE...
method getMsgEvent (line 237) | public static WxMsgEventEntity getMsgEvent(Element ele) throws Documen...
method getRespTextXML (line 265) | public static Element getRespTextXML(WxRespTextEntity respText) throws...
method getRespImage (line 288) | public static Element getRespImage(WxRespImageEntity respImage) throws...
method getRespVoice (line 312) | public static Element getRespVoice(WxRespVoiceEntity respVoice) throws...
method getRespVideo (line 338) | public static Element getRespVideo(WxRespVideoEntity respVideo) throws...
method getRespMusic (line 369) | public static Element getRespMusic(WxRespMusicEntity respMusic, WxItem...
method getRespPicDesc (line 410) | public static Element getRespPicDesc(WxRespPicDescEntity respPicDesc) ...
method toXML (line 424) | public static Element toXML(String xmlstr) throws DocumentException {
method getReqType (line 429) | public static WxMsgTypeEnum getReqType(Element ele) {
method msgEntityFactory (line 439) | @SuppressWarnings("unchecked")
method respEntityFactory (line 460) | private static Element respEntityFactory(WxBaseRespEntity entity) {
method strVal (line 476) | private static String strVal(Element ele, String name) {
method longVal (line 480) | private static Long longVal(Element ele, String name) {
method doubleVal (line 484) | private static Double doubleVal(Element ele, String name) {
FILE: src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuth.java
class WxAuth (line 23) | @Entity
method getGrantType (line 38) | public String getGrantType() {
method setGrantType (line 41) | public void setGrantType(String grantType) {
method getAppid (line 44) | public String getAppid() {
method setAppid (line 47) | public void setAppid(String appid) {
method getSecret (line 50) | public String getSecret() {
method setSecret (line 53) | public void setSecret(String secret) {
method getAccessToken (line 56) | public String getAccessToken() {
method setAccessToken (line 59) | public void setAccessToken(String accessToken) {
method getExpiresIn (line 62) | public Long getExpiresIn() {
method setExpiresIn (line 65) | public void setExpiresIn(Long expiresIn) {
method WxAuth (line 68) | public WxAuth() {
method WxAuth (line 72) | public WxAuth(Long id, Date createdDate) {
method WxAuth (line 76) | public WxAuth(String grantType, String appid, String secret,
method toString (line 85) | @Override
method hashCode (line 91) | @Override
method equals (line 105) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuthReq.java
class WxAuthReq (line 16) | @Entity
method getSignature (line 27) | public String getSignature() {
method setSignature (line 30) | public void setSignature(String signature) {
method getTimestamp (line 33) | public String getTimestamp() {
method setTimestamp (line 36) | public void setTimestamp(String timestamp) {
method getNonce (line 39) | public String getNonce() {
method setNonce (line 42) | public void setNonce(String nonce) {
method getEchostr (line 45) | public String getEchostr() {
method setEchostr (line 48) | public void setEchostr(String echostr) {
method WxAuthReq (line 51) | public WxAuthReq() {
method toString (line 55) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseEntity.java
class WxBaseEntity (line 22) | @MappedSuperclass
method getId (line 33) | public Long getId() {
method setId (line 36) | public void setId(Long id) {
method getCreatedDate (line 39) | public Date getCreatedDate() {
method setCreatedDate (line 42) | public void setCreatedDate(Date createdDate) {
method WxBaseEntity (line 45) | public WxBaseEntity() {
method WxBaseEntity (line 49) | public WxBaseEntity(Long id, Date createdDate) {
method toString (line 54) | @Override
method hashCode (line 58) | @Override
method equals (line 67) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseItemMediaEntity.java
class WxBaseItemMediaEntity (line 14) | @MappedSuperclass
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseMsgEntity.java
class WxBaseMsgEntity (line 21) | @Entity
method getToUserName (line 37) | public String getToUserName() {
method setToUserName (line 40) | public void setToUserName(String toUserName) {
method getFromUserName (line 43) | public String getFromUserName() {
method setFromUserName (line 46) | public void setFromUserName(String fromUserName) {
method getCreateTime (line 49) | public Long getCreateTime() {
method setCreateTime (line 52) | public void setCreateTime(Long createTime) {
method getMsgType (line 55) | public String getMsgType() {
method setMsgType (line 58) | public void setMsgType(String msgType) {
method getMsgId (line 61) | public Long getMsgId() {
method setMsgId (line 64) | public void setMsgId(Long msgId) {
method WxBaseMsgEntity (line 67) | public WxBaseMsgEntity(String toUserName, String fromUserName,
method WxBaseMsgEntity (line 76) | public WxBaseMsgEntity() {
method toString (line 80) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseRespEntity.java
class WxBaseRespEntity (line 18) | @MappedSuperclass
method WxBaseRespEntity (line 30) | public WxBaseRespEntity() {
method WxBaseRespEntity (line 34) | public WxBaseRespEntity(Long id, Date createdDate) {
method WxBaseRespEntity (line 38) | public WxBaseRespEntity(Integer funcFlag, String toUserName,
method toString (line 47) | @Override
method hashCode (line 53) | @Override
method equals (line 68) | @Override
method getFuncFlag (line 104) | public Integer getFuncFlag() {
method setFuncFlag (line 107) | public void setFuncFlag(Integer funcFlag) {
method getToUserName (line 110) | public String getToUserName() {
method setToUserName (line 113) | public void setToUserName(String toUserName) {
method getFromUserName (line 116) | public String getFromUserName() {
method setFromUserName (line 119) | public void setFromUserName(String fromUserName) {
method getCreateTime (line 122) | public Long getCreateTime() {
method setCreateTime (line 125) | public void setCreateTime(Long createTime) {
method getMsgType (line 128) | public String getMsgType() {
method setMsgType (line 131) | public void setMsgType(String msgType) {
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemImageEntity.java
class WxItemImageEntity (line 18) | @Entity
method getMediaId (line 25) | public String getMediaId() {
method setMediaId (line 28) | public void setMediaId(String mediaId) {
method getPicUrl (line 31) | public String getPicUrl() {
method setPicUrl (line 34) | public void setPicUrl(String picUrl) {
method WxItemImageEntity (line 37) | public WxItemImageEntity(String mediaId, String picUrl) {
method WxItemImageEntity (line 42) | public WxItemImageEntity() {
method toString (line 46) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemMusicEntity.java
class WxItemMusicEntity (line 19) | @Entity
method getMediaId (line 32) | public String getMediaId() {
method setMediaId (line 35) | public void setMediaId(String mediaId) {
method getTitle (line 38) | public String getTitle() {
method setTitle (line 41) | public void setTitle(String title) {
method getDescription (line 44) | public String getDescription() {
method setDescription (line 47) | public void setDescription(String description) {
method getMusicUrl (line 50) | public String getMusicUrl() {
method setMusicUrl (line 53) | public void setMusicUrl(String musicUrl) {
method getHqMusicUrl (line 56) | public String getHqMusicUrl() {
method setHqMusicUrl (line 59) | public void setHqMusicUrl(String hqMusicUrl) {
method WxItemMusicEntity (line 62) | public WxItemMusicEntity() {
method WxItemMusicEntity (line 66) | public WxItemMusicEntity(String mediaId, String title, String descript...
method toString (line 75) | @Override
method hashCode (line 81) | @Override
method equals (line 95) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemPicDescEntity.java
class WxItemPicDescEntity (line 19) | @Entity
method getTitle (line 30) | public String getTitle() {
method setTitle (line 33) | public void setTitle(String title) {
method getDescription (line 36) | public String getDescription() {
method setDescription (line 39) | public void setDescription(String description) {
method getPicUrl (line 42) | public String getPicUrl() {
method setPicUrl (line 45) | public void setPicUrl(String picUrl) {
method getUrl (line 48) | public String getUrl() {
method setUrl (line 51) | public void setUrl(String url) {
method WxItemPicDescEntity (line 54) | public WxItemPicDescEntity() {
method WxItemPicDescEntity (line 58) | public WxItemPicDescEntity(String title, String description, String pi...
method toString (line 66) | @Override
method hashCode (line 71) | @Override
method equals (line 82) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemThumbEntity.java
class WxItemThumbEntity (line 18) | @Entity
method getMediaId (line 24) | public String getMediaId() {
method setMediaId (line 28) | public void setMediaId(String mediaId) {
method WxItemThumbEntity (line 32) | public WxItemThumbEntity() {
method WxItemThumbEntity (line 37) | public WxItemThumbEntity(String mediaId) {
method hashCode (line 42) | @Override
method equals (line 50) | @Override
method toString (line 67) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVideoEntity.java
class WxItemVideoEntity (line 20) | @Entity
method getMediaId (line 32) | public String getMediaId() {
method setMediaId (line 35) | public void setMediaId(String mediaId) {
method getTitle (line 38) | public String getTitle() {
method setTitle (line 41) | public void setTitle(String title) {
method getDescription (line 44) | public String getDescription() {
method setDescription (line 47) | public void setDescription(String description) {
method getThumb (line 50) | public WxItemThumbEntity getThumb() {
method setThumb (line 53) | public void setThumb(WxItemThumbEntity thumb) {
method WxItemVideoEntity (line 56) | public WxItemVideoEntity() {
method WxItemVideoEntity (line 60) | public WxItemVideoEntity(String mediaId, String title, String descript...
method toString (line 68) | @Override
method hashCode (line 73) | @Override
method equals (line 84) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVoiceEntity.java
class WxItemVoiceEntity (line 18) | @Entity
method getMediaId (line 27) | public String getMediaId() {
method setMediaId (line 30) | public void setMediaId(String mediaId) {
method getFormat (line 33) | public String getFormat() {
method setFormat (line 36) | public void setFormat(String format) {
method getRecognition (line 39) | public String getRecognition() {
method setRecognition (line 42) | public void setRecognition(String recognition) {
method WxItemVoiceEntity (line 45) | public WxItemVoiceEntity() {
method WxItemVoiceEntity (line 49) | public WxItemVoiceEntity(String mediaId, String format, String recogni...
method toString (line 55) | @Override
method hashCode (line 60) | @Override
method equals (line 70) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/menu/WxMenuBtnEntity.java
class WxMenuBtnEntity (line 28) | @Entity
method getKey (line 46) | public String getKey() {
method setKey (line 49) | public void setKey(String key) {
method getUrl (line 52) | public String getUrl() {
method setUrl (line 55) | public void setUrl(String url) {
method getName (line 58) | public String getName() {
method setName (line 61) | public void setName(String name) {
method getType (line 64) | public String getType() {
method setType (line 67) | public void setType(String type) {
method getParentButton (line 70) | public WxMenuBtnEntity getParentButton() {
method setParentButton (line 73) | public void setParentButton(WxMenuBtnEntity parentButton) {
method getSubButtons (line 76) | public List<WxMenuBtnEntity> getSubButtons() {
method setSubButtons (line 79) | public void setSubButtons(List<WxMenuBtnEntity> subButtons) {
method WxMenuBtnEntity (line 82) | public WxMenuBtnEntity() {
method WxMenuBtnEntity (line 86) | public WxMenuBtnEntity(Long id, Date createdDate) {
method WxMenuBtnEntity (line 90) | public WxMenuBtnEntity(String key, String url, String name, String type,
method toString (line 100) | @Override
method hashCode (line 106) | @Override
method equals (line 120) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgEventEntity.java
class WxMsgEventEntity (line 18) | @Entity
method getEvent (line 33) | public String getEvent() {
method setEvent (line 36) | public void setEvent(String event) {
method getEventKey (line 39) | public String getEventKey() {
method setEventKey (line 42) | public void setEventKey(String eventKey) {
method getTicket (line 45) | public String getTicket() {
method setTicket (line 48) | public void setTicket(String ticket) {
method getLatitude (line 51) | public Double getLatitude() {
method setLatitude (line 54) | public void setLatitude(Double latitude) {
method getLongitude (line 57) | public Double getLongitude() {
method setLongitude (line 60) | public void setLongitude(Double longitude) {
method getPrecisions (line 63) | public Double getPrecisions() {
method setPrecisions (line 66) | public void setPrecisions(Double precisions) {
method WxMsgEventEntity (line 69) | public WxMsgEventEntity() {
method WxMsgEventEntity (line 73) | public WxMsgEventEntity(String toUserName, String fromUserName,
method WxMsgEventEntity (line 78) | public WxMsgEventEntity(String toUserName, String fromUserName,
method toString (line 90) | @Override
method hashCode (line 96) | @Override
method equals (line 112) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgImageEntity.java
class WxMsgImageEntity (line 22) | @Entity
method getImage (line 31) | public WxItemImageEntity getImage() {
method setImage (line 35) | public void setImage(WxItemImageEntity image) {
method WxMsgImageEntity (line 39) | public WxMsgImageEntity() {
method WxMsgImageEntity (line 44) | public WxMsgImageEntity(String toUserName, String fromUserName,
method WxMsgImageEntity (line 50) | public WxMsgImageEntity(String toUserName, String fromUserName,
method toString (line 56) | @Override
method hashCode (line 61) | @Override
method equals (line 69) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLinkEntity.java
class WxMsgLinkEntity (line 21) | @Entity
method WxMsgLinkEntity (line 31) | public WxMsgLinkEntity() {
method WxMsgLinkEntity (line 35) | public WxMsgLinkEntity(String toUserName, String fromUserName,
method WxMsgLinkEntity (line 40) | public WxMsgLinkEntity(String toUserName, String fromUserName,
method toString (line 48) | @Override
method hashCode (line 53) | @Override
method equals (line 63) | @Override
method getTitle (line 89) | public String getTitle() {
method setTitle (line 92) | public void setTitle(String title) {
method getDescription (line 95) | public String getDescription() {
method setDescription (line 98) | public void setDescription(String description) {
method getUrl (line 101) | public String getUrl() {
method setUrl (line 104) | public void setUrl(String url) {
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLocEntity.java
class WxMsgLocEntity (line 21) | @Entity
method getLocationX (line 33) | public Double getLocationX() {
method setLocationX (line 36) | public void setLocationX(Double locationX) {
method getLocationY (line 39) | public Double getLocationY() {
method setLocationY (line 42) | public void setLocationY(Double locationY) {
method getScale (line 45) | public Double getScale() {
method setScale (line 48) | public void setScale(Double scale) {
method getLabel (line 51) | public String getLabel() {
method setLabel (line 54) | public void setLabel(String label) {
method WxMsgLocEntity (line 57) | public WxMsgLocEntity() {
method WxMsgLocEntity (line 61) | public WxMsgLocEntity(String toUserName, String fromUserName,
method WxMsgLocEntity (line 66) | public WxMsgLocEntity(String toUserName, String fromUserName,
method toString (line 75) | @Override
method hashCode (line 80) | @Override
method equals (line 92) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgTextEntity.java
class WxMsgTextEntity (line 22) | @Entity
method getContent (line 29) | public String getContent() {
method setContent (line 33) | public void setContent(String content) {
method WxMsgTextEntity (line 37) | public WxMsgTextEntity() {
method WxMsgTextEntity (line 42) | public WxMsgTextEntity(String content) {
method toString (line 47) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVideoEntity.java
class WxMsgVideoEntity (line 22) | @Entity
method getVideo (line 30) | public WxItemVideoEntity getVideo() {
method setVideo (line 34) | public void setVideo(WxItemVideoEntity video) {
method WxMsgVideoEntity (line 38) | public WxMsgVideoEntity() {
method WxMsgVideoEntity (line 43) | public WxMsgVideoEntity(String toUserName, String fromUserName,
method WxMsgVideoEntity (line 49) | public WxMsgVideoEntity(String toUserName, String fromUserName,
method toString (line 55) | @Override
method hashCode (line 60) | @Override
method equals (line 68) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVoiceEntity.java
class WxMsgVoiceEntity (line 22) | @Entity
method getVoice (line 30) | public WxItemVoiceEntity getVoice() {
method setVoice (line 34) | public void setVoice(WxItemVoiceEntity voice) {
method WxMsgVoiceEntity (line 38) | public WxMsgVoiceEntity() {
method WxMsgVoiceEntity (line 43) | public WxMsgVoiceEntity(String toUserName, String fromUserName,
method WxMsgVoiceEntity (line 49) | public WxMsgVoiceEntity(String toUserName, String fromUserName,
method toString (line 55) | @Override
method hashCode (line 60) | @Override
method equals (line 68) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/qr/WxQrEntity.java
class WxQrEntity (line 22) | @Entity
method getTicket (line 32) | public String getTicket() {
method setTicket (line 35) | public void setTicket(String ticket) {
method getScene (line 38) | public Long getScene() {
method setScene (line 41) | public void setScene(Long scene) {
method getExpireSeconds (line 44) | public Long getExpireSeconds() {
method setExpireSeconds (line 47) | public void setExpireSeconds(Long expireSeconds) {
method WxQrEntity (line 50) | public WxQrEntity() {
method WxQrEntity (line 54) | public WxQrEntity(Long id, Date createdDate) {
method WxQrEntity (line 58) | public WxQrEntity(String ticket, Long scene, Long expireSeconds) {
method toString (line 64) | @Override
method hashCode (line 69) | @Override
method equals (line 79) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespImageEntity.java
class WxRespImageEntity (line 20) | @Entity
method getImage (line 27) | public WxItemImageEntity getImage() {
method setImage (line 31) | public void setImage(WxItemImageEntity image) {
method WxRespImageEntity (line 35) | public WxRespImageEntity() {
method WxRespImageEntity (line 40) | public WxRespImageEntity(WxItemImageEntity image) {
method toString (line 45) | @Override
method hashCode (line 50) | @Override
method equals (line 58) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespMusicEntity.java
class WxRespMusicEntity (line 22) | @Entity
method getMusic (line 31) | public WxItemMusicEntity getMusic() {
method setMusic (line 34) | public void setMusic(WxItemMusicEntity music) {
method getThumb (line 37) | public WxItemThumbEntity getThumb() {
method setThumb (line 40) | public void setThumb(WxItemThumbEntity thumb) {
method WxRespMusicEntity (line 43) | public WxRespMusicEntity() {
method WxRespMusicEntity (line 47) | public WxRespMusicEntity(WxItemMusicEntity music, WxItemThumbEntity th...
method toString (line 52) | @Override
method hashCode (line 56) | @Override
method equals (line 64) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespPicDescEntity.java
class WxRespPicDescEntity (line 23) | @Entity
method getArticles (line 31) | public List<WxItemPicDescEntity> getArticles() {
method setArticles (line 35) | public void setArticles(List<WxItemPicDescEntity> articles) {
method WxRespPicDescEntity (line 39) | public WxRespPicDescEntity() {
method WxRespPicDescEntity (line 44) | public WxRespPicDescEntity(List<WxItemPicDescEntity> articles) {
method toString (line 49) | @Override
method hashCode (line 54) | @Override
method equals (line 63) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespTextEntity.java
class WxRespTextEntity (line 19) | @Entity
method getContent (line 25) | public String getContent() {
method setContent (line 29) | public void setContent(String content) {
method WxRespTextEntity (line 33) | public WxRespTextEntity() {
method WxRespTextEntity (line 38) | public WxRespTextEntity(String content) {
method toString (line 43) | @Override
method hashCode (line 48) | @Override
method equals (line 56) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVideoEntity.java
class WxRespVideoEntity (line 20) | @Entity
method getVideo (line 28) | public WxItemVideoEntity getVideo() {
method setVideo (line 32) | public void setVideo(WxItemVideoEntity video) {
method WxRespVideoEntity (line 36) | public WxRespVideoEntity() {
method toString (line 41) | @Override
method WxRespVideoEntity (line 46) | public WxRespVideoEntity(WxItemVideoEntity video) {
method hashCode (line 51) | @Override
method equals (line 59) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVoiceEntity.java
class WxRespVoiceEntity (line 20) | @Entity
method getVoice (line 28) | public WxItemVoiceEntity getVoice() {
method setVoice (line 32) | public void setVoice(WxItemVoiceEntity voice) {
method WxRespVoiceEntity (line 36) | public WxRespVoiceEntity() {
method WxRespVoiceEntity (line 41) | public WxRespVoiceEntity(WxItemVoiceEntity voice) {
method toString (line 46) | @Override
method hashCode (line 51) | @Override
method equals (line 59) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/user/WxGroupEntity.java
class WxGroupEntity (line 22) | @Entity
method getWxId (line 32) | public Long getWxId() {
method setWxId (line 35) | public void setWxId(Long wxId) {
method getName (line 38) | public String getName() {
method setName (line 41) | public void setName(String name) {
method getCount (line 44) | public String getCount() {
method setCount (line 47) | public void setCount(String count) {
method WxGroupEntity (line 50) | public WxGroupEntity() {
method WxGroupEntity (line 54) | public WxGroupEntity(Long id, Date createdDate) {
method WxGroupEntity (line 58) | public WxGroupEntity(Long wxId, String name, String count) {
method toString (line 64) | @Override
method hashCode (line 69) | @Override
method equals (line 78) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/entity/user/WxUserEntity.java
class WxUserEntity (line 22) | @Entity
method getOpenId (line 49) | public String getOpenId() {
method setOpenId (line 52) | public void setOpenId(String openId) {
method getSubscribe (line 55) | public Integer getSubscribe() {
method setSubscribe (line 58) | public void setSubscribe(Integer subscribe) {
method getNickName (line 61) | public String getNickName() {
method setNickName (line 64) | public void setNickName(String nickName) {
method getSex (line 67) | public Integer getSex() {
method setSex (line 70) | public void setSex(Integer sex) {
method getLanguage (line 73) | public String getLanguage() {
method setLanguage (line 76) | public void setLanguage(String language) {
method getCity (line 79) | public String getCity() {
method setCity (line 82) | public void setCity(String city) {
method getProvince (line 85) | public String getProvince() {
method setProvince (line 88) | public void setProvince(String province) {
method getCountry (line 91) | public String getCountry() {
method setCountry (line 94) | public void setCountry(String country) {
method getHeadImgUrl (line 97) | public String getHeadImgUrl() {
method setHeadImgUrl (line 100) | public void setHeadImgUrl(String headImgUrl) {
method getSubscribeTime (line 103) | public Long getSubscribeTime() {
method setSubscribeTime (line 106) | public void setSubscribeTime(Long subscribeTime) {
method WxUserEntity (line 109) | public WxUserEntity() {
method WxUserEntity (line 113) | public WxUserEntity(Long id, Date createdDate) {
method WxUserEntity (line 117) | public WxUserEntity(String openId, Integer subscribe, String nickName,
method toString (line 132) | @Override
method hashCode (line 140) | @Override
method equals (line 162) | @Override
FILE: src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthDao.java
type WxAuthDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthReqDao.java
type WxAuthReqDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemImageDao.java
type WxItemImageDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemMusicDao.java
type WxItemMusicDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemPicDescDao.java
type WxItemPicDescDao (line 18) | @Repository
method findByIdIn (line 25) | List<WxItemPicDescEntity> findByIdIn(List<Long> ids);
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemThumbDao.java
type WxItemThumbDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVideoDao.java
type WxItemVideoDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVoiceDao.java
type WxItemVoiceDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/menu/WxMenuBtnDao.java
type WxMenuBtnDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxBaseMsgDao.java
type WxBaseMsgDao (line 15) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgEventDao.java
type WxMsgEventDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgImageDao.java
type WxMsgImageDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLinkDao.java
type WxMsgLinkDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLocDao.java
type WxMsgLocDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgTextDao.java
type WxMsgTextDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVideoDao.java
type WxMsgVideoDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVoiceDao.java
type WxMsgVoiceDao (line 14) | public interface WxMsgVoiceDao extends PagingAndSortingRepository<WxMsgV...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespImageDao.java
type WxRespImageDao (line 15) | public interface WxRespImageDao extends PagingAndSortingRepository<WxRes...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespMusicDao.java
type WxRespMusicDao (line 15) | public interface WxRespMusicDao extends PagingAndSortingRepository<WxRes...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespPicDescDao.java
type WxRespPicDescDao (line 15) | public interface WxRespPicDescDao extends PagingAndSortingRepository<WxR...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespTextDao.java
type WxRespTextDao (line 15) | public interface WxRespTextDao extends PagingAndSortingRepository<WxResp...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVideoDao.java
type WxRespVideoDao (line 15) | public interface WxRespVideoDao extends PagingAndSortingRepository<WxRes...
FILE: src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVoiceDao.java
type WxRespVoiceDao (line 16) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/user/WxGroupDao.java
type WxGroupDao (line 17) | @Repository
FILE: src/main/java/org/hamster/weixinmp/dao/repository/user/WxUserDao.java
type WxUserDao (line 17) | @Repository
FILE: src/main/java/org/hamster/weixinmp/exception/WxException.java
class WxException (line 13) | public class WxException extends Exception {
method WxException (line 21) | public WxException() {
method WxException (line 27) | public WxException(String message) {
method WxException (line 34) | public WxException(Throwable cause) {
method WxException (line 42) | public WxException(String message, Throwable cause) {
method WxException (line 50) | public WxException(WxRespCode errorJson) {
method getError (line 55) | public WxRespCode getError() {
method setError (line 59) | public void setError(WxRespCode error) {
FILE: src/main/java/org/hamster/weixinmp/gson/WxMenuBtnSerializer.java
class WxMenuBtnSerializer (line 23) | public class WxMenuBtnSerializer implements JsonSerializer<WxMenuBtnEnti...
method serialize (line 31) | public JsonElement serialize(WxMenuBtnEntity src, Type typeOfSrc,
method recursiveParse (line 36) | public JsonObject recursiveParse(WxMenuBtnEntity parentEntity) {
FILE: src/main/java/org/hamster/weixinmp/model/WxAccessTokenJson.java
class WxAccessTokenJson (line 12) | public class WxAccessTokenJson {
method getAccess_token (line 16) | public String getAccess_token() {
method setAccess_token (line 19) | public void setAccess_token(String access_token) {
method getExpires_in (line 22) | public String getExpires_in() {
method setExpires_in (line 25) | public void setExpires_in(String expires_in) {
method WxAccessTokenJson (line 28) | public WxAccessTokenJson() {
method WxAccessTokenJson (line 32) | public WxAccessTokenJson(String access_token, String expires_in) {
FILE: src/main/java/org/hamster/weixinmp/model/WxRespCode.java
class WxRespCode (line 12) | public class WxRespCode {
method getErrcode (line 15) | public Integer getErrcode() {
method setErrcode (line 18) | public void setErrcode(Integer errcode) {
method getErrmsg (line 21) | public String getErrmsg() {
method setErrmsg (line 24) | public void setErrmsg(String errmsg) {
method WxRespCode (line 27) | public WxRespCode() {
method WxRespCode (line 31) | public WxRespCode(Integer errcode, String errmsg) {
FILE: src/main/java/org/hamster/weixinmp/model/menu/WxMenuCreateJson.java
class WxMenuCreateJson (line 15) | public class WxMenuCreateJson {
method getButton (line 19) | public List<WxMenuBtnEntity> getButton() {
method setButton (line 23) | public void setButton(List<WxMenuBtnEntity> button) {
method WxMenuCreateJson (line 27) | public WxMenuCreateJson() {
method WxMenuCreateJson (line 32) | public WxMenuCreateJson(List<WxMenuBtnEntity> button) {
FILE: src/main/java/org/hamster/weixinmp/model/menu/WxMenuGetJson.java
class WxMenuGetJson (line 12) | public class WxMenuGetJson {
method getMenu (line 15) | public WxMenuCreateJson getMenu() {
method setMenu (line 19) | public void setMenu(WxMenuCreateJson menu) {
method WxMenuGetJson (line 23) | public WxMenuGetJson() {
method WxMenuGetJson (line 28) | public WxMenuGetJson(WxMenuCreateJson menu) {
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrActionInfoJson.java
class WxQrActionInfoJson (line 12) | public class WxQrActionInfoJson {
method getScene (line 15) | public WxQrSceneJson getScene() {
method setScene (line 19) | public void setScene(WxQrSceneJson scene) {
method WxQrActionInfoJson (line 23) | public WxQrActionInfoJson(WxQrSceneJson scene) {
method WxQrActionInfoJson (line 28) | public WxQrActionInfoJson() {
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrCreateJson.java
class WxQrCreateJson (line 12) | public class WxQrCreateJson {
method getAction_name (line 16) | public String getAction_name() {
method setAction_name (line 19) | public void setAction_name(String action_name) {
method getExpire_seconds (line 22) | public Long getExpire_seconds() {
method setExpire_seconds (line 25) | public void setExpire_seconds(Long expire_seconds) {
method getAction_info (line 28) | public WxQrActionInfoJson getAction_info() {
method setAction_info (line 31) | public void setAction_info(WxQrActionInfoJson action_info) {
method WxQrCreateJson (line 34) | public WxQrCreateJson() {
method WxQrCreateJson (line 38) | public WxQrCreateJson(String action_name, Long expire_seconds,
FILE: src/main/java/org/hamster/weixinmp/model/qr/WxQrSceneJson.java
class WxQrSceneJson (line 12) | public class WxQrSceneJson {
method getScene_id (line 16) | public Long getScene_id() {
method setScene_id (line 20) | public void setScene_id(Long scene_id) {
method WxQrSceneJson (line 24) | public WxQrSceneJson() {
method WxQrSceneJson (line 29) | public WxQrSceneJson(Long scene_id) {
FILE: src/main/java/org/hamster/weixinmp/model/send/SendImageJson.java
class SendImageJson (line 13) | public class SendImageJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getImage (line 29) | public SendItemImageJson getImage() {
method setImage (line 32) | public void setImage(SendItemImageJson image) {
method SendImageJson (line 35) | public SendImageJson() {
method SendImageJson (line 39) | public SendImageJson(String touser, String msgtype, SendItemImageJson ...
FILE: src/main/java/org/hamster/weixinmp/model/send/SendItemPicDescJson.java
class SendItemPicDescJson (line 13) | public class SendItemPicDescJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getNews (line 29) | public WxSendItemArticleWrapper getNews() {
method setNews (line 32) | public void setNews(WxSendItemArticleWrapper news) {
method SendItemPicDescJson (line 35) | public SendItemPicDescJson(String touser, String msgtype,
method SendItemPicDescJson (line 42) | public SendItemPicDescJson() {
FILE: src/main/java/org/hamster/weixinmp/model/send/SendMusicJson.java
class SendMusicJson (line 13) | public class SendMusicJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getMusic (line 29) | public SendItemMusicJson getMusic() {
method setMusic (line 32) | public void setMusic(SendItemMusicJson music) {
method SendMusicJson (line 35) | public SendMusicJson() {
method SendMusicJson (line 39) | public SendMusicJson(String touser, String msgtype, SendItemMusicJson ...
FILE: src/main/java/org/hamster/weixinmp/model/send/SendTextJson.java
class SendTextJson (line 13) | public class SendTextJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getContent (line 29) | public SendItemTextJson getContent() {
method setContent (line 32) | public void setContent(SendItemTextJson content) {
method SendTextJson (line 35) | public SendTextJson() {
method SendTextJson (line 39) | public SendTextJson(String touser, String msgtype, SendItemTextJson co...
FILE: src/main/java/org/hamster/weixinmp/model/send/SendVideoJson.java
class SendVideoJson (line 13) | public class SendVideoJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getVoice (line 29) | public SendItemVoiceJson getVoice() {
method setVoice (line 32) | public void setVoice(SendItemVoiceJson voice) {
method SendVideoJson (line 35) | public SendVideoJson() {
method SendVideoJson (line 39) | public SendVideoJson(String touser, String msgtype, SendItemVoiceJson ...
FILE: src/main/java/org/hamster/weixinmp/model/send/SendVoiceJson.java
class SendVoiceJson (line 13) | public class SendVoiceJson {
method getTouser (line 17) | public String getTouser() {
method setTouser (line 20) | public void setTouser(String touser) {
method getMsgtype (line 23) | public String getMsgtype() {
method setMsgtype (line 26) | public void setMsgtype(String msgtype) {
method getVideo (line 29) | public SendItemVideoJson getVideo() {
method setVideo (line 32) | public void setVideo(SendItemVideoJson video) {
method SendVoiceJson (line 35) | public SendVoiceJson(String touser, String msgtype, SendItemVideoJson ...
method SendVoiceJson (line 41) | public SendVoiceJson() {
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemArticleJson.java
class SendItemArticleJson (line 12) | public class SendItemArticleJson {
method getTitle (line 17) | public String getTitle() {
method setTitle (line 20) | public void setTitle(String title) {
method getDescription (line 23) | public String getDescription() {
method setDescription (line 26) | public void setDescription(String description) {
method getUrl (line 29) | public String getUrl() {
method setUrl (line 32) | public void setUrl(String url) {
method getPicurl (line 35) | public String getPicurl() {
method setPicurl (line 38) | public void setPicurl(String picurl) {
method SendItemArticleJson (line 41) | public SendItemArticleJson() {
method SendItemArticleJson (line 45) | public SendItemArticleJson(String title, String description, String url,
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemImageJson.java
class SendItemImageJson (line 12) | public class SendItemImageJson {
method getMediaId (line 15) | public String getMediaId() {
method setMediaId (line 19) | public void setMediaId(String mediaId) {
method SendItemImageJson (line 23) | public SendItemImageJson() {
method SendItemImageJson (line 28) | public SendItemImageJson(String mediaId) {
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemMusicJson.java
class SendItemMusicJson (line 12) | public class SendItemMusicJson {
method getTitle (line 18) | public String getTitle() {
method setTitle (line 21) | public void setTitle(String title) {
method getDescription (line 24) | public String getDescription() {
method setDescription (line 27) | public void setDescription(String description) {
method getMusicurl (line 30) | public String getMusicurl() {
method setMusicurl (line 33) | public void setMusicurl(String musicurl) {
method getHqmusicurl (line 36) | public String getHqmusicurl() {
method setHqmusicurl (line 39) | public void setHqmusicurl(String hqmusicurl) {
method getThumb_media_id (line 42) | public String getThumb_media_id() {
method setThumb_media_id (line 45) | public void setThumb_media_id(String thumb_media_id) {
method SendItemMusicJson (line 48) | public SendItemMusicJson() {
method SendItemMusicJson (line 52) | public SendItemMusicJson(String title, String description, String musi...
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemTextJson.java
class SendItemTextJson (line 12) | public class SendItemTextJson {
method getText (line 15) | public String getText() {
method setText (line 19) | public void setText(String text) {
method SendItemTextJson (line 23) | public SendItemTextJson() {
method SendItemTextJson (line 28) | public SendItemTextJson(String text) {
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemVideoJson.java
class SendItemVideoJson (line 12) | public class SendItemVideoJson {
method getMediaId (line 16) | public String getMediaId() {
method setMediaId (line 19) | public void setMediaId(String mediaId) {
method getTitle (line 22) | public String getTitle() {
method setTitle (line 25) | public void setTitle(String title) {
method getDescription (line 28) | public String getDescription() {
method setDescription (line 31) | public void setDescription(String description) {
method SendItemVideoJson (line 34) | public SendItemVideoJson() {
method SendItemVideoJson (line 38) | public SendItemVideoJson(String mediaId, String title, String descript...
FILE: src/main/java/org/hamster/weixinmp/model/send/item/SendItemVoiceJson.java
class SendItemVoiceJson (line 12) | public class SendItemVoiceJson {
method getMediaId (line 15) | public String getMediaId() {
method setMediaId (line 19) | public void setMediaId(String mediaId) {
method SendItemVoiceJson (line 23) | public SendItemVoiceJson() {
method SendItemVoiceJson (line 28) | public SendItemVoiceJson(String mediaId) {
FILE: src/main/java/org/hamster/weixinmp/model/send/item/wrapper/WxSendItemArticleWrapper.java
class WxSendItemArticleWrapper (line 15) | public class WxSendItemArticleWrapper {
method getArticles (line 19) | public List<SendItemArticleJson> getArticles() {
method setArticles (line 23) | public void setArticles(List<SendItemArticleJson> articles) {
method WxSendItemArticleWrapper (line 27) | public WxSendItemArticleWrapper() {
method WxSendItemArticleWrapper (line 32) | public WxSendItemArticleWrapper(List<SendItemArticleJson> articles) {
FILE: src/main/java/org/hamster/weixinmp/model/user/WxOpenIdListJson.java
class WxOpenIdListJson (line 13) | public class WxOpenIdListJson {
method getOpenid (line 16) | public List<String> getOpenid() {
method setOpenid (line 20) | public void setOpenid(List<String> openid) {
method WxOpenIdListJson (line 24) | public WxOpenIdListJson() {
method WxOpenIdListJson (line 29) | public WxOpenIdListJson(List<String> openid) {
FILE: src/main/java/org/hamster/weixinmp/model/user/WxUserGetJson.java
class WxUserGetJson (line 14) | public class WxUserGetJson {
method getTotal (line 19) | public Long getTotal() {
method setTotal (line 22) | public void setTotal(Long total) {
method getCount (line 25) | public Long getCount() {
method setCount (line 28) | public void setCount(Long count) {
method getData (line 31) | public WxOpenIdListJson getData() {
method setData (line 34) | public void setData(WxOpenIdListJson data) {
method getNext_openid (line 37) | public String getNext_openid() {
method setNext_openid (line 40) | public void setNext_openid(String next_openid) {
method WxUserGetJson (line 43) | public WxUserGetJson() {
method WxUserGetJson (line 47) | public WxUserGetJson(Long total, Long count, WxOpenIdListJson data,
FILE: src/main/java/org/hamster/weixinmp/service/WxAuthService.java
class WxAuthService (line 31) | @Service
method getAccessToken (line 39) | public WxAuth getAccessToken(String appid, String appsecret)
method validateAuth (line 54) | public boolean validateAuth(String signature, String timestamp,
method getStringToHash (line 75) | protected static String getStringToHash(String timestamp, String nonce,
method hash (line 91) | protected static String hash(String str) {
FILE: src/main/java/org/hamster/weixinmp/service/WxMediaService.java
class WxMediaService (line 31) | @Service
method remoteMediaUpload (line 37) | public WxBaseItemMediaEntity remoteMediaUpload(String accessToken,
class MediaResultMapper (line 105) | class MediaResultMapper {
method getType (line 109) | public String getType() {
method setType (line 112) | public void setType(String type) {
method getMedia_id (line 115) | public String getMedia_id() {
method setMedia_id (line 118) | public void setMedia_id(String media_id) {
method getCreated_at (line 121) | public Long getCreated_at() {
method setCreated_at (line 124) | public void setCreated_at(Long created_at) {
method MediaResultMapper (line 127) | public MediaResultMapper() {
method MediaResultMapper (line 131) | public MediaResultMapper(String type, String media_id, Long created_at) {
method toString (line 137) | @Override
method hashCode (line 142) | @Override
method equals (line 153) | @Override
FILE: src/main/java/org/hamster/weixinmp/service/WxMenuService.java
class WxMenuService (line 34) | @Service
method menuCreate (line 39) | public WxRespCode menuCreate(String accessToken, List<WxMenuBtnEntity>...
method menuGet (line 60) | public List<WxMenuBtnEntity> menuGet(String accessToken) throws WxExce...
method menuDelete (line 67) | public WxRespCode menuDelete(String accessToken) throws WxException {
FILE: src/main/java/org/hamster/weixinmp/service/WxMessageService.java
class WxMessageService (line 39) | @Service
method parseXML (line 45) | public WxBaseMsgEntity parseXML(String xml) throws DocumentException,
method handleMessage (line 75) | public WxBaseRespEntity handleMessage(WxBaseMsgEntity msg) {
method parseRespXML (line 94) | public Element parseRespXML(WxBaseRespEntity resp) throws DocumentExce...
method defaultResult (line 115) | protected WxRespTextEntity defaultResult(String fromUserName, String t...
class WxMessageHandlerComparator (line 129) | class WxMessageHandlerComparator implements Comparator<WxMessageHandlerI...
method compare (line 134) | public int compare(WxMessageHandlerIfc o1, WxMessageHandlerIfc o2) {
FILE: src/main/java/org/hamster/weixinmp/service/WxQrService.java
class WxQrService (line 27) | @Service
method remoteQrcodeCreate (line 32) | public WxQrEntity remoteQrcodeCreate(String accessToken,
FILE: src/main/java/org/hamster/weixinmp/service/WxStorageService.java
class WxStorageService (line 61) | @Service
method saveMsgText (line 125) | public WxMsgTextEntity saveMsgText(Element ele) throws DocumentExcepti...
method saveMsgImg (line 135) | public WxMsgImageEntity saveMsgImg(Element ele) throws DocumentExcepti...
method saveMsgLink (line 145) | public WxMsgLinkEntity saveMsgLink(Element ele) throws DocumentExcepti...
method saveMsgLoc (line 155) | public WxMsgLocEntity saveMsgLoc(Element ele) throws DocumentException {
method saveMsgEvent (line 165) | public WxMsgEventEntity saveMsgEvent(Element ele) throws DocumentExcep...
method createRespText (line 175) | public WxRespTextEntity createRespText(String content, String fromUser...
method createRespPicDesc (line 193) | public WxRespPicDescEntity createRespPicDesc(
method createRespPicDesc2 (line 212) | public WxRespPicDescEntity createRespPicDesc2(List<Long> articleIds,
method createRespMusic (line 230) | public WxRespMusicEntity createRespMusic(String fromUserName,
method handleMessage (line 251) | public WxBaseRespEntity handleMessage(WxBaseMsgEntity msg) {
method getAuthDao (line 258) | public WxAuthDao getAuthDao() {
method setAuthDao (line 262) | public void setAuthDao(WxAuthDao authDao) {
method getAuthReqDao (line 266) | public WxAuthReqDao getAuthReqDao() {
method setAuthReqDao (line 270) | public void setAuthReqDao(WxAuthReqDao authReqDao) {
method getMsgTextDao (line 274) | public WxMsgTextDao getMsgTextDao() {
method setMsgTextDao (line 278) | public void setMsgTextDao(WxMsgTextDao msgTextDao) {
method getMsgImgDao (line 282) | public WxMsgImageDao getMsgImgDao() {
method setMsgImgDao (line 286) | public void setMsgImgDao(WxMsgImageDao msgImgDao) {
method getMsgLinkDao (line 290) | public WxMsgLinkDao getMsgLinkDao() {
method setMsgLinkDao (line 294) | public void setMsgLinkDao(WxMsgLinkDao msgLinkDao) {
method getMsgLocDao (line 298) | public WxMsgLocDao getMsgLocDao() {
method setMsgLocDao (line 302) | public void setMsgLocDao(WxMsgLocDao msgLocDao) {
method getMsgEventDao (line 306) | public WxMsgEventDao getMsgEventDao() {
method setMsgEventDao (line 310) | public void setMsgEventDao(WxMsgEventDao msgEventDao) {
method getMsgVideoDao (line 314) | public WxMsgVideoDao getMsgVideoDao() {
method setMsgVideoDao (line 318) | public void setMsgVideoDao(WxMsgVideoDao msgVideoDao) {
method getMsgVoiceDao (line 322) | public WxMsgVoiceDao getMsgVoiceDao() {
method setMsgVoiceDao (line 326) | public void setMsgVoiceDao(WxMsgVoiceDao msgVoiceDao) {
method getRespTextDao (line 330) | public WxRespTextDao getRespTextDao() {
method setRespTextDao (line 334) | public void setRespTextDao(WxRespTextDao respTextDao) {
method getRespPicDescDao (line 338) | public WxRespPicDescDao getRespPicDescDao() {
method setRespPicDescDao (line 342) | public void setRespPicDescDao(WxRespPicDescDao respPicDescDao) {
method getRespMusicDao (line 346) | public WxRespMusicDao getRespMusicDao() {
method setRespMusicDao (line 350) | public void setRespMusicDao(WxRespMusicDao respMusicDao) {
method getRespImageDao (line 354) | public WxRespImageDao getRespImageDao() {
method setRespImageDao (line 358) | public void setRespImageDao(WxRespImageDao respImageDao) {
method getRespVideoDao (line 362) | public WxRespVideoDao getRespVideoDao() {
method setRespVideoDao (line 366) | public void setRespVideoDao(WxRespVideoDao respVideoDao) {
method getRespVoiceDao (line 370) | public WxRespVoiceDao getRespVoiceDao() {
method setRespVoiceDao (line 374) | public void setRespVoiceDao(WxRespVoiceDao respVoiceDao) {
method getItemImageDao (line 378) | public WxItemImageDao getItemImageDao() {
method setItemImageDao (line 382) | public void setItemImageDao(WxItemImageDao itemImageDao) {
method getItemMusicDao (line 386) | public WxItemMusicDao getItemMusicDao() {
method setItemMusicDao (line 390) | public void setItemMusicDao(WxItemMusicDao itemMusicDao) {
method getWxItemPicDescDao (line 394) | public WxItemPicDescDao getWxItemPicDescDao() {
method setWxItemPicDescDao (line 398) | public void setWxItemPicDescDao(WxItemPicDescDao wxItemPicDescDao) {
method getItemThumbDao (line 402) | public WxItemThumbDao getItemThumbDao() {
method setItemThumbDao (line 406) | public void setItemThumbDao(WxItemThumbDao itemThumbDao) {
method getItemVideoDao (line 410) | public WxItemVideoDao getItemVideoDao() {
method setItemVideoDao (line 414) | public void setItemVideoDao(WxItemVideoDao itemVideoDao) {
method getItemVoiceDao (line 418) | public WxItemVoiceDao getItemVoiceDao() {
method setItemVoiceDao (line 422) | public void setItemVoiceDao(WxItemVoiceDao itemVoiceDao) {
method getWxMenuBtnDao (line 426) | public WxMenuBtnDao getWxMenuBtnDao() {
method setWxMenuBtnDao (line 430) | public void setWxMenuBtnDao(WxMenuBtnDao wxMenuBtnDao) {
method getGroupDao (line 434) | public WxGroupDao getGroupDao() {
method setGroupDao (line 438) | public void setGroupDao(WxGroupDao groupDao) {
method getUserDao (line 442) | public WxUserDao getUserDao() {
method setUserDao (line 446) | public void setUserDao(WxUserDao userDao) {
method getToken (line 450) | public String getToken() {
method setToken (line 454) | public void setToken(String token) {
method getWxConfig (line 458) | public WxConfig getWxConfig() {
method setWxConfig (line 462) | public void setWxConfig(WxConfig wxConfig) {
method getLog (line 466) | public static Logger getLog() {
FILE: src/main/java/org/hamster/weixinmp/service/WxUserGroupService.java
class WxUserGroupService (line 27) | @Service
method remoteGroupsCreate (line 44) | public WxGroupEntity remoteGroupsCreate(String accessToken, String gro...
method remoteGroupsGet (line 69) | public List<WxGroupEntity> remoteGroupsGet(String accessToken)
method remoteGroupsGetId (line 86) | public Long remoteGroupsGetId(String accessToken, String openId)
method remoteGroupsUpdate (line 108) | public WxRespCode remoteGroupsUpdate(String accessToken, Long id,
method remoteGroupsMembersUpdate (line 133) | public WxRespCode remoteGroupsMembersUpdate(String accessToken,
class ResultMapper (line 145) | final class ResultMapper {
method getGroup (line 149) | public WxGroupEntity getGroup() {
method setGroup (line 152) | public void setGroup(WxGroupEntity group) {
method getGroups (line 155) | public List<WxGroupEntity> getGroups() {
method setGroups (line 158) | public void setGroups(List<WxGroupEntity> groups) {
method getGroupid (line 161) | public Long getGroupid() {
method setGroupid (line 164) | public void setGroupid(Long groupid) {
method ResultMapper (line 167) | public ResultMapper() {
method ResultMapper (line 171) | public ResultMapper(WxGroupEntity group, List<WxGroupEntity> groups,
method toString (line 178) | @Override
method hashCode (line 183) | @Override
method equals (line 192) | @Override
FILE: src/main/java/org/hamster/weixinmp/service/WxUserService.java
class WxUserService (line 25) | @Service
method remoteUserInfo (line 31) | public WxUserEntity remoteUserInfo(String accessToken, String openId) ...
method remoteUserGet (line 38) | public WxUserGetJson remoteUserGet(String accessToken, String nextOpen...
method remoteUserGet (line 47) | public WxUserGetJson remoteUserGet(String accessToken) throws WxExcept...
FILE: src/main/java/org/hamster/weixinmp/service/handler/WxMessageHandlerIfc.java
type WxMessageHandlerIfc (line 17) | public interface WxMessageHandlerIfc {
method listIntetestedMessageType (line 19) | WxMsgTypeEnum[] listIntetestedMessageType();
method handle (line 21) | WxBaseRespEntity handle(WxBaseMsgEntity msg, Map<String, Object> conte...
method priority (line 23) | Integer priority();
FILE: src/main/java/org/hamster/weixinmp/util/WxUtil.java
class WxUtil (line 35) | public class WxUtil {
method WxUtil (line 37) | private WxUtil() {
method currentTimeInSec (line 40) | public static final Long currentTimeInSec() {
method sendRequest (line 44) | @SuppressWarnings("unchecked")
method toJsonStringEntity (line 107) | public static StringEntity toJsonStringEntity(Object obj) {
method getAccessTokenParams (line 112) | public static Map<String, String> getAccessTokenParams(String accessTo...
method getParameterizedUrl (line 118) | public static String getParameterizedUrl(String url, String... args) {
FILE: src/test/java/org/hamster/weixinmp/test/base/AbstractServiceTest.java
class AbstractServiceTest (line 10) | @ContextConfiguration(locations = { "file:src/test/resources/application...
FILE: src/test/java/org/hamster/weixinmp/test/base/AbstractWxServiceTest.java
class AbstractWxServiceTest (line 26) | public abstract class AbstractWxServiceTest extends AbstractServiceTest {
method setUp (line 40) | @Before
FILE: src/test/java/org/hamster/weixinmp/test/controller/WxControllerManualTest.java
class WxControllerManualTest (line 30) | public class WxControllerManualTest {
method testPostMsgText (line 34) | @Test
method main (line 63) | public static final void main(String[] args) {
FILE: src/test/java/org/hamster/weixinmp/test/service/WxGroupServceTest.java
class WxGroupServceTest (line 21) | public class WxGroupServceTest extends AbstractWxServiceTest {
method testAll (line 29) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/service/WxMediaServiceTest.java
class WxMediaServiceTest (line 27) | public class WxMediaServiceTest extends AbstractWxServiceTest {
method testMedia (line 35) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/service/WxMenuServiceTest.java
class WxMenuServiceTest (line 21) | public class WxMenuServiceTest extends AbstractWxServiceTest {
method testAll (line 42) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/service/WxQrServiceTest.java
class WxQrServiceTest (line 18) | public class WxQrServiceTest extends AbstractWxServiceTest {
method testAll (line 26) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/service/WxServiceTest.java
class WxServiceTest (line 20) | public class WxServiceTest extends AbstractServiceTest {
method testValidateAuth (line 28) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/service/WxUserServiceTest.java
class WxUserServiceTest (line 19) | public class WxUserServiceTest extends AbstractWxServiceTest {
method testAll (line 26) | @Test
FILE: src/test/java/org/hamster/weixinmp/test/xml/WxXMLUtilTest.java
class WxXMLUtilTest (line 23) | public class WxXMLUtilTest {
method testGetMsgText (line 33) | @Test
method testGetMsgImg (line 49) | @Test
method testGetMsgLoc (line 67) | @Test
method testGetMsgLink (line 87) | @Test
method testGetMsgEvent (line 104) | @Test
method assertBaseFields (line 112) | private void assertBaseFields(WxBaseMsgEntity entity) {
method assertBaseFieldsWithMsgId (line 119) | private void assertBaseFieldsWithMsgId(WxBaseMsgEntity entity) {
Condensed preview — 130 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (267K chars).
[
{
"path": ".gitignore",
"chars": 45,
"preview": "target/\n.project\n.settings/\n.classpath\n/logs\n"
},
{
"path": ".mymetadata",
"chars": 328,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project-module\n type=\"WEB\"\n name=\"WeixinMultiPlatform\"\n id=\"myeclipse.141861"
},
{
"path": "LICENSE",
"chars": 10273,
"preview": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AN"
},
{
"path": "README.md",
"chars": 1919,
"preview": "# WeixinMultiPlatform\nweixin-mp-java 基于Java,Spring,Maven实现的微信公众平台一整套代码,从前端Controller到后端的Dao的实现<br /> ============== "
},
{
"path": "pom.xml",
"chars": 7653,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "src/main/java/org/hamster/weixinmp/config/WxConfig.java",
"chars": 11332,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.config;\n\nimport org.springframework.beans.factory.annotation.Value;\nimport org."
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMediaType.java",
"chars": 506,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 29, 2013\n *\n */"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMediaTypeEnum.java",
"chars": 807,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n *\n */\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMenuBtnType.java",
"chars": 239,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 5, 2014\n *\n */\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMenuBtnTypeEnum.java",
"chars": 669,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n *\n */\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgEventType.java",
"chars": 422,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 2013\n * \n *"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgEventTypeEnum.java",
"chars": 795,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 5, 2014\n *\n */\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgRespType.java",
"chars": 418,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 5, 2014\n * \n */"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgRespTypeEnum.java",
"chars": 789,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 5, 2014\n *\n */\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgType.java",
"chars": 467,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 2013\n * \n *"
},
{
"path": "src/main/java/org/hamster/weixinmp/constant/WxMsgTypeEnum.java",
"chars": 771,
"preview": "package org.hamster.weixinmp.constant;\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jul 28, 2013\n * \n */\npublic enu"
},
{
"path": "src/main/java/org/hamster/weixinmp/controller/WxController.java",
"chars": 2011,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.controller;\n\nimport org.apache.log4j.Logger;\nimport org.dom4j.DocumentException"
},
{
"path": "src/main/java/org/hamster/weixinmp/controller/util/WxJsonUtil.java",
"chars": 1133,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.controller.util;\n\nimport java.util.List;\n\nimport org.hamster.weixinmp.dao.entit"
},
{
"path": "src/main/java/org/hamster/weixinmp/controller/util/WxXmlUtil.java",
"chars": 19730,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.controller.util;\n\nimport java.util.Date;\n\nimport org.apache.commons.lang3.Strin"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuth.java",
"chars": 3648,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.auth;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/auth/WxAuthReq.java",
"chars": 1457,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.auth;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseEntity.java",
"chars": 2079,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.base;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseItemMediaEntity.java",
"chars": 252,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.base;\n\nimport javax.persistence.MappedSuperclass;\n\n/**\n * @author ho"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseMsgEntity.java",
"chars": 2357,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.base;\n\nimport javax.persistence.Column;\nimport javax.persistence.Dis"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/base/WxBaseRespEntity.java",
"chars": 3762,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.base;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemImageEntity.java",
"chars": 1238,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemMusicEntity.java",
"chars": 3667,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemPicDescEntity.java",
"chars": 2999,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemThumbEntity.java",
"chars": 1543,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVideoEntity.java",
"chars": 3147,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/item/WxItemVoiceEntity.java",
"chars": 2582,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.item;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/menu/WxMenuBtnEntity.java",
"chars": 4406,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.menu;\n\nimport java.util.Date;\nimport java.util.List;\n\nimport javax.p"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgEventEntity.java",
"chars": 4390,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.Column;\nimport javax.persistence.Enti"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgImageEntity.java",
"chars": 2094,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.DiscriminatorValue;\nimport javax.pers"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLinkEntity.java",
"chars": 2975,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.Column;\nimport javax.persistence.Disc"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgLocEntity.java",
"chars": 3417,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.Column;\nimport javax.persistence.Disc"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgTextEntity.java",
"chars": 1079,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.Column;\nimport javax.persistence.Disc"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVideoEntity.java",
"chars": 2090,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.DiscriminatorValue;\nimport javax.pers"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/msg/WxMsgVoiceEntity.java",
"chars": 2082,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.msg;\n\nimport javax.persistence.DiscriminatorValue;\nimport javax.pers"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/qr/WxQrEntity.java",
"chars": 2680,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.qr;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimport"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespImageEntity.java",
"chars": 1601,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport javax.persistence.Entity;\nimport javax.persistence.Joi"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespMusicEntity.java",
"chars": 2177,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport javax.persistence.Entity;\nimport javax.persistence.Joi"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespPicDescEntity.java",
"chars": 1755,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport java.util.List;\n\nimport javax.persistence.Entity;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespTextEntity.java",
"chars": 1528,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport javax.persistence.Column;\nimport javax.persistence.Ent"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVideoEntity.java",
"chars": 1602,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport javax.persistence.Entity;\nimport javax.persistence.Joi"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/resp/WxRespVoiceEntity.java",
"chars": 1610,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.resp;\n\nimport javax.persistence.Entity;\nimport javax.persistence.Joi"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/user/WxGroupEntity.java",
"chars": 2480,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.user;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/entity/user/WxUserEntity.java",
"chars": 6399,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.entity.user;\n\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimpo"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthDao.java",
"chars": 398,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.auth;\n\nimport org.hamster.weixinmp.dao.entity.auth.WxAuth;\nimpor"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/auth/WxAuthReqDao.java",
"chars": 409,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.auth;\n\nimport org.hamster.weixinmp.dao.entity.auth.WxAuthReq;\nim"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemImageDao.java",
"chars": 428,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport org.hamster.weixinmp.dao.entity.item.WxItemImageEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemMusicDao.java",
"chars": 427,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport org.hamster.weixinmp.dao.entity.item.WxItemMusicEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemPicDescDao.java",
"chars": 553,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport java.util.List;\n\nimport org.hamster.weixinmp.dao.e"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemThumbDao.java",
"chars": 428,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport org.hamster.weixinmp.dao.entity.item.WxItemThumbEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVideoDao.java",
"chars": 428,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport org.hamster.weixinmp.dao.entity.item.WxItemVideoEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/item/WxItemVoiceDao.java",
"chars": 428,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.item;\n\nimport org.hamster.weixinmp.dao.entity.item.WxItemVoiceEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/menu/WxMenuBtnDao.java",
"chars": 419,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.menu;\n\nimport org.hamster.weixinmp.dao.entity.menu.WxMenuBtnEnti"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxBaseMsgDao.java",
"chars": 419,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntit"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgEventDao.java",
"chars": 422,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgEventEntit"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgImageDao.java",
"chars": 422,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgImageEntit"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLinkDao.java",
"chars": 419,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgLinkEntity"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgLocDao.java",
"chars": 416,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgLocEntity;"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgTextDao.java",
"chars": 419,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgTextEntity"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVideoDao.java",
"chars": 422,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgVideoEntit"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/msg/WxMsgVoiceDao.java",
"chars": 358,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.msg;\n\nimport org.hamster.weixinmp.dao.entity.msg.WxMsgVoiceEntit"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespImageDao.java",
"chars": 365,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespImageEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespMusicDao.java",
"chars": 365,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespMusicEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespPicDescDao.java",
"chars": 370,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespPicDesc"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespTextDao.java",
"chars": 362,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespTextEnt"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVideoDao.java",
"chars": 364,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespVideoEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/resp/WxRespVoiceDao.java",
"chars": 426,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.resp;\n\nimport org.hamster.weixinmp.dao.entity.resp.WxRespVoiceEn"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/user/WxGroupDao.java",
"chars": 417,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.user;\n\nimport org.hamster.weixinmp.dao.entity.user.WxGroupEntity"
},
{
"path": "src/main/java/org/hamster/weixinmp/dao/repository/user/WxUserDao.java",
"chars": 414,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.dao.repository.user;\n\nimport org.hamster.weixinmp.dao.entity.user.WxUserEntity;"
},
{
"path": "src/main/java/org/hamster/weixinmp/exception/WxException.java",
"chars": 908,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.exception;\n\nimport org.hamster.weixinmp.model.WxRespCode;\n\n/**\n * @author honey"
},
{
"path": "src/main/java/org/hamster/weixinmp/gson/WxMenuBtnSerializer.java",
"chars": 1674,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.gson;\n\nimport java.lang.reflect.Type;\n\nimport org.hamster.weixinmp.constant.WxM"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/WxAccessTokenJson.java",
"chars": 742,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Aug 4, 2013\n * \n */\np"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/WxRespCode.java",
"chars": 637,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Aug 4, 2013\n *\n */\npu"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/menu/WxMenuCreateJson.java",
"chars": 617,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.menu;\n\nimport java.util.List;\n\nimport org.hamster.weixinmp.dao.entity.men"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/menu/WxMenuGetJson.java",
"chars": 480,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.menu;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n *\n "
},
{
"path": "src/main/java/org/hamster/weixinmp/model/qr/WxQrActionInfoJson.java",
"chars": 491,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.qr;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n * \n *"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/qr/WxQrCreateJson.java",
"chars": 1039,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.qr;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n *\n */"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/qr/WxQrSceneJson.java",
"chars": 472,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.qr;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Jan 4, 2014\n *\n */"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendImageJson.java",
"chars": 924,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.SendItemImageJson;\n\n/*"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendItemPicDescJson.java",
"chars": 977,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.wrapper.WxSendItemArti"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendMusicJson.java",
"chars": 924,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.SendItemMusicJson;\n\n/*"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendTextJson.java",
"chars": 935,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.SendItemTextJson;\n\n/**"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendVideoJson.java",
"chars": 923,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.SendItemVoiceJson;\n\n/*"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/SendVoiceJson.java",
"chars": 923,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send;\n\nimport org.hamster.weixinmp.model.send.item.SendItemVideoJson;\n\n/*"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemArticleJson.java",
"chars": 1031,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemImageJson.java",
"chars": 489,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemMusicJson.java",
"chars": 1374,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemTextJson.java",
"chars": 456,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemVideoJson.java",
"chars": 883,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/SendItemVoiceJson.java",
"chars": 489,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item;\n\n\n/**\n * @author honey.zhao@aliyun.com\n * @version Dec 30, 201"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/send/item/wrapper/WxSendItemArticleWrapper.java",
"chars": 694,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.send.item.wrapper;\n\nimport java.util.List;\n\nimport org.hamster.weixinmp.m"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/user/WxOpenIdListJson.java",
"chars": 517,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.user;\n\nimport java.util.List;\n\n/**\n * @author honey.zhao@aliyun.com\n * @v"
},
{
"path": "src/main/java/org/hamster/weixinmp/model/user/WxUserGetJson.java",
"chars": 1123,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.model.user;\n\n\n/**\n * {\"total\":2,\"count\":2,\"data\":{\"openid\":[\"\",\"OPENID1\",\"OPENI"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxAuthService.java",
"chars": 2959,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgori"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxMediaService.java",
"chars": 5138,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport java.util.Date;\nimport java.util.Map;\n\nimport org.apache.http."
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxMenuService.java",
"chars": 2285,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxMessageService.java",
"chars": 4348,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxQrService.java",
"chars": 1688,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxStorageService.java",
"chars": 12761,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport java.util.Date;\nimport java.util.List;\n\nimport org.apache.log4"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxUserGroupService.java",
"chars": 6449,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/WxUserService.java",
"chars": 1535,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service;\n\nimport static org.hamster.weixinmp.util.WxUtil.getAccessTokenParams;\n"
},
{
"path": "src/main/java/org/hamster/weixinmp/service/handler/WxMessageHandlerIfc.java",
"chars": 516,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.service.handler;\n\nimport java.util.Map;\n\nimport org.hamster.weixinmp.constant.W"
},
{
"path": "src/main/java/org/hamster/weixinmp/util/WxUtil.java",
"chars": 3531,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.util;\n\nimport java.io.IOException;\nimport java.net.URISyntaxException;\nimport j"
},
{
"path": "src/main/resources/applicationContext-weixinmp.xml",
"chars": 1584,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<beans xmlns=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www"
},
{
"path": "src/main/resources/wx.properties",
"chars": 1703,
"preview": "#(optional)override jdbc url for local development\njdbc.driver=com.mysql.jdbc.Driver\njdbc.url=jdbc\\:mysql\\://localhost\\:"
},
{
"path": "src/main/webapp/META-INF/MANIFEST.MF",
"chars": 39,
"preview": "Manifest-Version: 1.0\r\nClass-Path: \r\n\r\n"
},
{
"path": "src/main/webapp/MyHtml.html",
"chars": 416,
"preview": "<!DOCTYPE html>\r\n<html>\r\n <head>\r\n <title>MyHtml.html</title>\r\n\t\r\n <meta name=\"keywords\" content=\"keyword1,keywor"
},
{
"path": "src/main/webapp/WEB-INF/classes/weixin/popular/example/pay_example.jsp.jsp",
"chars": 646,
"preview": "<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\" pageEncoding=\"UTF-8\"%>\r\n<!DOCTYPE html PUBLIC \"-//W3C//"
},
{
"path": "src/main/webapp/WEB-INF/web.xml",
"chars": 1672,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<web-app version=\"2.5\" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n\txmlns:xsi=\"http"
},
{
"path": "src/main/webapp/default/index.html",
"chars": 416,
"preview": "<!DOCTYPE html>\r\n<html>\r\n <head>\r\n <title>MyHtml.html</title>\r\n\t\r\n <meta name=\"keywords\" content=\"keyword1,keywor"
},
{
"path": "src/main/webapp/index.jsp",
"chars": 52,
"preview": "<html>\n<body>\n<h2>Hello World!</h2>\n</body>\n</html>\n"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/base/AbstractServiceTest.java",
"chars": 462,
"preview": "package org.hamster.weixinmp.test.base;\n\nimport org.springframework.test.context.ContextConfiguration;\nimport org.spring"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/base/AbstractWxServiceTest.java",
"chars": 1717,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.base;\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io."
},
{
"path": "src/test/java/org/hamster/weixinmp/test/controller/WxControllerManualTest.java",
"chars": 2108,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.controller;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimpor"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxGroupServceTest.java",
"chars": 1214,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport java.util.List;\n\nimport org.hamster.weixinmp.dao.entity.u"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxMediaServiceTest.java",
"chars": 1275,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimpor"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxMenuServiceTest.java",
"chars": 1733,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport org.hamster.weixinmp.exception.WxException;\nimport org.ha"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxQrServiceTest.java",
"chars": 751,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport org.hamster.weixinmp.exception.WxException;\nimport org.ha"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxServiceTest.java",
"chars": 1789,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport org.hamster.weixinmp.dao.repository.msg.WxBaseMsgDao;\nimp"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/service/WxUserServiceTest.java",
"chars": 778,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.service;\n\nimport org.hamster.weixinmp.exception.WxException;\nimport org.ha"
},
{
"path": "src/test/java/org/hamster/weixinmp/test/xml/WxXMLUtilTest.java",
"chars": 4643,
"preview": "/**\n * \n */\npackage org.hamster.weixinmp.test.xml;\n\nimport org.dom4j.DocumentException;\nimport org.hamster.weixinmp.cont"
},
{
"path": "src/test/resources/.gitignore",
"chars": 5,
"preview": "/tmp\n"
},
{
"path": "src/test/resources/application.development.properties",
"chars": 1624,
"preview": "#(optional)override jdbc url for local development\njdbc.driver=com.mysql.jdbc.Driver\njdbc.url=\njdbc.username=\njdbc.passw"
},
{
"path": "src/test/resources/applicationContext-test-weixinmp.xml",
"chars": 3468,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\r\n\txmlns:xsi=\"http://w"
},
{
"path": "src/test/resources/log4j.properties",
"chars": 1110,
"preview": "# Output pattern : date [thread] priority category - message\r\nlog4j.rootLogger=INFO, Console, RollingFile\r\n\r\n#Console\r\nl"
},
{
"path": "src/test/resources/sql/import-data.sql",
"chars": 0,
"preview": ""
}
]
About this extraction
This page contains the full source code of the honeyzhaoAliyun/WeixinMultiPlatform GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 130 files (228.4 KB), approximately 68.0k tokens, and a symbol index with 805 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.