Showing preview only (463K chars total). Download the full file or copy to clipboard to get everything.
Repository: belerweb/social-sdk
Branch: master
Commit: 797b15bd70f0
Files: 114
Total size: 384.3 KB
Directory structure:
gitextract_ctatj41d/
├── .gitignore
├── README.md
├── eclipse-java-google-style.xml
├── pom.xml
└── src/
├── main/
│ └── java/
│ └── com/
│ └── belerweb/
│ └── social/
│ ├── API.java
│ ├── SDK.java
│ ├── bean/
│ │ ├── Error.java
│ │ ├── Gender.java
│ │ ├── JsonBean.java
│ │ ├── OnlineStatus.java
│ │ └── Result.java
│ ├── captcha/
│ │ ├── api/
│ │ │ └── Yundama.java
│ │ └── bean/
│ │ └── YundamaType.java
│ ├── exception/
│ │ └── SocialException.java
│ ├── http/
│ │ ├── Http.java
│ │ └── HttpException.java
│ ├── mail/
│ │ └── api/
│ │ └── POP3.java
│ ├── qq/
│ │ ├── connect/
│ │ │ ├── api/
│ │ │ │ ├── OAuth2.java
│ │ │ │ ├── QQConnect.java
│ │ │ │ ├── QZone.java
│ │ │ │ ├── User.java
│ │ │ │ └── Weibo.java
│ │ │ └── bean/
│ │ │ ├── AccessToken.java
│ │ │ ├── Album.java
│ │ │ ├── AlbumPrivilege.java
│ │ │ ├── Company.java
│ │ │ ├── Display.java
│ │ │ ├── Education.java
│ │ │ ├── FanList.java
│ │ │ ├── Gut.java
│ │ │ ├── IdolList.java
│ │ │ ├── Image.java
│ │ │ ├── Music.java
│ │ │ ├── NewT.java
│ │ │ ├── OpenID.java
│ │ │ ├── Photo.java
│ │ │ ├── PicUploadResult.java
│ │ │ ├── RepostList.java
│ │ │ ├── Scope.java
│ │ │ ├── SendPrivate.java
│ │ │ ├── Tag.java
│ │ │ ├── TenpayAddress.java
│ │ │ ├── TweetInfo.java
│ │ │ ├── User.java
│ │ │ ├── Video.java
│ │ │ └── WeiboUser.java
│ │ ├── mail/
│ │ │ ├── api/
│ │ │ │ └── Contact.java
│ │ │ └── bean/
│ │ │ ├── Address.java
│ │ │ ├── Email.java
│ │ │ ├── Group.java
│ │ │ ├── Org.java
│ │ │ ├── Tel.java
│ │ │ ├── User.java
│ │ │ └── ValidationCode.java
│ │ ├── qzone/
│ │ │ └── api/
│ │ │ └── Visitor.java
│ │ └── t/
│ │ └── api/
│ │ ├── OAuth2.java
│ │ └── QQT.java
│ ├── weibo/
│ │ ├── api/
│ │ │ ├── OAuth2.java
│ │ │ ├── User.java
│ │ │ └── Weibo.java
│ │ └── bean/
│ │ ├── AccessToken.java
│ │ ├── Comment.java
│ │ ├── Display.java
│ │ ├── Geo.java
│ │ ├── Privacy.java
│ │ ├── Remind.java
│ │ ├── Scope.java
│ │ ├── Status.java
│ │ ├── TokenInfo.java
│ │ ├── UrlShort.java
│ │ ├── User.java
│ │ ├── UserCounts.java
│ │ └── Visible.java
│ └── weixin/
│ ├── api/
│ │ ├── Group.java
│ │ ├── Media.java
│ │ ├── Menu.java
│ │ ├── OAuth2.java
│ │ ├── User.java
│ │ └── Weixin.java
│ └── bean/
│ ├── AccessToken.java
│ ├── ApiTicket.java
│ ├── Article.java
│ ├── EventType.java
│ ├── GetFollowersResult.java
│ ├── Group.java
│ ├── JSApiTicket.java
│ ├── Media.java
│ ├── MediaType.java
│ ├── Menu.java
│ ├── MenuType.java
│ ├── Message.java
│ ├── MsgType.java
│ ├── QRCreation.java
│ ├── QRTicket.java
│ ├── QRType.java
│ ├── Scope.java
│ ├── User.java
│ ├── Variable.java
│ └── VoiceType.java
└── test/
├── java/
│ └── com/
│ └── belerweb/
│ └── social/
│ ├── SDKTest.java
│ ├── TestConfig.java
│ ├── captcha/
│ │ └── api/
│ │ └── YundamaTest.java
│ ├── mail/
│ │ └── api/
│ │ └── POP3Test.java
│ ├── qq/
│ │ └── connect/
│ │ └── api/
│ │ ├── OAuth2Test.java
│ │ └── UserTest.java
│ ├── weibo/
│ │ └── api/
│ │ ├── OAuth2Test.java
│ │ └── UserTest.java
│ └── weixin/
│ └── api/
│ ├── GroupTest.java
│ ├── MediaTest.java
│ ├── MenuTest.java
│ ├── OAuth2Test.java
│ ├── UserTest.java
│ └── WeixinTest.java
└── resources/
└── logback.xml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Eclipse
.externalToolBuilders/
.settings/
bin/
tmp/
.metadata
.gradle
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
.project
.classpath
# IntelliJ IDES
.idea/
out/
.idea_modules/
*.iml
*.ipr
*.ids
*.iws
# OSX
# Icon must end with two \r
Icon
._*
.DS_Store
.AppleDouble
.LSOverride
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows
$RECYCLE.BIN/
Thumbs.db
ehthumbs.db
Desktop.ini
*.lnk
# Linux
*~
.directory
.Trash-*
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# frontend-maven-plugin
node
bower_components
node_modules
etc
================================================
FILE: README.md
================================================
social-sdk
==========
social-sdk是一个集成[新浪微博开放平台][1]、[QQ互联][2]、[腾讯微博开发平台][3]、[微信公众平台][4]等社交平台的接口的Java库。
其实在开始这个项目之前,各个平台都已经提供相应的Java
SDK,有官方的、也有非官方的开源项目,如如新浪微博开放平台有[weibo4j][5]。我也一直在使用这些项目。但是在使用过程中越到的问题越来越多,越来越麻烦,如:
- 这些SDK都是提供一个ZIP包,不适合Maven或Ivy管理的项目。
- 各个SDK都引入了开源公共类库,确改了包名,造成类库过多、混乱。
- SDK更新超级慢,跟不上平台上接口的变更。
- 没有交流环境,遇到BUG找不到资料,找不到沟通的地方,需要自己去琢磨源代码。
- ......
因此,自己开发一个,尝试尽可能多的集成社交平台。
**因为我并没有在项目中使用到那么多社交平台,所以有的社交平台没有可供测试的应用信息(通常叫做AppKey和AppSecret)。所以非常希望有资源的朋友共享测试帐号。**
已实现
---
- QQ相关
- 通过QQ邮箱获取联系人,支持验证码自动登录
- 获取QZone访客记录,支持验证码自动登录
- 新浪微博
- 新浪微博登录
- 获取新浪微博用户信息
- QQ帐号/QQ互联
- 支持http://wiki.connect.qq.com 列出的API
- 腾讯微博(未测试)
- 腾讯微博登录(未测试)
- 获取腾讯微博用户信息(未测试)
- [微信帐号](../../wiki/微信API)
- [获取access_token](../../wiki/微信API#获取access token)
- [获取jsapi_ticket](../../wiki/微信API#获取jsapi_ticket)
- jsapi签名
- 上传下载多媒体文件
- 接受消息/事件推送/位置信息
- 验证消息真实性
- 发送被动响应信息
- 发送客服消息
- 发送模板消息
- 分组管理
- 获取用户基本信息
- 获取关注者列表
- 网页授权获取用户基本信息
- 自定义菜单
- 生成带参数的二维码接口
计划开发
----
- 更多的接口
- 支持更多的平台
下载
--
推荐使用Maven下载。social-sdk已发布到Maven中央库。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>social-sdk</artifactId>
<version>0.0.5</version>
</dependency>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
参与
--
交流:GitHub上留言或加入QQ群(328171904)
共享代码:Fork项目并提交Pull Requests
提交BUG:直接在GitHub上提交
其他:欢迎任何形式的贡献,文档、经验、意见...
链接
--
[1]: <http://open.weibo.com/>
[2]: <http://connect.qq.com/>
[3]: <http://dev.t.qq.com/>
[4]: <http://mp.weixin.qq.com/wiki/index.php>
[5]: <http://code.google.com/p/weibo4j/>
[6]: <https://github.com/belerweb/weibo4j>
[7]: <https://github.com/belerweb/qq-connect>
[8]: <https://github.com/belerweb/weixin-mp-sdk>
================================================
FILE: eclipse-java-google-style.xml
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="11">
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="11">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_comment_inline_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="16|-1|24"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16|5|80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.sort_type_annotations" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type_declaration" value="569|-1|569"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.sort_parameter_annotations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16|3|49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="100"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments" value="16|-1|16"/>
<setting id="org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.sort_package_annotations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_member" value="536|1|569"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16|4|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.force_if_else_statement_brace" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="3"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.sort_member_annotations" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16|4|48"/>
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class" value="33"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32|4|80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="32|4|81"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16|4|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16|-1|16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16|5|48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.sort_local_variable_annotations" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="569|-1|569"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package_declaration" value="569|-1|569"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_for_statement" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
</profile>
</profiles>
================================================
FILE: pom.xml
================================================
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>com.belerweb</groupId>
<artifactId>social-sdk</artifactId>
<version>0.0.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>social-sdk</name>
<description>All in one sdk, include weibo, qq connect, t.qq.com ...</description>
<url>https://github.com/belerweb/social-sdk</url>
<licenses>
<license>
<name>BSD</name>
<url>http://opensource.org/licenses/bsd-license.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/belerweb/social-sdk.git</connection>
<developerConnection>scm:git:https://github.com/belerweb/social-sdk.git</developerConnection>
<url>https://github.com/belerweb/social-sdk.git</url>
</scm>
<issueManagement>
<system>Github Issue</system>
<url>https://github.com/belerweb/social-sdk/issues</url>
</issueManagement>
<developers>
<developer>
<id>belerweb</id>
<name>Tangjun He</name>
<email>belerweb@gmail.com</email>
<url>https://github.com/belerweb</url>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<dependency.commons-lang.version>2.6</dependency.commons-lang.version>
</properties>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20131018</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<version>0.4</version>
<configuration>
<compilerCompliance>${maven.compiler.source}</compilerCompliance>
<compilerSource>${maven.compiler.source}</compilerSource>
<compilerTargetPlatform>${maven.compiler.source}</compilerTargetPlatform>
<configFile>${project.basedir}/eclipse-java-google-style.xml</configFile>
<lineEnding>LF</lineEnding>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<versionRange>[0.4]</versionRange>
<goals>
<goal>format</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>enforce</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
================================================
FILE: src/main/java/com/belerweb/social/API.java
================================================
package com.belerweb.social;
import com.belerweb.social.qq.connect.api.QQConnect;
import com.belerweb.social.qq.t.api.QQT;
import com.belerweb.social.weibo.api.Weibo;
import com.belerweb.social.weixin.api.Weixin;
public abstract class API {
protected Weibo weibo;
protected Weixin weixin;
protected QQConnect connect;
protected QQT t;
protected API(Weibo weibo) {
this.weibo = weibo;
}
protected API(Weixin weixin) {
this.weixin = weixin;
}
protected API(QQConnect connect) {
this.connect = connect;
}
protected API(QQT t) {
this.t = t;
}
}
================================================
FILE: src/main/java/com/belerweb/social/SDK.java
================================================
package com.belerweb.social;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import com.belerweb.social.bean.Error;
import com.belerweb.social.bean.Result;
import com.belerweb.social.exception.SocialException;
import com.belerweb.social.http.Http;
import com.belerweb.social.http.HttpException;
public abstract class SDK {
private final Charset defaultCharset;
public SDK() {
this(null);
}
public SDK(Charset defaultCharset) {
this.defaultCharset = defaultCharset;
}
public String get(String url, List<NameValuePair> params) {
try {
Http.setDefaultCharset(defaultCharset);
return Http.get(url, params);
} catch (HttpException e) {
throw new SocialException(e);
}
}
public String get(String url) {
return get(url, null);
}
public String post(String url, HttpEntity postBody) {
try {
Http.setDefaultCharset(defaultCharset);
return Http.post(url, postBody);
} catch (HttpException e) {
throw new SocialException(e);
}
}
public String post(String url, List<NameValuePair> params) {
try {
Http.setDefaultCharset(defaultCharset);
return Http.post(url, params, "UTF-8");
} catch (HttpException e) {
throw new SocialException(e);
}
}
public String post(String url) {
return post(url, (HttpEntity) null);
}
public void addParameter(List<NameValuePair> params, String name, Object value) {
if (value == null) {
throw new SocialException("Parameter " + name + " must not be null.");
}
params.add(new BasicNameValuePair(name, value.toString()));
}
public void addNotNullParameter(List<NameValuePair> params, String name, Object value) {
if (value != null) {
params.add(new BasicNameValuePair(name, value.toString()));
}
}
public void addTrueParameter(List<NameValuePair> params, String name, Boolean value) {
if (Boolean.TRUE.equals(value)) {
params.add(new BasicNameValuePair(name, value.toString()));
}
}
/**
* 经纬度转换为地址
*
* @param lon 经度
* @param lat 纬度
*/
public Result<String> lonLatToAddress(Double lon, Double lat) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "sensor", "false");
addParameter(params, "language", "zh");
addParameter(params, "latlng", lat + "," + lon);
String json = get("https://maps.googleapis.com/maps/api/geocode/json", params);
JSONObject jsonObject = new JSONObject(json);
if (!"OK".equals(jsonObject.getString("status"))) {
Error error = new Error();
error.setErrorCode(jsonObject.getString("status"));
error.setError(jsonObject.optString("error_message"));
return new Result<String>(error);
}
JSONArray results = jsonObject.getJSONArray("results");
if (results.length() == 0) {
return new Result<String>(StringUtils.EMPTY);
}
return new Result<String>(results.getJSONObject(0).getString("formatted_address"));
}
}
================================================
FILE: src/main/java/com/belerweb/social/bean/Error.java
================================================
package com.belerweb.social.bean;
import org.json.JSONObject;
public final class Error extends JsonBean {
private String request;
private String errorCode;
private String error;
public Error() {}
public Error(String code, String message) {
this.errorCode = code;
this.error = message;
}
private Error(JSONObject jsonObject) {
super(jsonObject);
}
public String getRequest() {
return request;
}
public void setRequest(String request) {
this.request = request;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
@Override
public String toString() {
return errorCode + ":" + error + "(" + request + ")";
}
public static Error parse(JSONObject jsonObject) {
String errorCode = jsonObject.optString("error_code", null);
if (errorCode != null) {// 微博
String request = jsonObject.optString("request", null);
String error = jsonObject.optString("error", null);
Error er = new Error(jsonObject);
er.setRequest(request);
er.setErrorCode(errorCode);
er.setError(error);
return er;
}
errorCode = jsonObject.optString("error", null);
if (errorCode != null) {// QQ互联
String error = jsonObject.optString("error_description", null);
Error er = new Error(jsonObject);
er.setErrorCode(errorCode);
er.setError(error);
return er;
}
Integer ret = Result.parseInteger(jsonObject.opt("ret"));
if (ret != null && ret != 0) {// QQ互联
String msg = jsonObject.optString("msg", null);
Error er = new Error(jsonObject);
er.setErrorCode(ret.toString());
er.setError(msg);
return er;
}
ret = Result.parseInteger(jsonObject.opt("errcode"));
if (ret != null && ret != 0) {// 微信
String error = jsonObject.optString("errmsg", null);
Error er = new Error(jsonObject);
er.setErrorCode(ret.toString());
er.setError(error);
return er;
}
return null;
}
}
================================================
FILE: src/main/java/com/belerweb/social/bean/Gender.java
================================================
package com.belerweb.social.bean;
public enum Gender {
MALE(1, "m", "男", "Male"), FEMALE(0, "f", "女", "Female"), UNKNOWN(-1, "n", "未知", "Unknown");
int intValue;
String code;
String zhValue;
String enValue;
private Gender(int intValue, String code, String zhValue, String enValue) {
this.intValue = intValue;
this.code = code;
this.zhValue = zhValue;
this.enValue = zhValue;
}
public int value() {
return intValue;
}
public String code() {
return code;
}
public String text() {
return zhValue;
}
public String enText() {
return enValue;
}
@Override
public String toString() {
return zhValue;
}
public static Gender parse(Integer val) {
if (val == null) {
return null;
}
if (new Integer(1).equals(val)) {
return MALE;
}
if (new Integer(0).equals(val) || new Integer(2).equals(val)) {
// FIXME 微信2代表女性,0表示未知。暂且把微信的未知看作女性,如同新浪微博用户没有设置性别的时候会返回男性一样
return FEMALE;
}
return UNKNOWN;
}
public static Gender parse(String val) {
if (val == null) {
return null;
}
if ("男".equals(val) || "m".equalsIgnoreCase(val) || "male".equalsIgnoreCase(val)
|| "b".equalsIgnoreCase(val) || "boy".equalsIgnoreCase(val)) {
return MALE;
}
if ("女".equals(val) || "f".equalsIgnoreCase(val) || "female".equalsIgnoreCase(val)
|| "g".equalsIgnoreCase(val) || "girl".equalsIgnoreCase(val)) {
return FEMALE;
}
return UNKNOWN;
}
}
================================================
FILE: src/main/java/com/belerweb/social/bean/JsonBean.java
================================================
package com.belerweb.social.bean;
import org.json.JSONObject;
public abstract class JsonBean {
private JSONObject jsonObject;
protected JsonBean() {}
protected JsonBean(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public JSONObject getJsonObject() {
return jsonObject;
}
}
================================================
FILE: src/main/java/com/belerweb/social/bean/OnlineStatus.java
================================================
package com.belerweb.social.bean;
public enum OnlineStatus {
ONLINE(1, "在线", "online"), OFFLINE(0, "不在线", "offline");
private int status;
private String text;
private String enText;
private OnlineStatus(int status, String text, String enText) {
this.status = status;
this.text = text;
this.enText = enText;
}
public boolean online() {
return status == 1;
}
public int status() {
return status;
}
public String text() {
return text;
}
public String enText() {
return enText;
}
@Override
public String toString() {
return super.toString();
}
public static OnlineStatus parse(Integer val) {
if (val == null) {
return null;
}
if (new Integer(1).equals(val)) {
return ONLINE;
}
return OFFLINE;
}
public static OnlineStatus parse(String val) {
if (val == null) {
return null;
}
if ("在线".equals(val) || "online".equalsIgnoreCase(val)) {
return ONLINE;
}
return OFFLINE;
}
}
================================================
FILE: src/main/java/com/belerweb/social/bean/Result.java
================================================
package com.belerweb.social.bean;
import java.lang.reflect.Method;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONObject;
import com.belerweb.social.exception.SocialException;
public class Result<T> {
private Error error;
private T result;
private List<T> results;
public Result(Error error) {
this.error = error;
}
public Result(T result) {
this.result = result;
}
public Result(List<T> results) {
this.results = results;
}
public boolean success() {
return error == null;
}
public Error getError() {
return error;
}
public T getResult() {
return result;
}
public List<T> getResults() {
return results;
}
public static <T> Result<T> parse(String json, Class<T> resultType) {
try {
if (json.matches("^\\s*\\[.*$")) {
return new Result<T>(parse(new JSONArray(json), resultType));
} else {
return parse(new JSONObject(json), resultType);
}
} catch (Exception e) {
throw new SocialException(e);
}
}
@SuppressWarnings("unchecked")
public static <T> Result<T> parse(JSONObject jsonObject, Class<T> resultType) {
try {
Error error = Error.parse(jsonObject);
if (error == null) {
Method parse = resultType.getMethod("parse", JSONObject.class);
T obj = (T) parse.invoke(null, jsonObject);
return new Result<T>(obj);
}
return new Result<T>(error);
} catch (Exception e) {
throw new SocialException(e);
}
}
@SuppressWarnings("unchecked")
public static <T> List<T> parse(JSONArray jsonArray, Class<T> resultType) {
List<T> list = new ArrayList<T>();
if (jsonArray == null) {
return list;
}
try {
for (int i = 0; i < jsonArray.length(); i++) {
if (resultType.isAssignableFrom(String.class)) {
list.add((T) toString(jsonArray.get(i)));
} else if (resultType.isAssignableFrom(Integer.class)) {
list.add((T) parseInteger(jsonArray.get(i)));
} else if (resultType.isAssignableFrom(Long.class)) {
list.add((T) parseLong(jsonArray.get(i)));
} else if (resultType.isAssignableFrom(Double.class)) {
list.add((T) parseDouble(jsonArray.get(i)));
} else {
Method parse = resultType.getMethod("parse", JSONObject.class);
list.add((T) parse.invoke(null, jsonArray.getJSONObject(i)));
}
}
return list;
} catch (Exception e) {
throw new SocialException(e);
}
}
public static String toString(Object obj) {
if (obj == null) {
return null;
}
return obj.toString();
}
public static Long parseLong(Object obj) {
if (obj == null) {
return null;
}
Long result = null;
if (obj instanceof Number) {
result = ((Number) obj).longValue();
} else if (obj instanceof String) {
result = Long.valueOf((String) obj);
}
return result;
}
public static Integer parseInteger(Object obj) {
if (obj == null) {
return null;
}
Integer result = null;
if (obj instanceof Number) {
result = ((Number) obj).intValue();
} else if (obj instanceof String) {
result = Integer.valueOf((String) obj);
}
return result;
}
public static Double parseDouble(Object obj) {
if (obj == null) {
return null;
}
Double result = null;
if (obj instanceof Number) {
result = ((Number) obj).doubleValue();
} else if (obj instanceof String) {
result = Double.valueOf((String) obj);
}
return result;
}
public static Boolean parseBoolean(Object obj) {
if (obj == null) {
return null;
}
Boolean result = null;
if (obj instanceof Boolean) {
result = (Boolean) obj;
} else if (obj instanceof Integer) {
result = ((Integer) obj).intValue() == 1;
} else if (obj instanceof String) {
result = Boolean.valueOf(obj.toString());
}
return result;
}
public static Date parseDate(Object obj, String pattern, Locale locale) {
if (obj == null) {
return null;
}
Date result = null;
if (obj instanceof Date) {
result = new Date(((Date) obj).getTime());
} else if (obj instanceof String) {
try {
SimpleDateFormat format = new SimpleDateFormat(pattern, locale);
result = format.parse((String) obj);
} catch (ParseException e) {
throw new SocialException(e);
}
}
return result;
}
public static Date parseTimeSeconds(Object obj) {
Integer seconds = Result.parseInteger(obj);
if (seconds == null || seconds == 0) {
return null;
}
return new Date(seconds * 1000);
}
}
================================================
FILE: src/main/java/com/belerweb/social/captcha/api/Yundama.java
================================================
package com.belerweb.social.captcha.api;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.json.JSONObject;
import com.belerweb.social.bean.Error;
import com.belerweb.social.bean.Result;
import com.belerweb.social.captcha.bean.YundamaType;
import com.belerweb.social.exception.SocialException;
import com.belerweb.social.http.Http;
import com.belerweb.social.http.HttpException;
public class Yundama {
private String appId = "85";
private String appKey = "19fcd07d8de9c03b8cebec5d8bfe7d8e";
private String username;
private String password;
public Yundama(String username, String password) {
this.username = username;
this.password = password;
}
public Result<String> decode(byte[] img, YundamaType type) {
HttpPost request = new HttpPost("http://api.yundama.com/api.php?method=upload");
MultipartEntityBuilder builder =
MultipartEntityBuilder.create()
.addBinaryBody("file", img, ContentType.create("image/png"), "code.png")
.addTextBody("username", username).addTextBody("password", password)
.addTextBody("codetype", type.getType().toString()).addTextBody("appid", appId)
.addTextBody("appkey", appKey).addTextBody("timeout", "60");
request.setEntity(builder.build());
try {
HttpResponse response = Http.CLIENT.execute(request);
String json = IOUtils.toString(response.getEntity().getContent());
request.releaseConnection();
JSONObject jsonObject = new JSONObject(json);
Integer ret = Result.parseInteger(jsonObject.get("ret"));
if (ret == 0) {
String url =
"http://api.yundama.com/api.php?method=result&cid="
+ Result.toString(jsonObject.get("cid"));
long start = System.currentTimeMillis();
while (true) {
jsonObject = new JSONObject(Http.get(url));
if (Result.parseInteger(jsonObject.get("ret")) == 0) {
return new Result<String>(Result.toString(jsonObject.get("text")));
}
if (System.currentTimeMillis() - start > 10000) {
return new Result<String>(new Error("TIMEOUT", "验证码识别超时。"));
}
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Error error = new Error();
error.setErrorCode(ret.toString());
return new Result<String>(error);
} catch (ClientProtocolException e) {
throw new SocialException(e);
} catch (HttpException e) {
throw new SocialException(e);
} catch (IOException e) {
throw new SocialException(e);
}
}
}
================================================
FILE: src/main/java/com/belerweb/social/captcha/bean/YundamaType.java
================================================
package com.belerweb.social.captcha.bean;
public enum YundamaType {
/**
* 不定长英文数字 2.5题分一个字符(按文本长度收费)
*/
ALPHANUMERIC(1000),
/**
* 1位英文数字 7题分
*/
ALPHANUMERIC1(1001),
/**
* 2位英文数字 8题分
*/
ALPHANUMERIC2(1002),
/**
* 3位英文数字 9题分
*/
ALPHANUMERIC3(1003),
/**
* 4位英文数字 10题分
*/
ALPHANUMERIC4(1004),
/**
* 5位英文数字 12题分
*/
ALPHANUMERIC5(1005),
/**
* 6位英文数字 15题分
*/
ALPHANUMERIC6(1006),
/**
* 7位英文数字 17题分
*/
ALPHANUMERIC7(1007),
/**
* 8位英文数字 20题分
*/
ALPHANUMERIC8(1008),
/**
* 9位英文数字 22题分
*/
ALPHANUMERIC9(1009),
/**
* 10位英文数字 25题分
*/
ALPHANUMERIC10(1010),
/**
* 11位英文数字 27题分
*/
ALPHANUMERIC11(1011),
/**
* 12位英文数字 30题分
*/
ALPHANUMERIC12(1012),
/**
* 13位英文数字 32题分
*/
ALPHANUMERIC13(1013),
/**
* 14位英文数字 35题分
*/
ALPHANUMERIC14(1014),
/**
* 15位英文数字 37题分
*/
ALPHANUMERIC15(1015),
/**
* 16位英文数字 40题分
*/
ALPHANUMERIC16(1016),
/**
* 17位英文数字 42题分
*/
ALPHANUMERIC17(1017),
/**
* 18位英文数字 45题分
*/
ALPHANUMERIC18(1018),
/**
* 19位英文数字 47题分
*/
ALPHANUMERIC19(1019),
/**
* 20位英文数字 50题分
*/
ALPHANUMERIC20(1020),
/**
* 2位纯汉字 20题分
*/
CHINESE2(2002),
/**
* 4位纯汉字 40题分
*/
CHINESE4(2004),
/**
* 4位纯英文 10题分
*/
ALPHABETIC4(3004),
/**
* 5位纯英文 12题分
*/
ALPHABETIC5(3005),
/**
* 6位纯英文 15题分
*/
ALPHABETIC6(3006),
/**
* 4位纯数字 10题分
*/
NUMERIC4(4004),
/**
* 5位纯数字 12题分
*/
NUMERIC5(4005);
Integer type;
YundamaType(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
}
================================================
FILE: src/main/java/com/belerweb/social/exception/SocialException.java
================================================
package com.belerweb.social.exception;
public class SocialException extends RuntimeException {
private static final long serialVersionUID = 3536584215181288508L;
public SocialException(Exception exception) {
super(exception);
}
public SocialException(String message) {
super(message);
}
}
================================================
FILE: src/main/java/com/belerweb/social/http/Http.java
================================================
package com.belerweb.social.http;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.SSLContext;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.HttpClientBuilder;
public final class Http {
private static final String[] AGENTS =
new String[] {
"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; .NET CLR 3.5.21022; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 2.0.50727; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; GTB0.0; InfoPath.1; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 4.0.20506; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; InfoPath.1; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; GreenBrowser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; GreenBrowser)",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.62 Safari/537.36"};
public static final HttpClient CLIENT = newClient();
private static final ThreadLocal<Charset> defaultCharset = new ThreadLocal<Charset>();
private static Charset getDefaultCharset() {
return defaultCharset.get();
}
/**
* Sets the default charset for reading the response, which is used while the server side does not
* provided the encoding or charset. If {@code null} is set, the {@link Charset#defaultCharset()}
* will be used to read the response. Note, this is a {@link ThreadLocal} variable.
*
* @param charset the charset.
* @see #responseToString(HttpResponse)
*/
public static void setDefaultCharset(Charset charset) {
defaultCharset.set(charset);
}
public static String get(String uri, List<NameValuePair> params) throws HttpException {
String url = uri;
if (params != null) {
String param = StringUtils.join(params, "&");
if (url.contains("?")) {
url = url + "&" + param;
} else {
url = url + "?" + param;
}
}
return get(url);
}
public static String get(String uri, Header... headers) throws HttpException {
HttpGet request = new HttpGet(uri);
if (headers != null) {
for (Header header : headers) {
request.addHeader(header);
}
}
return execute(request);
}
public static String post(String uri, HttpEntity postBody, Header... headers)
throws HttpException {
HttpPost request = new HttpPost(uri);
if (postBody != null) {
request.setEntity(postBody);
}
if (headers != null) {
for (Header header : headers) {
request.addHeader(header);
}
}
return execute(request);
}
public static String post(String uri, List<NameValuePair> params, String charset,
Header... headers) throws HttpException {
HttpPost request = new HttpPost(uri);
if (params != null) {
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.addAll(params);
try {
HttpEntity entity = new UrlEncodedFormEntity(parameters, charset);
request.setEntity(entity);
} catch (UnsupportedEncodingException e) {
throw new HttpException(e);
}
}
if (headers != null) {
for (Header header : headers) {
request.addHeader(header);
}
}
return execute(request);
}
public static String post(String uri) throws HttpException {
return post(uri, (HttpEntity) null);
}
private static String execute(HttpRequestBase request) throws HttpException {
try {
HttpResponse response = CLIENT.execute(request);
// StatusLine status = response.getStatusLine();
return responseToString(response);
// if (status.getStatusCode() != HttpStatus.SC_OK) {
// throw new HttpException(status.getStatusCode() + ":" + status.getReasonPhrase() + "\r\n"
// + result);
// }
} catch (ClientProtocolException e) {
throw new HttpException(e);
} catch (IOException e) {
throw new HttpException(e);
} finally {
request.releaseConnection();
}
}
public static boolean isRequestSuccess(HttpResponse response) throws HttpException {
return response.getStatusLine() != null
&& response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
}
public static String responseToString(HttpResponse response) throws HttpException {
HttpEntity entity = response.getEntity();
String result = null;
if (entity != null) {
Charset charset = null;
Header encoding = entity.getContentEncoding();
if (encoding == null) {
ContentType contentType = ContentType.get(entity);
if (contentType != null) {
charset = contentType.getCharset();
}
} else {
charset = Charset.forName(encoding.getValue());
}
if (charset == null) {
charset = getDefaultCharset();
}
try {
result = IOUtils.toString(entity.getContent(), charset);
} catch (Exception e) {
throw new HttpException(e);
}
return result;
} else {
throw new HttpException("No response entity.");
}
}
public static String randomAgent() {
return AGENTS[RandomUtils.nextInt(AGENTS.length)];
}
public static HttpClient newClient() {
SSLContext sslContext = SSLContexts.createDefault();
try {
sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
public boolean isTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
return true;
}
}).build();
} catch (Exception e) {
e.printStackTrace();
}
return HttpClientBuilder
.create()
.setSslcontext(sslContext)
.setMaxConnPerRoute(50)
.setMaxConnTotal(200)
.setUserAgent(Http.randomAgent())
.setDefaultRequestConfig(
RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000)
.setConnectionRequestTimeout(30000).build()).build();
}
}
================================================
FILE: src/main/java/com/belerweb/social/http/HttpException.java
================================================
package com.belerweb.social.http;
public class HttpException extends Exception {
private static final long serialVersionUID = -7528165403129614352L;
public HttpException(Exception exception) {
super(exception);
}
public HttpException(String message) {
super(message);
}
}
================================================
FILE: src/main/java/com/belerweb/social/mail/api/POP3.java
================================================
package com.belerweb.social.mail.api;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Reader;
import java.net.SocketException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.net.pop3.POP3Client;
import org.apache.commons.net.pop3.POP3MessageInfo;
import org.apache.commons.net.pop3.POP3SClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.belerweb.social.exception.SocialException;
/**
* POP3 邮件工具
*/
public class POP3 {
private static final Logger LOGGER = LoggerFactory.getLogger(POP3.class);
private String username;
private String password;
private String host;
private int port;
private POP3Client client;
public POP3(String username, String password, String host) {
this(username, password, host, org.apache.commons.net.pop3.POP3.DEFAULT_PORT, false);
}
public POP3(String username, String password, String host, int port, boolean ssl) {
this.username = username;
this.password = password;
this.host = host;
this.port = port;
if (ssl) {
this.client = new POP3SClient("SSL", true);
} else {
this.client = new POP3Client();
}
this.client.setDefaultTimeout(300000);
}
private boolean login() throws SocketException, IOException {
client.connect(host, port);
return client.login(username, password);
}
/**
* 检查用户信息是否正确
*/
public boolean test() throws SocialException {
try {
return login();
} catch (SocketException e) {
e.printStackTrace();
throw new SocialException(e);
} catch (IOException e) {
e.printStackTrace();
throw new SocialException(e);
} finally {
try {
this.client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 下载所有电子邮件到指定目录
*/
public void download(File dir) throws SocialException {
if (!dir.isDirectory() || !dir.canWrite()) {
throw new SocialException("The specified directory is unavailable.");
}
try {
if (login()) {
POP3MessageInfo[] messages = client.listUniqueIdentifiers();
if (messages == null) {
LOGGER.debug("Could not retrieve message list.");
throw new SocialException("Could not retrieve message list.");
} else {
for (POP3MessageInfo message : messages) {
File eml = new File(dir, username + "@" + host + "/" + message.identifier + ".eml");
try {
Reader reader = client.retrieveMessage(message.number);
if (reader == null) {
LOGGER.debug("Could not retrieve message.");
continue;
}
if (eml.exists()
&& ((message.size > 0 && eml.length() == message.size) || eml.length() > 1000)) {
LOGGER.debug("Message {} exist, skip download.", message.identifier);
continue;
}
eml.getParentFile().mkdirs();
LOGGER.debug("Downloading {} ...", message.identifier);
IOUtils.copy(reader, new FileOutputStream(eml));;
LOGGER.debug("Downloaded {} ...", message.identifier);
} catch (Exception e) {
try {
FileUtils.forceDelete(eml);
} catch (Exception exception) {
e.printStackTrace();
}
}
}
}
}
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* 下载所有电子邮件到指定目录
*/
public void download(String dir) {
download(new File(dir));
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/api/OAuth2.java
================================================
package com.belerweb.social.qq.connect.api;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.json.JSONObject;
import com.belerweb.social.API;
import com.belerweb.social.bean.Result;
import com.belerweb.social.qq.connect.bean.AccessToken;
import com.belerweb.social.qq.connect.bean.Display;
import com.belerweb.social.qq.connect.bean.Gut;
import com.belerweb.social.qq.connect.bean.OpenID;
import com.belerweb.social.qq.connect.bean.Scope;
public final class OAuth2 extends API {
OAuth2(QQConnect connect) {
super(connect);
}
/**
* 获取Authorization Code
*
* @see OAuth2#authorize(Boolean)
*/
public String authorize() {
return authorize(false);
}
/**
* 获取Authorization Code
*
* @see OAuth2#authorize(String, Boolean)
*/
public String authorize(String redirectUri) {
return authorize(redirectUri, false);
}
/**
* 获取Authorization Code
*
* 从 {@link QQConnect} 从获取clientId,redirectUri,responseType为code,state使用authorize,scope使用
* {@link Scope#ALL},其余参数默认
*
* @see OAuth2#authorize(String, String, String, String, Scope[], Display, Gut, Boolean)
*/
public String authorize(Boolean wap) {
return authorize(connect.getRedirectUri(), wap);
}
/**
* 获取Authorization Code
*
* 从 {@link QQConnect} 从获取clientId,responseType为code,state使用authorize,scope使用 {@link Scope#ALL}
* ,其余参数默认
*
* @see OAuth2#authorize(String, String, String, String, Scope[], Display, Gut, Boolean)
*/
public String authorize(String redirectUri, Boolean wap) {
return authorize(connect.getClientId(), redirectUri, "code", "authorize", Scope.ALL, null,
null, wap);
}
/**
* 获取Authorization Code
*
* 文档地址:http://wiki.connect.qq.com/使用authorization_code获取access_token
*
* @param clientId 必须,申请QQ登录成功后,分配给应用的appid。
* @param redirectUri 必须,成功授权后的回调地址,必须是注册appid时填写的主域名下的地址,建议设置为网站首页或网站的用户中心。注意需要将url进行URLEncode。
* @param responseType 必须,授权类型,此值固定为“code”。
* @param state 必须,client端的状态值。用于第三方应用防止CSRF攻击,成功授权后回调时会原样带回。请务必严格按照流程检查用户与state参数状态的绑定。
* @param scope 可选,请求用户授权时向用户显示的可进行授权的列表
* @param display 可选,仅PC网站接入时使用。用于展示的样式。不传则默认展示为PC下的样式。如果传入“mobile”,则展示为mobile端下的样式。
* @param gut 仅WAP网站接入时使用。QQ登录页面版本(1:wml版本; 2:xhtml版本),默认值为1。
* @param wap 是否使wap版,默认为false
*/
public String authorize(String clientId, String redirectUri, String responseType, String state,
Scope[] scope, Display display, Gut gut, Boolean wap) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "response_type", responseType);
connect.addParameter(params, "client_id", clientId);
connect.addParameter(params, "redirect_uri", redirectUri);
connect.addParameter(params, "state", state);
if (scope != null) {
connect.addParameter(params, "scope", StringUtils.join(scope, ","));
}
if (Display.MOBILE.equals(display)) {
connect.addParameter(params, "display", "mobile");
}
if (Gut.XHTML.equals(gut)) {
connect.addParameter(params, "g_ut", gut.toString());
}
String url = "https://graph.qq.com/oauth2.0/authorize?";
if (Boolean.TRUE.equals(wap)) {
url = "https://graph.z.qq.com/moc2/authorize?";
}
return url + StringUtils.join(params, "&");
}
/**
* 通过Authorization Code获取Access Token,此接口适用于PC网站。
*
* 从 {@link QQConnect} 从获取clientId,clientSecret,redirectUri,grantType为authorization_code
*
* @see OAuth2#accessToken(String, String, String, String, String, Boolean)
*/
public Result<AccessToken> accessToken(String code) {
return accessToken(code, connect.getRedirectUri());
}
/**
* 通过Authorization Code获取Access Token,此接口适用于PC网站。
*
* 从 {@link QQConnect} 从获取clientId,clientSecret,grantType为authorization_code
*
* @see OAuth2#accessToken(String, String, String, String, String, Boolean)
*/
public Result<AccessToken> accessToken(String code, String redirectUri) {
return accessToken(code, redirectUri, null);
}
/**
* 通过Authorization Code获取Access Token
*
* 从 {@link QQConnect} 从获取clientId,clientSecret,redirectUri,grantType为authorization_code
*
* @see OAuth2#accessToken(String, String, String, String, String, Boolean)
*/
public Result<AccessToken> accessToken(String code, Boolean wap) {
return accessToken(code, connect.getRedirectUri(), wap);
}
/**
* 通过Authorization Code获取Access Token
*
* 从 {@link QQConnect} 从获取clientId,clientSecret,grantType为authorization_code
*
* @see OAuth2#accessToken(String, String, String, String, String, Boolean)
*/
public Result<AccessToken> accessToken(String code, String redirectUri, Boolean wap) {
return accessToken(connect.getClientId(), connect.getClientSecret(), "authorization_code",
code, redirectUri, wap);
}
/**
* 通过Authorization Code获取Access Token
*
* 文档地址:http://wiki.connect.qq.com/使用authorization_code获取access_token
*
* @param clientId 申请QQ登录成功后,分配给网站的appid。
* @param clientSecret 申请QQ登录成功后,分配给网站的appkey。
* @param grantType 授权类型,在本步骤中,此值为“authorization_code”。
* @param code 上一步返回的authorization code。如果用户成功登录并授权,则会跳转到指定的回调地址,并在URL中带上Authorization
* Code。注意此code会在10分钟内过期。
* @param redirectUri 与上面一步中传入的redirect_uri保持一致。
* @param wap 是否使wap版,默认为false
*/
public Result<AccessToken> accessToken(String clientId, String clientSecret, String grantType,
String code, String redirectUri, Boolean wap) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "client_id", clientId);
connect.addParameter(params, "client_secret", clientSecret);
connect.addParameter(params, "grant_type", grantType);
connect.addParameter(params, "code", code);
connect.addParameter(params, "redirect_uri", redirectUri);
String url = "https://graph.qq.com/oauth2.0/token";
if (Boolean.TRUE.equals(wap)) {
url = "https://graph.z.qq.com/moc2/token";
}
String result = connect.get(url, params).trim();
return parseAccessTokenResult(result);
}
/**
* 权限自动续期,获取Access Token,此方法适用于PC网站。
*
* 从 {@link QQConnect}中获取 clientId, clientSecret
*
* @see OAuth2#refreshAccessToken(String, String, String, String, Boolean)
* @param refreshToken {@link AccessToken}中的refresToken。
*/
public Result<AccessToken> refreshAccessToken(String refreshToken) {
return refreshAccessToken(connect.getClientId(), connect.getClientSecret(), refreshToken);
}
/**
* 权限自动续期,获取Access Token,此方法适用于PC网站。
*
* @see OAuth2#refreshAccessToken(String, String, String, String, Boolean)
* @param refreshToken {@link AccessToken}中的refresToken。
*/
public Result<AccessToken> refreshAccessToken(String clientId, String clientSecret,
String refreshToken) {
return refreshAccessToken(clientId, clientSecret, "refresh_token", refreshToken, null);
}
/**
* 权限自动续期,获取Access Token
*
* 从 {@link QQConnect}中获取 clientId, clientSecret
*
* @see OAuth2#refreshAccessToken(String, String, String, String, Boolean)
* @param refreshToken {@link AccessToken}中的refresToken。
* @param wap 是否使wap版,默认为false
*/
public Result<AccessToken> refreshAccessToken(String refreshToken, Boolean wap) {
return refreshAccessToken(connect.getClientId(), connect.getClientSecret(), refreshToken, wap);
}
/**
* 权限自动续期,获取Access Token
*
* @see OAuth2#refreshAccessToken(String, String, String, String, Boolean)
* @param refreshToken {@link AccessToken}中的refresToken。
* @param wap 是否使wap版,默认为false
*/
public Result<AccessToken> refreshAccessToken(String clientId, String clientSecret,
String refreshToken, Boolean wap) {
return refreshAccessToken(clientId, clientSecret, "refresh_token", refreshToken, wap);
}
/**
* 权限自动续期,获取Access Token
*
* 文档地址:http://wiki.connect.qq.com/使用authorization_code获取access_token
*
* @param clientId 申请QQ登录成功后,分配给网站的appid。
* @param clientSecret 申请QQ登录成功后,分配给网站的appkey。
* @param grantType 授权类型,在本步骤中,此值为“refresh_token”。
* @param refresToken {@link AccessToken}中的refresToken。
* @param wap 是否使wap版,默认为false
*/
public Result<AccessToken> refreshAccessToken(String clientId, String clientSecret,
String grantType, String refreshToken, Boolean wap) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "client_id", clientId);
connect.addParameter(params, "client_secret", clientSecret);
connect.addParameter(params, "grant_type", grantType);
connect.addParameter(params, "refresh_token", refreshToken);
String url = "https://graph.qq.com/oauth2.0/token";
if (Boolean.TRUE.equals(wap)) {
url = "https://graph.z.qq.com/moc2/token";
}
String result = connect.get(url, params);
return parseAccessTokenResult(result);
}
/**
* 获取用户OpenID,此接口适用于PC网站访问
*
* 文档地址:http://wiki.connect.qq.com/获取用户openid_oauth2-0
*
* @param accessToken 授权令牌
*/
public Result<OpenID> openId(String accessToken) {
return openId(accessToken, null);
}
/**
* 获取用户OpenID
*
* 文档地址:http://wiki.connect.qq.com/获取用户openid_oauth2-0
*
* @param accessToken 授权令牌
* @param wap 是否使wap网站访问
*/
public Result<OpenID> openId(String accessToken, Boolean wap) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "access_token", accessToken);
String url = "https://graph.qq.com/oauth2.0/me";
if (Boolean.TRUE.equals(wap)) {
url = "https://graph.z.qq.com/moc2/me";
}
String result = connect.get(url, params).trim();
JSONObject jsonObject;
if (result.startsWith("callback")) {// PC网站的正确返回结果
jsonObject =
new JSONObject(result.substring(result.indexOf("{"), result.lastIndexOf("}") + 1));
} else {// WAP网站返回结果或错误信息
jsonObject = new JSONObject();
String[] results = result.split("\\&");
for (String param : results) {
String[] keyValue = param.split("\\=");
jsonObject.put(keyValue[0], keyValue.length > 0 ? keyValue[1] : null);
}
String errorCode = jsonObject.optString("code", null);
if (errorCode != null) {
jsonObject.put("ret", errorCode);// To match Error.parse()
}
}
return Result.parse(jsonObject, OpenID.class);
}
private Result<AccessToken> parseAccessTokenResult(String result) {
JSONObject jsonObject;
if (result.startsWith("callback")) {// 错误信息
// callback({"error":100021,"error_description":"get access token error"});
jsonObject =
new JSONObject(result.substring(result.indexOf("{"), result.lastIndexOf("}") + 1));
return Result.parse(jsonObject, AccessToken.class);
} else {// 正确结果
jsonObject = new JSONObject();
String[] results = result.split("\\&");
for (String param : results) {
String[] keyValue = param.split("\\=");
jsonObject.put(keyValue[0], keyValue.length > 0 ? keyValue[1] : null);
}
String errorCode = jsonObject.optString("code", null);
if (errorCode != null) {
jsonObject.put("ret", errorCode);// To match Error.parse()
}
}
return Result.parse(jsonObject, AccessToken.class);
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/api/QQConnect.java
================================================
package com.belerweb.social.qq.connect.api;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.json.JSONObject;
import com.belerweb.social.SDK;
import com.belerweb.social.bean.Error;
import com.belerweb.social.bean.Result;
import com.belerweb.social.exception.SocialException;
import com.belerweb.social.http.Http;
import com.belerweb.social.qq.connect.bean.NewT;
import com.belerweb.social.qq.connect.bean.TenpayAddress;
public final class QQConnect extends SDK {
private String clientId;
private String clientSecret;
private String redirectUri;
private OAuth2 oAuth2;
private User user;
public QQConnect(String clientId, String clientSecret) {
this.clientId = clientId;
this.clientSecret = clientSecret;
}
public QQConnect(String clientId, String clientSecret, String redirectUri) {
this(clientId, clientSecret);
this.redirectUri = redirectUri;
}
/**
* 收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/add_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要收听的用户的账户名列表。最多30个。
*/
public Result<Error> addIdol(String accessToken, String openId, List<String> name) {
return addIdol(accessToken, openId, name, null);
}
/**
* 收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/add_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要收听的用户的账户名列表。最多30个。
* @param fopenids 要收听的用户的openid列表。最多30个。 name和fopenids至少选一个,若同时存在则以name值为主。
*/
public Result<Error> addIdol(String accessToken, String openId, List<String> name,
List<String> fopenids) {
return addIdol(accessToken, getClientId(), openId, name, fopenids);
}
/**
* 收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/add_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要收听的用户的账户名列表。最多30个。
* @param fopenids 要收听的用户的openid列表。最多30个。 name和fopenids至少选一个,若同时存在则以name值为主。
*/
public Result<Error> addIdol(String accessToken, String oauthConsumerKey, String openId,
List<String> name, List<String> fopenids) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
if (name != null && !name.isEmpty()) {
addParameter(params, "name", StringUtils.join(name, ","));
}
if (fopenids != null && !fopenids.isEmpty()) {
addParameter(params, "fopenids", StringUtils.join(fopenids, "_"));
}
addParameter(params, "format", "json");
return Result.parse(post("https://graph.qq.com/relation/add_idol", params), Error.class);
}
/**
* 取消收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/del_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要取消收听的用户的账户名。 可选,name和fopenid至少选一个,若同时存在则以name值为主。
*/
public Result<Error> delIdol(String accessToken, String openId, String name) {
return delIdol(accessToken, openId, name, null);
}
/**
* 取消收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/del_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要取消收听的用户的账户名。 可选,name和fopenid至少选一个,若同时存在则以name值为主。
* @param fopenid 要取消收听的用户的openid。可选,name和fopenid至少选一个,若同时存在则以name值为主。
*/
public Result<Error> delIdol(String accessToken, String openId, String name, String fopenid) {
return delIdol(accessToken, getClientId(), openId, name, fopenid);
}
/**
* 取消收听腾讯微博上的用户。
*
* 文档地址:http://wiki.connect.qq.com/del_idol
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param name 要取消收听的用户的账户名。 可选,name和fopenid至少选一个,若同时存在则以name值为主。
* @param fopenid 要取消收听的用户的openid。可选,name和fopenid至少选一个,若同时存在则以name值为主。
*/
public Result<Error> delIdol(String accessToken, String oauthConsumerKey, String openId,
String name, String fopenid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addNotNullParameter(params, "name", name);
addNotNullParameter(params, "fopenid", fopenid);
addParameter(params, "format", "json");
return Result.parse(post("https://graph.qq.com/relation/del_idol", params), Error.class);
}
/**
* 登录用户发表一篇新日志。
*
* 文档地址:http://wiki.connect.qq.com/add_one_blog
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param title 日志标题(纯文本,最大长度128个字节,utf-8编码)。
* @param content 文章内容(html数据,最大长度100*1024个字节,utf-8编码).
*/
public Result<Error> addOneBlog(String accessToken, String openId, String title, String content) {
return addOneBlog(accessToken, getClientId(), openId, title, content);
}
/**
* 登录用户发表一篇新日志。
*
* 文档地址:http://wiki.connect.qq.com/add_one_blog
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param title 日志标题(纯文本,最大长度128个字节,utf-8编码)。
* @param content 文章内容(html数据,最大长度100*1024个字节,utf-8编码).
*/
public Result<Error> addOneBlog(String accessToken, String oauthConsumerKey, String openId,
String title, String content) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addParameter(params, "title", title);
addParameter(params, "content", content);
addParameter(params, "format", "json");
return Result.parse(post("https://graph.qq.com/blog/add_one_blog", params), Error.class);
}
/**
* 发表一条微博信息(纯文本)到腾讯微博平台上。注意连续两次发布的微博内容不可以重复。
*
* 文档地址:http://wiki.connect.qq.com/add_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
*/
public Result<NewT> addT(String accessToken, String openId, String content) {
return addT(accessToken, getClientId(), openId, content);
}
/**
* 发表一条微博信息(纯文本)到腾讯微博平台上。注意连续两次发布的微博内容不可以重复。
*
* 文档地址:http://wiki.connect.qq.com/add_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
*/
public Result<NewT> addT(String accessToken, String oauthConsumerKey, String openId,
String content) {
return addT(accessToken, oauthConsumerKey, openId, content, null, null, null, true, true);
}
/**
* 发表一条微博信息(纯文本)到腾讯微博平台上。注意连续两次发布的微博内容不可以重复。
*
* 文档地址:http://wiki.connect.qq.com/add_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
* @param clientIp 用户ip。必须正确填写用户侧真实ip,不能为内网ip及以127或255开头的ip,以分析用户所在地。
* @param lon 用户所在地理位置的经度。为实数,最多支持10位有效数字。有效范围:-180.0到+180.0,+表示东经,默认为0.0。
* @param lat 用户所在地理位置的纬度。为实数,最多支持10位有效数字。有效范围:-90.0到+90.0,+表示北纬,默认为0.0。
* @param sync 标识是否将发布的微博同步到QQ空间(0:同步; 1:不同步;),默认为0。该参数只支持OAuth1.0,OAuth2.0暂不支持。
* @param compatible 容错标志,支持按位操作,默认为0。0x20:微博内容长度超过140字则报错;0:以上错误均做容错处理,即发表普通微博。
*/
public Result<NewT> addT(String accessToken, String oauthConsumerKey, String openId,
String content, String clientIp, Double lon, Double lat, Boolean sync, Boolean compatible) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addParameter(params, "content", content);
addNotNullParameter(params, "clientip", clientIp);
addNotNullParameter(params, "lon", lon);
addNotNullParameter(params, "lat", lat);
if (sync != null) {
addParameter(params, "syncflag", sync ? "0" : "1");
}
if (compatible != null) {
addParameter(params, "compatibleflag", compatible ? "0" : "0x20");
}
addParameter(params, "format", "json");
JSONObject jsonObject = new JSONObject(post("https://graph.qq.com/t/add_t", params));
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<NewT>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
}
/**
* 根据微博ID删除指定微博。
*
* 文档地址:http://wiki.connect.qq.com/del_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param id 微博消息的ID,用来唯一标识一条微博消息。
*/
public Result<Error> delT(String accessToken, String openId, String id) {
return delT(accessToken, getClientId(), openId, id);
}
/**
* 上传一张图片,并发布一条消息到腾讯微博平台上。
*
* 文档地址:http://wiki.connect.qq.com/add_pic_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
* @param pic
* 要上传的图片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例)。图片仅支持gif、jpeg、jpg、png、bmp及ico格式(所有图片都会重新压缩
* ,gif被重新压缩后不会再有动画效果),图片size小于4M。
*/
public Result<NewT> addPicT(String accessToken, String openId, String content, byte[] pic) {
return addPicT(accessToken, getClientId(), openId, content, pic);
}
/**
* 上传一张图片,并发布一条消息到腾讯微博平台上。
*
* 文档地址:http://wiki.connect.qq.com/add_pic_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
* @param pic
* 要上传的图片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例)。图片仅支持gif、jpeg、jpg、png、bmp及ico格式(所有图片都会重新压缩
* ,gif被重新压缩后不会再有动画效果),图片size小于4M。
*/
public Result<NewT> addPicT(String accessToken, String oauthConsumerKey, String openId,
String content, byte[] pic) {
return addPicT(accessToken, oauthConsumerKey, openId, content, pic, null, null, null, true,
true);
}
/**
* 上传一张图片,并发布一条消息到腾讯微博平台上。
*
* 文档地址:http://wiki.connect.qq.com/add_pic_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param content
* 表示要发表的微博内容。必须为UTF-8编码,最长为140个汉字,也就是420字节。如果微博内容中有URL,后台会自动将该URL转换为短URL,每个URL折算成11个字节。
* 若在此处@好友,需正确填写好友的微博账号,而非昵称。
* @param pic
* 要上传的图片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例)。图片仅支持gif、jpeg、jpg、png、bmp及ico格式(所有图片都会重新压缩
* ,gif被重新压缩后不会再有动画效果),图片size小于4M。
* @param clientIp 用户ip。必须正确填写用户侧真实ip,不能为内网ip及以127或255开头的ip,以分析用户所在地。
* @param lon 用户所在地理位置的经度。为实数,最多支持10位有效数字。有效范围:-180.0到+180.0,+表示东经,默认为0.0。
* @param lat 用户所在地理位置的纬度。为实数,最多支持10位有效数字。有效范围:-90.0到+90.0,+表示北纬,默认为0.0。
* @param sync 标识是否将发布的微博同步到QQ空间(0:同步; 1:不同步;),默认为0。该参数只支持OAuth1.0,OAuth2.0暂不支持。
* @param compatible 容错标志,支持按位操作,默认为0。0x20:微博内容长度超过140字则报错;0:以上错误均做容错处理,即发表普通微博。
*/
public Result<NewT> addPicT(String accessToken, String oauthConsumerKey, String openId,
String content, byte[] pic, String clientIp, Double lon, Double lat, Boolean sync,
Boolean compatible) {
HttpPost request = new HttpPost("https://graph.qq.com/t/add_pic_t");
MultipartEntityBuilder builder = MultipartEntityBuilder.create().addBinaryBody("pic", pic);
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addParameter(params, "content", content);
addNotNullParameter(params, "clientip", clientIp);
addNotNullParameter(params, "lon", lon);
addNotNullParameter(params, "lat", lat);
if (sync != null) {
addParameter(params, "syncflag", sync ? "0" : "1");
}
if (compatible != null) {
addParameter(params, "compatibleflag", compatible ? "0" : "0x20");
}
addParameter(params, "format", "json");
for (NameValuePair nameValuePair : params) {
builder.addTextBody(nameValuePair.getName(), nameValuePair.getValue());
}
request.setEntity(builder.build());
try {
HttpResponse response = Http.CLIENT.execute(request);
String json = IOUtils.toString(response.getEntity().getContent());
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<NewT>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
} catch (ClientProtocolException e) {
throw new SocialException(e);
} catch (IOException e) {
throw new SocialException(e);
} finally {
request.releaseConnection();
}
}
/**
* 根据微博ID删除指定微博。
*
* 文档地址:http://wiki.connect.qq.com/del_t
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param id 微博消息的ID,用来唯一标识一条微博消息。
*/
public Result<Error> delT(String accessToken, String oauthConsumerKey, String openId, String id) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addParameter(params, "id", id);
addParameter(params, "format", "json");
return Result.parse(post("https://graph.qq.com/t/del_t", params), Error.class);
}
/**
* 获取财付通用户的收货地址。一个用户可能设置了多条收货地址信息。查询的用户必须为财付通用户,否则查询将返回失败。
*
* 文档地址:http://wiki.connect.qq.com/get_tenpay_addr
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
*/
public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, String openId) {
return getTenpayAddr(accessToken, getClientId(), openId, 0, Integer.MAX_VALUE);
}
/**
* 获取财付通用户的收货地址。一个用户可能设置了多条收货地址信息。查询的用户必须为财付通用户,否则查询将返回失败。
*
* 文档地址:http://wiki.connect.qq.com/get_tenpay_addr
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openId 用户的ID,与QQ号码一一对应。
* @param offset
* 表示查询收货地址的偏移量,一般情况下offset可以不传值或传入0,表示从第一条开始读取。offset参数是为一种特殊情况准备的,即该收货人有很多条收获地址,需要分页展示,
* 则offset可设置为该页显示的条数。例如如果offset为10,则会跳过第10条收货地址,从第11条收货地址开始读取。
* @param limit 表示查询收货地址的返回限制数(即最多期望返回几个收货地址)。limit不传默认按照5来处理。
*/
public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, String openId,
Integer offset, Integer limit) {
return getTenpayAddr(accessToken, getClientId(), openId, offset, limit);
}
/**
* 获取财付通用户的收货地址。一个用户可能设置了多条收货地址信息。查询的用户必须为财付通用户,否则查询将返回失败。
*
* 文档地址:http://wiki.connect.qq.com/get_tenpay_addr
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oauthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openId 用户的ID,与QQ号码一一对应。
* @param offset
* 表示查询收货地址的偏移量,一般情况下offset可以不传值或传入0,表示从第一条开始读取。offset参数是为一种特殊情况准备的,即该收货人有很多条收获地址,需要分页展示,
* 则offset可设置为该页显示的条数。例如如果offset为10,则会跳过第10条收货地址,从第11条收货地址开始读取。
* @param limit 表示查询收货地址的返回限制数(即最多期望返回几个收货地址)。limit不传默认按照5来处理。
*/
public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, String oauthConsumerKey,
String openId, Integer offset, Integer limit) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
addParameter(params, "access_token", accessToken);
addParameter(params, "oauth_consumer_key", oauthConsumerKey);
addParameter(params, "openid", openId);
addParameter(params, "offset", offset == null ? "0" : offset);
addParameter(params, "limit", limit == null ? "5" : limit);
addParameter(params, "ver", "1");
addParameter(params, "format", "json");
JSONObject jsonObject =
new JSONObject(post("https://graph.qq.com/cft_info/get_tenpay_addr", params));
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<List<TenpayAddress>>(error);
}
List<TenpayAddress> addresses = new ArrayList<TenpayAddress>();
Integer total = Result.parseInteger(jsonObject.get("ret_num"));
for (int i = 0; i < total; i++) {
Integer index = Result.parseInteger(jsonObject.opt("Findex_" + i));
if (index == null) {
break;
}
TenpayAddress address = new TenpayAddress();
address.setTotal(total);
address.setIndex(index);
address.setRegionId(Result.parseInteger(jsonObject.opt("FRegionId_" + i)));
address.setStreet(jsonObject.optString("Faddrstreet_" + i));
address.setZipcode(Result.toString(jsonObject.opt("Fzipcode_" + i)));
address.setMobile(Result.toString(jsonObject.opt("Fmobile_" + i)));
address.setTel(Result.toString(jsonObject.opt("Ftel_" + i)));
address.setName(Result.toString(jsonObject.opt("Fname_" + i)));
address.setCreated(Result.parseDate(jsonObject.opt("Fcreate_time_" + i),
"yyyy-MM-dd HH:mm:ss", Locale.CHINA));
address.setModified(Result.parseDate(jsonObject.opt("Fmod_time_" + i), "yyyy-MM-dd HH:mm:ss",
Locale.CHINA));
address.setLastUsed(Result.parseDate(jsonObject.opt("Flastuse_time_" + i),
"yyyy-MM-dd HH:mm:ss", Locale.CHINA));
address.setUsedCount(Result.parseInteger(jsonObject.opt("FUsedCount_" + i)));
}
return new Result<List<TenpayAddress>>(addresses);
}
public OAuth2 getOAuth2() {
if (oAuth2 == null) {
oAuth2 = new OAuth2(this);
}
return oAuth2;
}
public User getUser() {
if (user == null) {
user = new User(this);
}
return user;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public String getRedirectUri() {
return redirectUri;
}
public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/api/QZone.java
================================================
package com.belerweb.social.qq.connect.api;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.json.JSONArray;
import org.json.JSONObject;
import com.belerweb.social.API;
import com.belerweb.social.bean.Error;
import com.belerweb.social.bean.Result;
import com.belerweb.social.exception.SocialException;
import com.belerweb.social.http.Http;
import com.belerweb.social.qq.connect.bean.Album;
import com.belerweb.social.qq.connect.bean.AlbumPrivilege;
import com.belerweb.social.qq.connect.bean.Photo;
import com.belerweb.social.qq.connect.bean.PicUploadResult;
/**
* QZone API,相册,日志...
*/
public final class QZone extends API {
protected QZone(QQConnect connect) {
super(connect);
}
/**
* 获取登录用户的相册列表。
*
* 文档地址:http://wiki.connect.qq.com/list_album
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<Album> listAlbum(String accessToken, String openid) {
return listAlbum(connect.getClientId(), accessToken, openid);
}
/**
* 获取登录用户的相册列表。
*
* 文档地址:http://wiki.connect.qq.com/list_album
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<Album> listAlbum(String oAuthConsumerKey, String accessToken, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
String json = connect.get("https://graph.qq.com/photo/list_album", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<Album>(error);
}
List<Album> results = new ArrayList<Album>();
JSONArray jsonArray = jsonObject.getJSONArray("album");
for (int i = 0; i < jsonArray.length(); i++) {
results.add(Album.parse(jsonArray.getJSONObject(i)));
}
return new Result<Album>(results);
}
/**
* 登录用户创建一个公共相册。注:每个用户最多可创建10个相册。
*
* 文档地址:http://wiki.connect.qq.com/add_album
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param albumName 相册名,不能超过30个字符。
*/
public Result<Album> addAlbum(String accessToken, String openid, String albumName) {
return addAlbum(connect.getClientId(), accessToken, openid, albumName, null, null, null, null);
}
/**
* 登录用户创建相册。注:每个用户最多可创建10个相册。
*
* 文档地址:http://wiki.connect.qq.com/add_album
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param albumName 相册名,不能超过30个字符。
* @param albumDesc 相册描述,不能超过200个字符。
* @param privilege 用户的ID,与QQ号码一一对应。 相册权限,
*
* 其取值含义为: 1=公开;3=只主人可见; 4=QQ好友可见; 5=问答加密。
*
* 不传则相册默认为公开权限。
*
* 如果priv取值为5,即相册是问答加密的,则必须包含问题和答案两个参数:
*
* -question: 问题,不能超过30个字符。
*
* -answer: 答案,不能超过30个字符。
*/
public Result<Album> addAlbum(String oAuthConsumerKey, String accessToken, String openid,
String albumName, String albumDesc, AlbumPrivilege privilege, String question, String answer) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addParameter(params, "albumname", albumName);
connect.addNotNullParameter(params, "albumdesc", albumDesc);
connect.addNotNullParameter(params, "priv", privilege);
if (privilege == AlbumPrivilege.QUESTION) {
connect.addParameter(params, "question", question);
connect.addParameter(params, "answer", answer);
}
String json = connect.post("https://graph.qq.com/photo/add_album", params);
return Result.parse(json, Album.class);
}
/**
* 登录用户上传照片,支持单张上传和批量上传。
*
* 文档地址:http://wiki.connect.qq.com/upload_pic
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param title 照片的命名,必须以.jpg, .gif, .png, .jpeg, .bmp此类后缀结尾。
* @param picture
* @param photoDesc 照片描述,注意照片描述不能超过200个字符。
* @param albumId 相册id。可不填,不填时则根据“mobile”标识选择默认上传的相册。
* @param mobile
* 标志位,0表示PC,1表示手机。用于当不传相册id时(即albumid为空时)控制是否传到手机相册。(1)如果传1,则当albumid为空时,图片会上传到手机相册;(2)
* 如果不传或传0,则当albumid为空时,图片会上传到贴图相册;
* @param lon 照片拍摄时的地理位置的经度。请使用原始数据(纯经纬度,0-360)。
* @param lat 照片拍摄时的地理位置的纬度。请使用原始数据(纯经纬度,0-360)。
* @param needFeed 标识上传照片时是否要发feed(0:不发feed; 1:发feed)。如果不填则默认为发feed。
* @param successNum 批量上传照片时,已成功上传的张数,指明上传完成情况。单张上传时可以不填,不填则默认为0。
* @param picNum
* 批量上传照片的总张数,如果不填则默认为1。如果picnum=1,为单张上传,发送单张上传feed;如果picnum>1,为批量上传,发送批量上传feed。批量上传方式:
* picnum为一次上传照片的张数
* ,successnum初始值为0,每调用一次照片上传接口后递增其值。信息中心中的feed表现形式:批量上传时最新的7张在feed中展示。其中最新上传的一张图片展示为大图
* ,剩下的六张按从新到旧的顺序展示为小图,其他图片不在feed中展示。
*/
public Result<PicUploadResult> uploadPic(String oAuthConsumerKey, String accessToken,
String openid, String title, byte[] picture, String photoDesc, String albumId,
Boolean mobile, Double lon, Double lat, Boolean needFeed, Integer successNum, Integer picNum) {
HttpPost request = new HttpPost("https://graph.qq.com/photo/upload_pic");
MultipartEntityBuilder builder =
MultipartEntityBuilder.create().addBinaryBody("picture", picture,
ContentType.create("image/" + title.substring(title.lastIndexOf(".") + 1)), title);
builder.addTextBody("oauth_consumer_key", oAuthConsumerKey);
builder.addTextBody("access_token", accessToken);
builder.addTextBody("openid", openid);
builder.addTextBody("format", "json");
builder.addTextBody("title", title);
if (photoDesc != null) {
builder.addTextBody("photodesc", photoDesc);
}
if (albumId != null) {
builder.addTextBody("albumid", albumId);
}
if (Boolean.TRUE.equals(mobile)) {
builder.addTextBody("mobile", "1");
}
if (lon != null) {
builder.addTextBody("x", lon.toString());
}
if (lat != null) {
builder.addTextBody("y", lat.toString());
}
if (Boolean.FALSE.equals(needFeed)) {
builder.addTextBody("needfeed", "0");
}
if (successNum != null) {
builder.addTextBody("successnum", successNum.toString());
}
if (picNum != null) {
builder.addTextBody("picnum", picNum.toString());
}
request.setEntity(builder.build());
try {
HttpResponse response = Http.CLIENT.execute(request);
String json = IOUtils.toString(response.getEntity().getContent());
return Result.parse(json, PicUploadResult.class);
} catch (ClientProtocolException e) {
throw new SocialException(e);
} catch (IOException e) {
throw new SocialException(e);
} finally {
request.releaseConnection();
}
}
/**
* 获取登录用户的照片列表。
*
* 文档地址:http://wiki.connect.qq.com/list_photo
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param albumId 表示要获取的照片列表所在的相册ID。
*/
public Result<Photo> listPhoto(String accessToken, String openid, String albumId) {
return listPhoto(connect.getClientId(), accessToken, openid, albumId);
}
/**
* 获取登录用户的照片列表。
*
* 文档地址:http://wiki.connect.qq.com/list_photo
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param albumId 表示要获取的照片列表所在的相册ID。
*/
public Result<Photo> listPhoto(String oAuthConsumerKey, String accessToken, String openid,
String albumId) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addParameter(params, "albumid", albumId);
String json = connect.get("https://graph.qq.com/photo/list_photo", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<Photo>(error);
}
List<Photo> results = new ArrayList<Photo>();
JSONArray jsonArray = jsonObject.getJSONArray("photos");
for (int i = 0; i < jsonArray.length(); i++) {
results.add(Photo.parse(jsonArray.getJSONObject(i)));
}
return new Result<Photo>(results);
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/api/User.java
================================================
package com.belerweb.social.qq.connect.api;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import com.belerweb.social.API;
import com.belerweb.social.bean.Result;
/**
* 访问用户资料
*/
public final class User extends API {
protected User(QQConnect connect) {
super(connect);
}
/**
* 获取登录用户在QQ空间的信息,包括昵称、头像、性别及黄钻信息(包括黄钻等级、是否年费黄钻等)。此接口仅支持网站调用
*
* 文档地址:http://wiki.connect.qq.com/get_user_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* 可通过调用https://graph.qq.com/oauth2.0/me?access_token=YOUR_ACCESS_TOKEN 来获取。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getUserInfo(String accessToken,
String openid) {
return getUserInfo(accessToken, connect.getClientId(), openid);
}
/**
* 获取登录用户在QQ空间的信息,包括昵称、头像、性别及黄钻信息(包括黄钻等级、是否年费黄钻等)。此接口仅支持网站调用
*
* 文档地址:http://wiki.connect.qq.com/get_user_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openid 用户的ID,与QQ号码一一对应。
* 可通过调用https://graph.qq.com/oauth2.0/me?access_token=YOUR_ACCESS_TOKEN 来获取。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getUserInfo(String accessToken,
String oAuthConsumerKey, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "openid", openid);
connect.addNotNullParameter(params, "format", "json");
String json = connect.get("https://graph.qq.com/user/get_user_info", params);
return Result.parse(json, com.belerweb.social.qq.connect.bean.User.class);
}
/**
* 获取移动端应用的登录用户在QQ空间的简单个人信息,包括昵称、头像和黄钻信息(包括黄钻等级、是否年费黄钻等),以及用户的QQ头像。 此接口仅支持移动端应用调用
*
* 文档地址:http://wiki.connect.qq.com/get_simple_userinfo
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openid 用户的ID,与QQ号码一一对应。
* 可通过调用https://graph.qq.com/oauth2.0/me?access_token=YOUR_ACCESS_TOKEN 来获取。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getSimpleUserInfo(String accessToken,
String oAuthConsumerKey, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "openid", openid);
connect.addNotNullParameter(params, "format", "json");
String json = connect.get("https://openmobile.qq.com/user/get_simple_userinfo", params);
return Result.parse(json, com.belerweb.social.qq.connect.bean.User.class);
}
/**
* 获取已登录用户的关于QQ会员业务的基本资料。
*
* 基本资料包括以下信息:是否为“普通包月会员”,是否为“年费会员”,QQ会员等级信息,是否为“豪华版QQ会员”,是否为“钻皇会员”,是否为“SVIP”。
*
* 文档地址:http://wiki.connect.qq.com/get_vip_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getVipInfo(String accessToken,
String openid) {
return getVipInfo(accessToken, connect.getClientId(), openid);
}
/**
* 获取已登录用户的关于QQ会员业务的基本资料。
*
* 基本资料包括以下信息:是否为“普通包月会员”,是否为“年费会员”,QQ会员等级信息,是否为“豪华版QQ会员”,是否为“钻皇会员”,是否为“SVIP”。
*
* 文档地址:http://wiki.connect.qq.com/get_vip_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getVipInfo(String accessToken,
String oAuthConsumerKey, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
String json = connect.get("https://graph.qq.com/user/get_vip_info", params);
return Result.parse(json, com.belerweb.social.qq.connect.bean.User.class);
}
/**
* 获取已登录用户的关于QQ会员业务的详细资料。
*
* 详细资料包括:用户会员的历史属性,用户会员特权的到期时间,用户最后一次充值会员业务的支付渠道,用户开通会员的主要驱动因素。
*
* 文档地址:http://wiki.connect.qq.com/get_vip_rich_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getVipRichInfo(String accessToken,
String openid) {
return getVipRichInfo(connect.getClientId(), accessToken, openid);
}
/**
* 获取已登录用户的关于QQ会员业务的详细资料。
*
* 详细资料包括:用户会员的历史属性,用户会员特权的到期时间,用户最后一次充值会员业务的支付渠道,用户开通会员的主要驱动因素。
*
* 文档地址:http://wiki.connect.qq.com/get_vip_rich_info
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<com.belerweb.social.qq.connect.bean.User> getVipRichInfo(String oAuthConsumerKey,
String accessToken, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
String json = connect.get("https://graph.qq.com/user/get_vip_rich_info", params);
return Result.parse(json, com.belerweb.social.qq.connect.bean.User.class);
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/api/Weibo.java
================================================
package com.belerweb.social.qq.connect.api;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.json.JSONObject;
import com.belerweb.social.API;
import com.belerweb.social.bean.Error;
import com.belerweb.social.bean.Result;
import com.belerweb.social.qq.connect.bean.FanList;
import com.belerweb.social.qq.connect.bean.IdolList;
import com.belerweb.social.qq.connect.bean.RepostList;
import com.belerweb.social.qq.connect.bean.WeiboUser;
/**
* 腾讯微博API
*/
public final class Weibo extends API {
protected Weibo(QQConnect connect) {
super(connect);
}
/**
* 获取腾讯微博登录用户的用户资料。
*
* 文档地址:http://wiki.connect.qq.com/get_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<WeiboUser> getInfo(String accessToken, String openid) {
return getInfo(connect.getClientId(), accessToken, openid);
}
/**
* 获取腾讯微博登录用户的用户资料。
*
* 文档地址:http://wiki.connect.qq.com/get_info
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
*/
public Result<WeiboUser> getInfo(String oAuthConsumerKey, String accessToken, String openid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
String json = connect.get("https://graph.qq.com/user/get_info", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<WeiboUser>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), WeiboUser.class);
}
/**
* 获取腾讯微博其他用户详细信息。
*
* 文档地址:http://wiki.connect.qq.com/get_other_info
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param name 其他用户的账户名。可选,name和fopenid至少选一个,若同时存在则以name值为主。
*/
public Result<WeiboUser> getOtherInfo(String accessToken, String openid, String name) {
return getOtherInfo(connect.getClientId(), accessToken, openid, name, null);
}
/**
* 获取腾讯微博其他用户详细信息。
*
* 文档地址:http://wiki.connect.qq.com/get_other_info
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param name 其他用户的账户名。可选,name和fopenid至少选一个,若同时存在则以name值为主。
* @param fopenid 其他用户的账户名。可选,name和fopenid至少选一个,若同时存在则以name值为主。
*/
public Result<WeiboUser> getOtherInfo(String oAuthConsumerKey, String accessToken, String openid,
String name, String fopenid) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addNotNullParameter(params, "name", name);
connect.addNotNullParameter(params, "fopenid", fopenid);
String json = connect.get("https://graph.qq.com/user/get_other_info", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<WeiboUser>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), WeiboUser.class);
}
/**
* 获取登录用户的听众列表。
*
* 文档地址:http://wiki.connect.qq.com/get_fanslist
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param reqNum 必须。请求获取的听众个数。取值范围为1-30。
* @param startIndex 必须。请求获取听众列表的起始位置。第一页:0;继续向下翻页:reqnum*(page-1)。
*/
public Result<FanList> getFansList(String accessToken, String openid, int reqNum, int startIndex) {
return getFansList(connect.getClientId(), accessToken, openid, reqNum, startIndex, null, null,
null);
}
/**
* 获取登录用户的听众列表。
*
* 文档地址:http://wiki.connect.qq.com/get_fanslist
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param reqNum 必须。请求获取的听众个数。取值范围为1-30。
* @param startIndex 必须。请求获取听众列表的起始位置。第一页:0;继续向下翻页:reqnum*(page-1)。
* @param newMode
* 获取听众信息的模式。获取听众信息的模式,默认值为0。0:旧模式,新添加的听众信息排在前面,最多只能拉取1000个听众的信息。1:新模式,可以拉取所有听众的信息,暂时不支持排序。
* @param install 判断获取的是安装应用的听众,还是未安装应用的听众。 0:不考虑该参数;1:获取已安装应用的听众信息;2:获取未安装应用的听众信息。
* @param sex 按性别过滤标识,默认为0。此参数当mode=0时使用,支持排序。 1:获取的是男性听众信息;2:获取的是女性听众信息;0:不进行性别过滤,获取所有听众信息。
*/
public Result<FanList> getFansList(String oAuthConsumerKey, String accessToken, String openid,
int reqNum, int startIndex, Boolean newMode, Integer install, Integer sex) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addParameter(params, "reqnum", reqNum);
connect.addParameter(params, "startindex", startIndex);
if (Boolean.TRUE.equals(newMode)) {
connect.addParameter(params, "mode", "1");
}
connect.addNotNullParameter(params, "install", install);
connect.addNotNullParameter(params, "sex", sex);
String json = connect.get("https://graph.qq.com/relation/get_fanslist", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<FanList>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), FanList.class);
}
/**
* 获取登录用户收听的人的列表。
*
* 文档地址:http://wiki.connect.qq.com/get_idollist
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param reqNum 必须。请求获取的听众个数。取值范围为1-30。
* @param startIndex 必须。请求获取听众列表的起始位置。第一页:0;继续向下翻页:reqnum*(page-1)。
*/
public Result<IdolList> getIdolList(String accessToken, String openid, int reqNum, int startIndex) {
return getIdolList(connect.getClientId(), accessToken, openid, reqNum, startIndex, null, null);
}
/**
* 获取登录用户收听的人的列表。
*
* 文档地址:http://wiki.connect.qq.com/get_idollist
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param reqNum 必须。请求获取的听众个数。取值范围为1-30。
* @param startIndex 必须。请求获取听众列表的起始位置。第一页:0;继续向下翻页:reqnum*(page-1)。
* @param newMode 获取收听的人的信息模式,默认为0。
* 0:旧模式,新添加的收听的人信息排在前面,最多只能拉取1000个收听的人的信息。1:新模式,最多可拉取10000个收听的人的信息,暂不支持排序。
* @param install 判断获取的是安装了应用的收听好友,还是未安装应用的收听好友。0:不考虑该参数;1:获取已安装应用的收听好友信息;2:获取未安装应用的收听好友信息。
*/
public Result<IdolList> getIdolList(String oAuthConsumerKey, String accessToken, String openid,
int reqNum, int startIndex, Boolean newMode, Integer install) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addParameter(params, "reqnum", reqNum);
connect.addParameter(params, "startindex", startIndex);
if (Boolean.TRUE.equals(newMode)) {
connect.addParameter(params, "mode", "1");
}
connect.addNotNullParameter(params, "install", install);
String json = connect.get("https://graph.qq.com/relation/get_idollist", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<IdolList>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), IdolList.class);
}
/**
* 获取一条微博的转播或评论信息列表。
*
* 文档地址:http://wiki.connect.qq.com/get_repost_list
*
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param reqNum 必须。请求获取的听众个数。取值范围为1-30。
* @param startIndex 必须。请求获取听众列表的起始位置。第一页:0;继续向下翻页:reqnum*(page-1)。
*/
public Result<RepostList> getRepostList(String accessToken, String openid, int flag,
String rootId, int pageFlag, int pageTime, int reqNum, String twitterId) {
return getRepostList(connect.getClientId(), accessToken, openid, flag, rootId, pageFlag,
pageTime, reqNum, twitterId);
}
/**
* 获取一条微博的转播或评论信息列表。
*
* 文档地址:http://wiki.connect.qq.com/get_repost_list
*
* @param oAuthConsumerKey 申请QQ登录成功后,分配给应用的appid
* @param accessToken 可通过使用Authorization_Code获取Access_Token 或来获取。access_token有3个月有效期。
* @param openid 用户的ID,与QQ号码一一对应。
* @param flag 标识获取的是转播列表还是点评列表。0:获取转播列表;1:获取点评列表;2:转播列表和点评列表都获取。
* @param rootId 转发或点评的源微博的ID。
* @param pageFlag 分页标识。0:第一页;1:向下翻页;2:向上翻页。
* @param pageTime 分页标识。0:第一页;1:向下翻页;2:向上翻页。
* @param reqNum 每次请求记录的条数。取值为1-100条。
* @param twitterId 翻页时使用。第1-100条:0;继续向下翻页:上一次请求返回的最后一条记录id。
*/
public Result<RepostList> getRepostList(String oAuthConsumerKey, String accessToken,
String openid, int flag, String rootId, int pageFlag, int pageTime, int reqNum,
String twitterId) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
connect.addParameter(params, "oauth_consumer_key", oAuthConsumerKey);
connect.addParameter(params, "access_token", accessToken);
connect.addParameter(params, "openid", openid);
connect.addParameter(params, "format", "json");
connect.addParameter(params, "flag", flag);
connect.addParameter(params, "rootid", rootId);
connect.addParameter(params, "pageflag", pageFlag);
connect.addParameter(params, "pagetime", pageTime);
connect.addParameter(params, "reqnum", reqNum);
connect.addParameter(params, "twitterid", twitterId);
String json = connect.get("https://graph.qq.com/t/get_repost_list", params);
JSONObject jsonObject = new JSONObject(json);
Error error = Error.parse(jsonObject);
if (error != null) {
return new Result<RepostList>(error);
}
return Result.parse(jsonObject.getJSONObject("data"), RepostList.class);
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/AccessToken.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class AccessToken extends JsonBean {
public AccessToken() {}
private AccessToken(JSONObject jsonObject) {
super(jsonObject);
}
private String token;// 授权令牌,Access_Token。
private Long expiresIn;// 该access token的有效期,单位为秒。
private String refreshToken;// 在授权自动续期步骤中,获取新的Access_Token时需要提供的参数。
/**
* 授权令牌,Access_Token。
*/
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
/**
* 该access token的有效期,单位为秒。
*/
public Long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
}
/**
* 在授权自动续期步骤中,获取新的Access_Token时需要提供的参数。
*/
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public static AccessToken parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
AccessToken obj = new AccessToken(jsonObject);
obj.token = jsonObject.getString("access_token");
obj.expiresIn = Result.parseLong(jsonObject.opt("expires_in"));
obj.refreshToken = Result.toString(jsonObject.opt("refresh_token"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Album.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Album extends JsonBean {
public Album() {}
private Album(JSONObject jsonObject) {
super(jsonObject);
}
private String albumId;
private String classId;
private Date createTime;
private String name;
private String description;
private String cover;
private Integer picNum;
public String getAlbumId() {
return albumId;
}
public void setAlbumId(String albumId) {
this.albumId = albumId;
}
public String getClassId() {
return classId;
}
public void setClassId(String classId) {
this.classId = classId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
public Integer getPicNum() {
return picNum;
}
public void setPicNum(Integer picNum) {
this.picNum = picNum;
}
public static Album parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Album obj = new Album(jsonObject);
obj.albumId = Result.toString(jsonObject.get("albumid"));
obj.classId = Result.toString(jsonObject.opt("classid"));
obj.createTime = Result.parseTimeSeconds(jsonObject.opt("createtime"));
obj.name = Result.toString(jsonObject.opt("name"));
obj.description = Result.toString(jsonObject.opt("desc"));
obj.cover = Result.toString(jsonObject.opt("coverurl"));
obj.picNum = Result.parseInteger(jsonObject.opt("picnum"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/AlbumPrivilege.java
================================================
package com.belerweb.social.qq.connect.bean;
public enum AlbumPrivilege {
PUBLIC(1), PRIVATE(3), FRIEND(4), QUESTION(5);
private Integer value;
private AlbumPrivilege(Integer value) {
this.value = value;
}
public Integer value() {
return value;
}
@Override
public String toString() {
return value.toString();
}
public static AlbumPrivilege parse(Integer value) {
if (value == null) {
return null;
}
if (value == 1) {
return PUBLIC;
}
if (value == 3) {
return PRIVATE;
}
if (value == 4) {
return FRIEND;
}
if (value == 5) {
return QUESTION;
}
return null;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Company.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Company extends JsonBean {
public Company() {}
private Company(JSONObject jsonObject) {
super(jsonObject);
}
private String id;// 公司id。
private String companyName;// 公司名称。
private String departmentName;// 部门名称。
private Integer beginYear;// 开始年。
private Integer endYear;// 结束年。
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public Integer getBeginYear() {
return beginYear;
}
public void setBeginYear(Integer beginYear) {
this.beginYear = beginYear;
}
public Integer getEndYear() {
return endYear;
}
public void setEndYear(Integer endYear) {
this.endYear = endYear;
}
public static Company parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Company obj = new Company(jsonObject);
obj.id = Result.toString(jsonObject.get("id"));
obj.companyName = Result.toString(jsonObject.opt("company_name"));
obj.departmentName = Result.toString(jsonObject.opt("department_name"));
obj.beginYear = Result.parseInteger(jsonObject.opt("begin_year"));
obj.endYear = Result.parseInteger(jsonObject.opt("end_year"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Display.java
================================================
package com.belerweb.social.qq.connect.bean;
public enum Display {
DEFAULT,
MOBILE;
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Education.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Education extends JsonBean {
public Education() {}
private Education(JSONObject jsonObject) {
super(jsonObject);
}
private String id;// 教育信息记录ID。
private Integer year;// 入学年。
private String schoolId;// 学校ID。学校ID与学校具体信息的对应关系请参见教育信息数据库。
private String departmentId;// 院系ID。院系ID与院系具体信息的对应关系请参见教育信息数据库。
private Integer level;// 学历级别。
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public String getSchoolId() {
return schoolId;
}
public void setSchoolId(String schoolId) {
this.schoolId = schoolId;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public static Education parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Education obj = new Education(jsonObject);
obj.id = Result.toString(jsonObject.get("id"));
obj.schoolId = Result.toString(jsonObject.opt("company_name"));
obj.departmentId = Result.toString(jsonObject.opt("department_name"));
obj.year = Result.parseInteger(jsonObject.opt("begin_year"));
obj.level = Result.parseInteger(jsonObject.opt("end_year"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/FanList.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import java.util.List;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class FanList extends JsonBean {
public FanList() {}
private FanList(JSONObject jsonObject) {
super(jsonObject);
}
private Date timestamp;
private Boolean hasNext;
private List<WeiboUser> fans;
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Boolean getHasNext() {
return hasNext;
}
public void setHasNext(Boolean hasNext) {
this.hasNext = hasNext;
}
public List<WeiboUser> getFans() {
return fans;
}
public void setFans(List<WeiboUser> fans) {
this.fans = fans;
}
public static FanList parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
FanList obj = new FanList(jsonObject);
obj.timestamp = Result.parseTimeSeconds(jsonObject.get("timestamp"));
obj.hasNext = Result.parseBoolean(jsonObject.get("hasnext"));
obj.fans = Result.parse(jsonObject.optJSONArray("info"), WeiboUser.class);
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Gut.java
================================================
package com.belerweb.social.qq.connect.bean;
/**
* QQ登录页面版本
*/
public enum Gut {
WML(1),
XHTML(2);
private int value;
private Gut(int value) {
this.value = value;
}
public int value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/IdolList.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import java.util.List;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class IdolList extends JsonBean {
public IdolList() {}
private IdolList(JSONObject jsonObject) {
super(jsonObject);
}
private Date timestamp;
private Boolean hasNext;
private List<WeiboUser> fans;
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Boolean getHasNext() {
return hasNext;
}
public void setHasNext(Boolean hasNext) {
this.hasNext = hasNext;
}
public List<WeiboUser> getFans() {
return fans;
}
public void setFans(List<WeiboUser> fans) {
this.fans = fans;
}
public static IdolList parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
IdolList obj = new IdolList(jsonObject);
obj.timestamp = Result.parseTimeSeconds(jsonObject.get("timestamp"));
obj.hasNext = Result.parseBoolean(jsonObject.get("hasnext"));
obj.fans = Result.parse(jsonObject.optJSONArray("info"), WeiboUser.class);
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Image.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Image extends JsonBean {
public Image() {}
private Image(JSONObject jsonObject) {
super(jsonObject);
}
private String url;
private Integer width;
private Integer height;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public static Image parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Image obj = new Image(jsonObject);
obj.url = Result.toString(jsonObject.opt("url"));
obj.width = Result.parseInteger(jsonObject.opt("width"));
obj.height = Result.parseInteger(jsonObject.opt("height"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Music.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Music extends JsonBean {
public Music() {}
private Music(JSONObject jsonObject) {
super(jsonObject);
}
private String author;// 演唱者。
private String url;// 音频地址。
private String title;// 音频名字,歌名。
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public static Music parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Music obj = new Music(jsonObject);
obj.author = Result.toString(jsonObject.opt("author"));
obj.url = Result.toString(jsonObject.opt("url"));
obj.title = Result.toString(jsonObject.opt("title"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/NewT.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
/**
* 新发布的微博的返回信息
*/
public class NewT extends JsonBean {
public NewT() {}
private NewT(JSONObject jsonObject) {
super(jsonObject);
}
private Long id;// 微博的ID,用来唯一标识一条微博。
private Date time;// 微博的发表时间。
private String imgUrl;// 图片分享后的url地址。
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public static NewT parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
NewT obj = new NewT(jsonObject);
obj.id = Result.parseLong(jsonObject.get("id"));
obj.time = new Date(Result.parseLong(jsonObject.get("time")) * 1000);
obj.imgUrl = jsonObject.optString("imgurl");
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/OpenID.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
public class OpenID extends JsonBean {
public OpenID() {}
private OpenID(JSONObject jsonObject) {
super(jsonObject);
}
private String clientId;
private String openId; // openid是此网站上唯一对应用户身份的标识,网站可将此ID进行存储便于用户下次登录时辨识其身份,或将其与用户在网站上的原有账号进行绑定。
/**
* openid是此网站上唯一对应用户身份的标识,网站可将此ID进行存储便于用户下次登录时辨识其身份,或将其与用户在网站上的原有账号进行绑定。
*/
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public static OpenID parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
OpenID obj = new OpenID(jsonObject);
obj.clientId = jsonObject.getString("client_id");
obj.openId = jsonObject.getString("openid");
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Photo.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import java.util.Locale;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Photo extends JsonBean {
public Photo() {}
private Photo(JSONObject jsonObject) {
super(jsonObject);
}
private String sLoc;
private String lLoc;
private String name;
private String description;
private Date updatedTime;
private Date uploadedTime;
private String smallUrl;
private Image largeImage;
public String getsLoc() {
return sLoc;
}
public void setsLoc(String sLoc) {
this.sLoc = sLoc;
}
public String getlLoc() {
return lLoc;
}
public void setlLoc(String lLoc) {
this.lLoc = lLoc;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUploadedTime() {
return uploadedTime;
}
public void setUploadedTime(Date uploadedTime) {
this.uploadedTime = uploadedTime;
}
public String getSmallUrl() {
return smallUrl;
}
public void setSmallUrl(String smallUrl) {
this.smallUrl = smallUrl;
}
public Image getLargeImage() {
return largeImage;
}
public void setLargeImage(Image largeImage) {
this.largeImage = largeImage;
}
public static Photo parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Photo obj = new Photo(jsonObject);
obj.sLoc = Result.toString(jsonObject.opt("sloc"));
obj.lLoc = Result.toString(jsonObject.opt("lloc"));
obj.name = Result.toString(jsonObject.opt("name"));
obj.description = Result.toString(jsonObject.opt("desc"));
obj.updatedTime = Result.parseTimeSeconds(jsonObject.opt("updated_time"));
obj.uploadedTime =
Result.parseDate(jsonObject.opt("uploaded_time"), "yyyy-MM-dd HH:mm:ss", Locale.CHINA);
obj.smallUrl = Result.toString(jsonObject.opt("small_url"));
obj.largeImage = Image.parse(jsonObject.optJSONObject("large_image"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/PicUploadResult.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class PicUploadResult extends JsonBean {
public PicUploadResult() {}
private PicUploadResult(JSONObject jsonObject) {
super(jsonObject);
}
private String albumId;
private String lLoc;
private String sLoc;
private String largeUrl;
private String smallUrl;
private Integer width;
private Integer height;
public String getAlbumId() {
return albumId;
}
public void setAlbumId(String albumId) {
this.albumId = albumId;
}
public String getlLoc() {
return lLoc;
}
public void setlLoc(String lLoc) {
this.lLoc = lLoc;
}
public String getsLoc() {
return sLoc;
}
public void setsLoc(String sLoc) {
this.sLoc = sLoc;
}
public String getLargeUrl() {
return largeUrl;
}
public void setLargeUrl(String largeUrl) {
this.largeUrl = largeUrl;
}
public String getSmallUrl() {
return smallUrl;
}
public void setSmallUrl(String smallUrl) {
this.smallUrl = smallUrl;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public static PicUploadResult parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
PicUploadResult obj = new PicUploadResult(jsonObject);
obj.albumId = Result.toString(jsonObject.opt("albumid"));
obj.lLoc = Result.toString(jsonObject.opt("lloc"));
obj.sLoc = Result.toString(jsonObject.opt("sloc"));
obj.largeUrl = Result.toString(jsonObject.opt("large_url"));
obj.smallUrl = Result.toString(jsonObject.opt("small_url"));
obj.width = Result.parseInteger(jsonObject.opt("width"));
obj.height = Result.parseInteger(jsonObject.opt("height"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/RepostList.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class RepostList extends JsonBean {
public RepostList() {}
private RepostList(JSONObject jsonObject) {
super(jsonObject);
}
private Date timestamp;
private Boolean hasNext;
private Integer totalNum;
private List<TweetInfo> tweets;
private Map<String, String> nameNickMap = new HashMap<String, String>();
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Boolean getHasNext() {
return hasNext;
}
public void setHasNext(Boolean hasNext) {
this.hasNext = hasNext;
}
public Integer getTotalNum() {
return totalNum;
}
public void setTotalNum(Integer totalNum) {
this.totalNum = totalNum;
}
public List<TweetInfo> getTweets() {
return tweets;
}
public void setTweets(List<TweetInfo> tweets) {
this.tweets = tweets;
}
public static RepostList parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
RepostList obj = new RepostList(jsonObject);
obj.timestamp = Result.parseTimeSeconds(jsonObject.get("timestamp"));
obj.hasNext = Result.parseBoolean(jsonObject.get("hasnext"));
obj.totalNum = Result.parseInteger(jsonObject.get("totalnum"));
obj.tweets = Result.parse(jsonObject.optJSONArray("info"), TweetInfo.class);
JSONObject map = jsonObject.optJSONObject("user");
if (map != null) {
Iterator<?> keys = map.keys();
while (keys.hasNext()) {
String key = keys.next().toString();
obj.nameNickMap.put(key, map.get(key).toString());
}
}
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Scope.java
================================================
package com.belerweb.social.qq.connect.bean;
/**
* 请求用户授权时向用户显示的可进行授权的列表。
*/
public enum Scope {
/**
* do_like
*/
DO_LIKE("do_like"),
/**
* 获取登录用户的昵称、头像、性别
*/
GET_USER_INFO("get_user_info"),
/**
* 获取登录用户的昵称、头像、性别
*/
GET_SIMPLE_USERINFO("get_simple_userinfo"),
/**
* 获取QQ会员的基本信息
*/
GET_VIP_INFO("get_vip_info"),
/**
* 获取QQ会员的高级信息
*/
GET_VIP_RICH_INFO("get_vip_rich_info"),
/**
* 发表日志到QQ空间
*/
ADD_ONE_BLOG("add_one_blog"),
/**
* 获取用户QQ空间相册列表
*/
LIST_ALBUM("list_album"),
/**
* 上传一张照片到QQ空间相册
*/
UPLOAD_PIC("upload_pic"),
/**
* 在用户的空间相册里,创建一个新的个人相册
*/
ADD_ALBUM("add_album"),
/**
* 获取用户QQ空间相册中的照片列表
*/
LIST_PHOTO("list_photo"),
/**
* 获取登录用户在腾讯微博详细资料
*/
GET_INFO("get_info"),
/**
* 发表一条微博
*/
ADD_T("add_t"),
/**
* 删除一条微博
*/
DEL_T("del_t"),
/**
* 发表一条带图片的微博
*/
ADD_PIC_T("add_pic_t"),
/**
* 获取单条微博的转发或点评列表
*/
GET_REPOST_LIST("get_repost_list"),
/**
* 获取他人微博资料
*/
GET_OTHER_INFO("get_other_info"),
/**
* 我的微博粉丝列表
*/
GET_FANSLIST("get_fanslist"),
/**
* 我的微博偶像列表
*/
GET_IDOLLIST("get_idollist"),
/**
* 收听某个微博用户
*/
ADD_IDOL("add_idol"),
/**
* 取消收听某个微博用户
*/
DEL_IDOL("del_idol"),
/**
* 在这个网站上将展现您财付通登记的收货地址
*/
GET_TENPAY_ADDR("get_tenpay_addr");
private String scope;
private Scope(String scope) {
this.scope = scope;
}
public String value() {
return scope;
}
@Override
public String toString() {
return scope;
}
public static final Scope[] ALL = new Scope[] {Scope.DO_LIKE, Scope.GET_USER_INFO,
Scope.GET_SIMPLE_USERINFO, Scope.GET_VIP_INFO, Scope.GET_VIP_RICH_INFO, Scope.ADD_ONE_BLOG,
Scope.LIST_ALBUM, Scope.UPLOAD_PIC, Scope.ADD_ALBUM, Scope.LIST_PHOTO, Scope.GET_INFO,
Scope.ADD_T, Scope.DEL_T, Scope.ADD_PIC_T, Scope.GET_REPOST_LIST, Scope.GET_OTHER_INFO,
Scope.GET_FANSLIST, Scope.GET_IDOLLIST, Scope.ADD_IDOL, Scope.DEL_IDOL,
Scope.GET_TENPAY_ADDR,};
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/SendPrivate.java
================================================
package com.belerweb.social.qq.connect.bean;
public enum SendPrivate {
IDOL(0), FRIEND(1), PUBLIC(2);
private Integer value;
private SendPrivate(Integer value) {
this.value = value;
}
public Integer value() {
return value;
}
@Override
public String toString() {
return value.toString();
}
public static SendPrivate parse(Integer value) {
if (value == null) {
return null;
}
if (value == 0) {
return IDOL;
}
if (value == 1) {
return FRIEND;
}
if (value == 2) {
return PUBLIC;
}
return null;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Tag.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Tag extends JsonBean {
public Tag() {}
private Tag(JSONObject jsonObject) {
super(jsonObject);
}
private String id;// 个人标签id。
private String name;// 标签名。
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static Tag parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Tag obj = new Tag(jsonObject);
obj.id = Result.toString(jsonObject.get("id"));
obj.name = Result.toString(jsonObject.opt("name"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/TenpayAddress.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
/**
* 财付通收货地址
*/
public class TenpayAddress {
private Integer index;// 收货信息的索引编号
private Integer regionId;// 收货信息的地区编号
private String street;// 收货信息的收货地址
private String zipcode;// 收货信息的邮编
private String mobile;// 收货信息的收货人移动电话
private String tel;// 收货信息的收货人固定电话
private String name;// 收货信息的收货人姓名
private Date created;// 收货信息的创建时间
private Date modified;// 收货信息上一次被修改的时间
private Date lastUsed;// 收货信息上一次被使用的时间
private Integer usedCount;// 收货信息被使用过的次数
private Integer total;// 该用户财付通收货地址的个数
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
public Integer getRegionId() {
return regionId;
}
public void setRegionId(Integer regionId) {
this.regionId = regionId;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public Date getLastUsed() {
return lastUsed;
}
public void setLastUsed(Date lastUsed) {
this.lastUsed = lastUsed;
}
public Integer getUsedCount() {
return usedCount;
}
public void setUsedCount(Integer usedCount) {
this.usedCount = usedCount;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/TweetInfo.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class TweetInfo extends JsonBean {
public TweetInfo() {}
private TweetInfo(JSONObject jsonObject) {
super(jsonObject);
}
private String id;// 微博唯一id。
private String countryCode;// 发表微博时所作的国家代码。
private String provinceCode;// 发表微博时所作的省份代码。
private String cityCode;// 发表微博时所作的城市代码。
private String emotionType;// 心情类型。
private String emotionUrl;// 心情图片url。
private String from;// 来源。
private String fromUrl;// 来源url。
private String image;// 图片url。
private String geo;// 地理位置信息。
private String location;// 发表者所在地。
private Double longitude;// 经度。
private Double latitude;// 纬度。
private Music music;
private String origText;// 微博原始内容。
private Boolean self;// 是否自已发的的微博
private Integer status;// 表示微博的状态。0:正常;1:微博被系统删除;2:审核中;3;微博被用户删除;4:源微博被系统审核删除。
private String text;// 微博内容。
private Date timestamp;// 服务器时间戳,不能用于翻页。
private Integer type;// 表示微博的类型。1:原创发表;2:转播;3:私信;4:回复;5:没有内容的回复;6:提及;7:评论。
private Video video;// 视频信息。
private Integer count;// 转播次数。
private Integer mCount;// 评论数。
private Boolean isVip;// 用户是否为微博认证用户
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getEmotionType() {
return emotionType;
}
public void setEmotionType(String emotionType) {
this.emotionType = emotionType;
}
public String getEmotionUrl() {
return emotionUrl;
}
public void setEmotionUrl(String emotionUrl) {
this.emotionUrl = emotionUrl;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getFromUrl() {
return fromUrl;
}
public void setFromUrl(String fromUrl) {
this.fromUrl = fromUrl;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getGeo() {
return geo;
}
public void setGeo(String geo) {
this.geo = geo;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Music getMusic() {
return music;
}
public void setMusic(Music music) {
this.music = music;
}
public String getOrigText() {
return origText;
}
public void setOrigText(String origText) {
this.origText = origText;
}
public Boolean getSelf() {
return self;
}
public void setSelf(Boolean self) {
this.self = self;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Date getTimestamp() {
return timestamp;
}
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Video getVideo() {
return video;
}
public void setVideo(Video video) {
this.video = video;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getmCount() {
return mCount;
}
public void setmCount(Integer mCount) {
this.mCount = mCount;
}
public Boolean getIsVip() {
return isVip;
}
public void setIsVip(Boolean isVip) {
this.isVip = isVip;
}
public static TweetInfo parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
TweetInfo obj = new TweetInfo(jsonObject);
obj.id = Result.toString(jsonObject.get("id"));
obj.countryCode = Result.toString(jsonObject.opt("country_code"));
obj.provinceCode = Result.toString(jsonObject.opt("province_code"));
obj.cityCode = Result.toString(jsonObject.opt("city_code"));
obj.emotionType = Result.toString(jsonObject.opt("emotiontype"));
obj.emotionUrl = Result.toString(jsonObject.opt("emotionurl"));
obj.from = Result.toString(jsonObject.opt("from"));
obj.fromUrl = Result.toString(jsonObject.opt("fromurl"));
obj.image = Result.toString(jsonObject.opt("image"));
obj.geo = Result.toString(jsonObject.opt("geo"));
obj.location = Result.toString(jsonObject.opt("location"));
obj.longitude = Result.parseDouble(jsonObject.opt("longitude"));
obj.latitude = Result.parseDouble(jsonObject.opt("latitude"));
obj.music = Music.parse(jsonObject.optJSONObject("music"));
obj.origText = Result.toString(jsonObject.opt("origtext"));
obj.self = Result.parseBoolean(jsonObject.opt("self"));
obj.status = Result.parseInteger(jsonObject.opt("status"));
obj.text = Result.toString(jsonObject.opt("text"));
obj.timestamp = Result.parseTimeSeconds(jsonObject.opt("timestamp"));
obj.type = Result.parseInteger(jsonObject.opt("type"));
obj.video = Video.parse(jsonObject.optJSONObject("video"));
obj.count = Result.parseInteger(jsonObject.opt("count"));
obj.mCount = Result.parseInteger(jsonObject.opt("mcount"));
obj.isVip = Result.parseBoolean(jsonObject.opt("isvip"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/User.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.Date;
import org.json.JSONObject;
import com.belerweb.social.bean.Gender;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class User extends JsonBean {
public User() {}
private User(JSONObject jsonObject) {
super(jsonObject);
}
private String nickname;// 用户在QQ空间的昵称。
private String figureUrl;// 大小为30×30像素的QQ空间头像URL。
private String figureUrl1;// 大小为50×50像素的QQ空间头像URL。
private String figureUrl2;// 大小为100×100像素的QQ空间头像URL。
private String figureUrlQQ1;// 大小为40×40像素的QQ头像URL。 40x40像素则是一定会有。
private String figureUrlQQ2;// 大小为100×100像素的QQ头像URL。需要注意,不是所有的用户都拥有QQ的100x100的头像。
private Gender gender;// 性别。 如果获取不到则默认返回"男"
private Boolean isYellowVip;// 标识用户是否为黄钻用户
private Boolean vip;// 标识用户是否为黄钻用户
private Integer yellowVipLevel;// 黄钻等级
private Integer level;// 黄钻等级
private Boolean isYellowYearVip;// 标识是否为年费黄钻用户
private Boolean isQQVip;// 标识是否QQ会员
private Integer qqVipLevel;// QQ会员等级
private Boolean isQQYearVip;// 标识是否为年费QQ会员
private Boolean isLost;
private Date qqVipStart;// QQ会员最后一次充值时间
private Date qqVipEnd;// QQ会员期限
private Integer qqVipPayway;// QQ会员充值方式
private Date qqYearVipStart;// QQ年费会员最后一次充值时间
private Date qqYearVipEnd;// QQ年费会员期限
private Integer qqYearVipPayway;// QQ年费会员充值方式
private Date qqZuanhuangStart;// QQ钻皇最后一次充值时间
private Date qqZuanhuangEnd;// QQ钻皇期限
private Integer qqZuanhuangPayway;// QQ钻皇充值方式
private Date qqHaohuaStart;// 豪华版QQ会员最后一次充值时间
private Date qqHaohuaEnd;// 豪华版QQ会员期限
private Integer qqHaohuaPayway;// 豪华版QQ会员充值方式
private Date qqSvipStart;// QQ SVIP最后一次充值时间,预留字段,当前信息无效
private Date qqSvipEnd;// QQ SVIP期限,预留字段,当前信息无效
private Integer qqSvipPayway;// QQ SVIP充值方式,预留字段,当前信息无效
private Date historyPayTime;// 非会员历史充值时间,仅在用户是非会员时信息有效
private Date historyEndTime;// 非会员历史充值到期时间,仅在用户是非会员时信息有效
/**
* 用户在QQ空间的昵称。
*/
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
/**
* 大小为30×30像素的QQ空间头像URL。
*/
public String getFigureUrl() {
return figureUrl;
}
public void setFigureUrl(String figureUrl) {
this.figureUrl = figureUrl;
}
/**
* 大小为50×50像素的QQ空间头像URL。
*/
public String getFigureUrl1() {
return figureUrl1;
}
public void setFigureUrl1(String figureUrl1) {
this.figureUrl1 = figureUrl1;
}
/**
* 大小为100×100像素的QQ空间头像URL。
*/
public String getFigureUrl2() {
return figureUrl2;
}
public void setFigureUrl2(String figureUrl2) {
this.figureUrl2 = figureUrl2;
}
/**
* 大小为40×40像素的QQ头像URL。 40x40像素则是一定会有。
*/
public String getFigureUrlQQ1() {
return figureUrlQQ1;
}
public void setFigureUrlQQ1(String figureUrlQQ1) {
this.figureUrlQQ1 = figureUrlQQ1;
}
/**
* 大小为100×100像素的QQ头像URL。需要注意,不是所有的用户都拥有QQ的100x100的头像。
*/
public String getFigureUrlQQ2() {
return figureUrlQQ2;
}
public void setFigureUrlQQ2(String figureUrlQQ2) {
this.figureUrlQQ2 = figureUrlQQ2;
}
/**
* 性别。 如果获取不到则默认返回"男"
*/
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
/**
* 标识用户是否为黄钻用户
*/
public Boolean getIsYellowVip() {
return isYellowVip;
}
public void setIsYellowVip(Boolean isYellowVip) {
this.isYellowVip = isYellowVip;
}
/**
* 标识用户是否为黄钻用户
*/
public Boolean getVip() {
return vip;
}
public void setVip(Boolean vip) {
this.vip = vip;
}
/**
* 黄钻等级
*/
public Integer getYellowVipLevel() {
return yellowVipLevel;
}
public void setYellowVipLevel(Integer yellowVipLevel) {
this.yellowVipLevel = yellowVipLevel;
}
/**
* 黄钻等级
*/
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
/**
* 标识是否为年费黄钻用户
*/
public Boolean getIsYellowYearVip() {
return isYellowYearVip;
}
public void setIsYellowYearVip(Boolean isYellowYearVip) {
this.isYellowYearVip = isYellowYearVip;
}
/**
* 标识是否QQ会员
*/
public Boolean getIsQQVip() {
return isQQVip;
}
public void setIsQQVip(Boolean isQQVip) {
this.isQQVip = isQQVip;
}
/**
* QQ会员等级
*/
public Integer getQqVipLevel() {
return qqVipLevel;
}
public void setQqVipLevel(Integer qqVipLevel) {
this.qqVipLevel = qqVipLevel;
}
/**
* 是否是QQ年费会员
*/
public Boolean getIsQQYearVip() {
return isQQYearVip;
}
public void setIsQQYearVip(Boolean isQQYearVip) {
this.isQQYearVip = isQQYearVip;
}
public Boolean getIsLost() {
return isLost;
}
public void setIsLost(Boolean isLost) {
this.isLost = isLost;
}
/**
* QQ会员最后一次充值时间
*/
public Date getQqVipStart() {
return qqVipStart;
}
public void setQqVipStart(Date qqVipStart) {
this.qqVipStart = qqVipStart;
}
/**
* QQ会员期限
*/
public Date getQqVipEnd() {
return qqVipEnd;
}
public void setQqVipEnd(Date qqVipEnd) {
this.qqVipEnd = qqVipEnd;
}
/**
* QQ会员充值方式
*/
public Integer getQqVipPayway() {
return qqVipPayway;
}
public void setQqVipPayway(Integer qqVipPayway) {
this.qqVipPayway = qqVipPayway;
}
/**
* QQ年费会员最后一次充值时间
*/
public Date getQqYearVipStart() {
return qqYearVipStart;
}
public void setQqYearVipStart(Date qqYearVipStart) {
this.qqYearVipStart = qqYearVipStart;
}
/**
* QQ年费会员期限
*/
public Date getQqYearVipEnd() {
return qqYearVipEnd;
}
public void setQqYearVipEnd(Date qqYearVipEnd) {
this.qqYearVipEnd = qqYearVipEnd;
}
/**
* QQ年费会员充值方式
*/
public Integer getQqYearVipPayway() {
return qqYearVipPayway;
}
public void setQqYearVipPayway(Integer qqYearVipPayway) {
this.qqYearVipPayway = qqYearVipPayway;
}
/**
* QQ钻皇最后一次充值时间
*/
public Date getQqZuanhuangStart() {
return qqZuanhuangStart;
}
public void setQqZuanhuangStart(Date qqZuanhuangStart) {
this.qqZuanhuangStart = qqZuanhuangStart;
}
/**
* QQ钻皇期限
*/
public Date getQqZuanhuangEnd() {
return qqZuanhuangEnd;
}
public void setQqZuanhuangEnd(Date qqZuanhuangEnd) {
this.qqZuanhuangEnd = qqZuanhuangEnd;
}
/**
* QQ钻皇充值方式
*/
public Integer getQqZuanhuangPayway() {
return qqZuanhuangPayway;
}
public void setQqZuanhuangPayway(Integer qqZuanhuangPayway) {
this.qqZuanhuangPayway = qqZuanhuangPayway;
}
/**
* 豪华版QQ会员最后一次充值时间
*/
public Date getQqHaohuaStart() {
return qqHaohuaStart;
}
public void setQqHaohuaStart(Date qqHaohuaStart) {
this.qqHaohuaStart = qqHaohuaStart;
}
/**
* 豪华版QQ会员期限
*/
public Date getQqHaohuaEnd() {
return qqHaohuaEnd;
}
public void setQqHaohuaEnd(Date qqHaohuaEnd) {
this.qqHaohuaEnd = qqHaohuaEnd;
}
/**
* 豪华版QQ会员充值方式
*/
public Integer getQqHaohuaPayway() {
return qqHaohuaPayway;
}
public void setQqHaohuaPayway(Integer qqHaohuaPayway) {
this.qqHaohuaPayway = qqHaohuaPayway;
}
/**
* QQ SVIP最后一次充值时间,预留字段,当前信息无效
*/
public Date getQqSvipStart() {
return qqSvipStart;
}
public void setQqSvipStart(Date qqSvipStart) {
this.qqSvipStart = qqSvipStart;
}
/**
* QQ SVIP期限,预留字段,当前信息无效
*/
public Date getQqSvipEnd() {
return qqSvipEnd;
}
public void setQqSvipEnd(Date qqSvipEnd) {
this.qqSvipEnd = qqSvipEnd;
}
/**
* QQ SVIP充值方式,预留字段,当前信息无效
*/
public Integer getQqSvipPayway() {
return qqSvipPayway;
}
public void setQqSvipPayway(Integer qqSvipPayway) {
this.qqSvipPayway = qqSvipPayway;
}
/**
* 非会员历史充值时间,仅在用户是非会员时信息有效
*/
public Date getHistoryPayTime() {
return historyPayTime;
}
public void setHistoryPayTime(Date historyPayTime) {
this.historyPayTime = historyPayTime;
}
/**
* 非会员历史充值到期时间,仅在用户是非会员时信息有效
*/
public Date getHistoryEndTime() {
return historyEndTime;
}
public void setHistoryEndTime(Date historyEndTime) {
this.historyEndTime = historyEndTime;
}
public static User parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
User obj = new User(jsonObject);
obj.nickname = Result.toString(jsonObject.opt("nickname"));
obj.figureUrl = Result.toString(jsonObject.opt("figureurl"));
obj.figureUrl1 = Result.toString(jsonObject.opt("figureurl_1"));
obj.figureUrl2 = Result.toString(jsonObject.opt("figureurl_2"));
obj.figureUrlQQ1 = Result.toString(jsonObject.opt("figureurl_qq_1"));
obj.figureUrlQQ2 = Result.toString(jsonObject.opt("figureurl_qq_2"));
obj.gender = Gender.parse(jsonObject.optString("gender", null));
obj.isYellowVip = Result.parseBoolean(jsonObject.opt("is_yellow_vip"));
obj.vip = Result.parseBoolean(jsonObject.opt("vip"));
obj.yellowVipLevel = Result.parseInteger(jsonObject.opt("yellow_vip_level"));
obj.level = Result.parseInteger(jsonObject.opt("level"));
obj.isYellowYearVip = Result.parseBoolean(jsonObject.opt("is_yellow_year_vip"));
obj.isQQVip = Result.parseBoolean(jsonObject.opt("is_qq_vip"));
obj.qqVipLevel = Result.parseInteger(jsonObject.opt("qq_vip_level"));
obj.isQQYearVip = Result.parseBoolean(jsonObject.opt("is_qq_year_vip"));
obj.isLost = Result.parseBoolean(jsonObject.opt("is_lost"));
obj.qqVipStart = Result.parseTimeSeconds(jsonObject.opt("qq_vip_start"));
obj.qqVipEnd = Result.parseTimeSeconds(jsonObject.opt("qq_vip_end"));
obj.qqVipPayway = Result.parseInteger(jsonObject.opt("qq_vip_payway"));
obj.qqYearVipStart = Result.parseTimeSeconds(jsonObject.opt("qq_year_vip_start"));
obj.qqYearVipEnd = Result.parseTimeSeconds(jsonObject.opt("qq_year_vip_end"));
obj.qqYearVipPayway = Result.parseInteger(jsonObject.opt("qq_year_vip_payway"));
obj.qqZuanhuangStart = Result.parseTimeSeconds(jsonObject.opt("qq_zuanhuang_start"));
obj.qqZuanhuangEnd = Result.parseTimeSeconds(jsonObject.opt("qq_zuanhuang_end"));
obj.qqZuanhuangPayway = Result.parseInteger(jsonObject.opt("qq_zuanhuang_payway"));
obj.qqHaohuaStart = Result.parseTimeSeconds(jsonObject.opt("qq_haohua_start"));
obj.qqHaohuaEnd = Result.parseTimeSeconds(jsonObject.opt("qq_haohua_end"));
obj.qqHaohuaPayway = Result.parseInteger(jsonObject.opt("qq_haohua_payway"));
obj.qqSvipStart = Result.parseTimeSeconds(jsonObject.opt("qq_svip_start"));
obj.qqSvipEnd = Result.parseTimeSeconds(jsonObject.opt("qq_svip_end"));
obj.qqSvipPayway = Result.parseInteger(jsonObject.opt("qq_svip_payway"));
obj.historyPayTime = Result.parseTimeSeconds(jsonObject.opt("history_pay_time"));
obj.historyEndTime = Result.parseTimeSeconds(jsonObject.opt("history_end_time"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Video.java
================================================
package com.belerweb.social.qq.connect.bean;
import org.json.JSONObject;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class Video extends JsonBean {
public Video() {}
private Video(JSONObject jsonObject) {
super(jsonObject);
}
private String picUrl;// 缩略图。
private String player;// 播放器地址。
private String realUrl;// 视频原地址。
private String shortUrl;// 视频的短url。
private String title;// 视频标题。
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getPlayer() {
return player;
}
public void setPlayer(String player) {
this.player = player;
}
public String getRealUrl() {
return realUrl;
}
public void setRealUrl(String realUrl) {
this.realUrl = realUrl;
}
public String getShortUrl() {
return shortUrl;
}
public void setShortUrl(String shortUrl) {
this.shortUrl = shortUrl;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public static Video parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
Video obj = new Video(jsonObject);
obj.picUrl = Result.toString(jsonObject.opt("picurl"));
obj.player = Result.toString(jsonObject.opt("player"));
obj.realUrl = Result.toString(jsonObject.opt("realurl"));
obj.shortUrl = Result.toString(jsonObject.opt("shorturl"));
obj.title = Result.toString(jsonObject.opt("title"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/connect/bean/WeiboUser.java
================================================
package com.belerweb.social.qq.connect.bean;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONObject;
import com.belerweb.social.bean.Gender;
import com.belerweb.social.bean.JsonBean;
import com.belerweb.social.bean.Result;
public class WeiboUser extends JsonBean {
public WeiboUser() {}
private WeiboUser(JSONObject jsonObject) {
super(jsonObject);
}
private String openId;// 登录用户的唯一ID,与name一一对应。
private String name;// 登录用户的帐号名
private String nick;// 登录用户昵称。
private Date regTime;// 登录注册时间。
private Date birth;
private String countryCode;
private String provinceCode;
private String cityCode;
private List<Company> companies;
private List<Education> educations;
private Integer fansNum;// 登录用户听众数。
private Integer favNum;// 登录用户收藏数。
private String head;
private String homeCountryCode;// 登录用户家乡所在国家代码。
private String homeProvinceCode;// 登录用户家乡所在省份代码。
private String homeCityCode;// 登录用户家乡所在城市代码。
private String hometownCode;// 登录用户家乡所在城镇代码。
private String homepage;// 个人主页。
private Integer idolNum;// 登录用户收听的人数。
private String industryCode;// 行业ID。
private String introduction;// 登录用户的个人介绍。
private Boolean isEnt;// 登录用户是否为企业机构
private Boolean isMyBlack;// 是否在当前用户的黑名单中
private Boolean isMyFans;// 是否是当前用户的听众
private Boolean isMyIdol;// 是否是当前用户的偶像
private Boolean isRealName;// 登录用户是否实名认证
private Boolean isVip;// 登录用户是否为微博认证用户
private String location;// 登录用户所在地。
private Integer mutualFansNum;// 登录用户的互听好友数
private SendPrivate sendPrivate;// 是否允许所有人给当前用户发私信。
private Gender gender;
private List<Tag> tags;
private List<TweetInfo> tweets;
private Integer tweetNum;
private String verifyInfo;
private Integer exp;
private Integer level;
private String seqId;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regTime) {
this.regTime = regTime;
}
public Date getBirth() {
return birth;
}
public void setBirth(Date birth) {
this.birth = birth;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public List<Company> getCompanies() {
return companies;
}
public void setCompanies(List<Company> companies) {
this.companies = companies;
}
public List<Education> getEducations() {
return educations;
}
public void setEducations(List<Education> educations) {
this.educations = educations;
}
public Integer getFansNum() {
return fansNum;
}
public void setFansNum(Integer fansNum) {
this.fansNum = fansNum;
}
public Integer getFavNum() {
return favNum;
}
public void setFavNum(Integer favNum) {
this.favNum = favNum;
}
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
public String getHomeCountryCode() {
return homeCountryCode;
}
public void setHomeCountryCode(String homeCountryCode) {
this.homeCountryCode = homeCountryCode;
}
public String getHomeProvinceCode() {
return homeProvinceCode;
}
public void setHomeProvinceCode(String homeProvinceCode) {
this.homeProvinceCode = homeProvinceCode;
}
public String getHomeCityCode() {
return homeCityCode;
}
public void setHomeCityCode(String homeCityCode) {
this.homeCityCode = homeCityCode;
}
public String getHometownCode() {
return hometownCode;
}
public void setHometownCode(String hometownCode) {
this.hometownCode = hometownCode;
}
public String getHomepage() {
return homepage;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
public Integer getIdolNum() {
return idolNum;
}
public void setIdolNum(Integer idolNum) {
this.idolNum = idolNum;
}
public String getIndustryCode() {
return industryCode;
}
public void setIndustryCode(String industryCode) {
this.industryCode = industryCode;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public Boolean getIsEnt() {
return isEnt;
}
public void setIsEnt(Boolean isEnt) {
this.isEnt = isEnt;
}
public Boolean getIsMyBlack() {
return isMyBlack;
}
public void setIsMyBlack(Boolean isMyBlack) {
this.isMyBlack = isMyBlack;
}
public Boolean getIsMyFans() {
return isMyFans;
}
public void setIsMyFans(Boolean isMyFans) {
this.isMyFans = isMyFans;
}
public Boolean getIsMyIdol() {
return isMyIdol;
}
public void setIsMyIdol(Boolean isMyIdol) {
this.isMyIdol = isMyIdol;
}
public Boolean getIsRealName() {
return isRealName;
}
public void setIsRealName(Boolean isRealName) {
this.isRealName = isRealName;
}
public Boolean getIsVip() {
return isVip;
}
public void setIsVip(Boolean isVip) {
this.isVip = isVip;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Integer getMutualFansNum() {
return mutualFansNum;
}
public void setMutualFansNum(Integer mutualFansNum) {
this.mutualFansNum = mutualFansNum;
}
public SendPrivate getSendPrivate() {
return sendPrivate;
}
public void setSendPrivate(SendPrivate sendPrivate) {
this.sendPrivate = sendPrivate;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public List<TweetInfo> getTweets() {
return tweets;
}
public void setTweets(List<TweetInfo> tweets) {
this.tweets = tweets;
}
public Integer getTweetNum() {
return tweetNum;
}
public void setTweetNum(Integer tweetNum) {
this.tweetNum = tweetNum;
}
public String getVerifyInfo() {
return verifyInfo;
}
public void setVerifyInfo(String verifyInfo) {
this.verifyInfo = verifyInfo;
}
public Integer getExp() {
return exp;
}
public void setExp(Integer exp) {
this.exp = exp;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getSeqId() {
return seqId;
}
public void setSeqId(String seqId) {
this.seqId = seqId;
}
public static WeiboUser parse(JSONObject jsonObject) {
if (jsonObject == null) {
return null;
}
WeiboUser obj = new WeiboUser(jsonObject);
obj.openId = Result.toString(jsonObject.get("openid"));
obj.name = Result.toString(jsonObject.opt("name"));
obj.nick = Result.toString(jsonObject.opt("nick"));
obj.regTime = Result.parseTimeSeconds(jsonObject.opt("regtime"));
Object year = jsonObject.get("birth_year");
Object month = jsonObject.get("birth_month");
Object day = jsonObject.get("birth_day");
obj.birth =
Result.parseDate(year.toString() + month.toString() + day.toString(), "yyyy-MM-dd",
Locale.CHINA);
obj.countryCode = Result.toString(jsonObject.opt("country_code"));
obj.provinceCode = Result.toString(jsonObject.opt("province_code"));
obj.cityCode = Result.toString(jsonObject.opt("city_code"));
JSONArray jsonArray = jsonObject.optJSONArray("comp");
if (jsonArray != null) {
List<Company> companies = new ArrayList<Company>();
for (int i = 0; i < jsonArray.length(); i++) {
companies.add(Company.parse(jsonArray.optJSONObject(i)));
}
obj.companies = companies;
}
jsonArray = jsonObject.optJSONArray("edu");
if (jsonArray != null) {
List<Education> educations = new ArrayList<Education>();
for (int i = 0; i < jsonArray.length(); i++) {
educations.add(Education.parse(jsonArray.optJSONObject(i)));
}
obj.educations = educations;
}
obj.fansNum = Result.parseInteger(jsonObject.opt("fansnum"));
obj.favNum = Result.parseInteger(jsonObject.opt("favnum"));
obj.head = Result.toString(jsonObject.opt("head"));
obj.homeCountryCode = Result.toString(jsonObject.opt("homecountry_code"));
obj.homeProvinceCode = Result.toString(jsonObject.opt("homeprovince_code"));
obj.homeCityCode = Result.toString(jsonObject.opt("homecity_code"));
obj.hometownCode = Result.toString(jsonObject.opt("hometown_code"));
obj.homepage = Result.toString(jsonObject.opt("homepage"));
obj.idolNum = Result.parseInteger(jsonObject.opt("idolnum"));
obj.industryCode = Result.toString(jsonObject.opt("industry_code"));
obj.introduction = Result.toString(jsonObject.opt("introduction"));
obj.isEnt = Result.parseBoolean(jsonObject.opt("isent"));
obj.isMyBlack = Result.parseBoolean(jsonObject.opt("ismyblack"));
obj.isMyFans = Result.parseBoolean(jsonObject.opt("ismyfans"));
obj.isMyIdol = Result.parseBoolean(jsonObject.opt("isMyIdol"));
obj.isRealName = Result.parseBoolean(jsonObject.opt("isrealname"));
obj.isVip = Result.parseBoolean(jsonObject.opt("isvip"));
obj.location = Result.toString(jsonObject.opt("location"));
obj.mutualFansNum = Result.parseInteger(jsonObject.opt("mutual_fans_num"));
obj.sendPrivate = SendPrivate.parse(Result.parseInteger(jsonObject.opt("send_private_flag")));
obj.gender = Gender.parse(Result.parseInteger(jsonObject.opt("sex")));
jsonArray = jsonObject.optJSONArray("tag");
if (jsonArray != null) {
List<Tag> tags = new ArrayList<Tag>();
for (int i = 0; i < jsonArray.length(); i++) {
tags.add(Tag.parse(jsonArray.optJSONObject(i)));
}
obj.tags = tags;
}
jsonArray = jsonObject.optJSONArray("tweetinfo");
if (jsonArray == null) {
jsonArray = jsonObject.optJSONArray("tweet");
}
if (jsonArray != null) {
List<TweetInfo> tweets = new ArrayList<TweetInfo>();
for (int i = 0; i < jsonArray.length(); i++) {
tweets.add(TweetInfo.parse(jsonArray.optJSONObject(i)));
}
obj.tweets = tweets;
}
obj.tweetNum = Result.parseInteger(jsonObject.opt("tweetnum"));
obj.verifyInfo = Result.toString(jsonObject.opt("verifyinfo"));
obj.exp = Result.parseInteger(jsonObject.opt("exp"));
obj.level = Result.parseInteger(jsonObject.opt("level"));
obj.seqId = Result.toString(jsonObject.opt("seqid"));
return obj;
}
}
================================================
FILE: src/main/java/com/belerweb/social/qq/mail/api/Contact.java
================================================
package com.belerweb.social.qq.mail.api;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicNameValuePair;
import org.jsoup.Jsoup;
import org.jsoup.nodes.DataNode;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.belerweb.social.captcha.api.Yundama;
import com.belerweb.social.captcha.bean.YundamaType;
import com.belerweb.social.exception.SocialException;
import com.belerweb.social.http.Http;
import com.belerweb.social.qq.mail.bean.Group;
import com.belerweb.social.qq.mail.bean.User;
import com.belerweb.social.qq.mail.bean.ValidationCode;
/**
* 获取QQ邮箱联系人
*/
public class Contact {
private static final Pattern PATTERN = Pattern.compile("sid=([0-9a-zA-Z-_]+)[&\"]");
private HttpClient http;
private String email;
private String password;
private Yundama yundama;
private String sid;
/**
* 创建一个QQ邮箱联系人API
*
* @param email QQ邮箱地址
* @param password QQ邮箱密码
*/
public Contact(String email, String password, Yundama yundama) {
this.email = email;
this.password = password;
this.yundama = yundama;
http = Http.newClient();
}
private List<Group> get(Group group) throws SocialException {
HttpGet request =
new HttpGet("http://mail.qq.com/cgi-bin/laddr_list?sid=" + sid
+ "&operate=view&t=contact&view=" + group.getType()
+ (group.getId() != null ? ("&groupid=" + group.getId()) : "&loc=frame_html,,,23"));
request.addHeader(new BasicHeader("Referer",
"http://mail.qq.com/cgi-bin/laddr_list?operate=view&t=contact&view=normal&loc=frame_html,,,23&sid="
+ sid));
request.addHeader(new BasicHeader("Accept-Language", "zh-cn,zh"));
request
.addHeader(new BasicHeader("Referer", "http://mail.qq.com/cgi-bin/frame_html?sid=" + sid));
try {
HttpResponse response = http.execute(request);
StatusLine statusLine = response.getStatusLine();
if (statusLine == null || statusLine.getStatusCode() != HttpStatus.SC_OK
|| response.getEntity() == null) {
throw new SocialException(String.valueOf(statusLine));
}
String result = IOUtils.toString(response.getEntity().getContent(), "GB18030");
request.releaseConnection();
List<Group> groups = null;
Document doc = Jsoup.parse(result);
Elements scripts = doc.select("script");
for (Element el : scripts) {
for (DataNode node : el.dataNodes()) {
String script = node.getWholeData().trim();
if (script.startsWith("var goListData")) {
ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
List<User> users = new ArrayList<User>();
Bindings bindings = engine.createBindings();
bindings.put("users", users);
script =
script
+ "(function(){for(var i in goListData.oList){var o=goListData.oList[i];var u=new com.belerweb.social.qq.mail.bean.User();u.setId(o.sId);u.setType(o.sItemType);u.setLevel(o.sLevel);u.setName(o.oName.length?o.oName[0].sVal:'');u.setFamilyName((o.oFamilyName&&o.oFamilyName.length)?o.oFamilyName[0].sVal:'');u.setGivenName((o.oGivenName&&o.oGivenName.length)?o.oGivenName[0].sVal:'');u.setCustom((o.oCustom&&o.oCustom.length)?o.oCustom[0].sVal:'');u.setNickName((o.oQQNickName&&o.oQQNickName.length)?o.oQQNickName[0].sVal:'');u.setRelate((o.oRelate&&o.oRelate.length)?o.oRelate[0].sVal:'');u.setUrl((o.oUrl&&o.oUrl.length)?o.oUrl[0].sVal:'');u.setDate((o.oDate&&o.oDate.length)?o.oDate[0].sVal:'');u.setBirthday((o.oBirthday&&o.oBirthday.length)?o.oBirthday[0].sVal:'');u.setIm((o.oIM&&o.oIM.length)?o.oIM[0].sVal:'');u.setNote((o.oNote&&o.oNote.length)?o.oNote[0].sVal:'');var es=new java.util.ArrayList();for(var j in o.oEmail){var obj=o.oEmail[j];var e=new com.belerweb.social.qq.mail.bean.Email();e.setEmail(obj.sVal);e.setLabel(obj.sLabel?obj.sLabel:'');e.setType(obj.sType?obj.sType:'');es.add(e)}u.setEmails(es);var ts=new java.util.ArrayList();for(var j in o.oTel){var obj=o.oTel[j];var t=new com.belerweb.social.qq.mail.bean.Tel();t.setNum(obj.sVal);t.setLabel(obj.sLabel?obj.sLabel:'');t.setType(obj.sType?obj.sType:'');ts.add(t)}u.setTels(ts);if(o.oOrg&&o.oOrg.length){var org=new com.belerweb.social.qq.mail.bean.Org();org.setOrg1(o.oOrg[0].sOrg1);org.setOrg2(o.oOrg[0].sOrg2);org.setTitle(o.oOrg[0].sTitle);u.setOrg(org)}if(o.oAdr&&o.oAdr.length){var adr=new com.belerweb.social.qq.mail.bean.Address();adr.setLabel(o.oAdr[0].sLabel);adr.setType(o.oAdr[0].sType);adr.setCountry(o.oAdr[0].sCountry);adr.setProvince(o.oAdr[0].sProvince);adr.setCity(o.oAdr[0].sCity);adr.setStreet(o.oAdr[0].sStreet);adr.setPostcode(o.oAdr[0].sPostcode);u.setAddress(adr)}users.add(u)}})();";
if (group.getId() == null) {
groups = new ArrayList<Group>();
bindings.put("groups", groups);
script =
script
gitextract_ctatj41d/
├── .gitignore
├── README.md
├── eclipse-java-google-style.xml
├── pom.xml
└── src/
├── main/
│ └── java/
│ └── com/
│ └── belerweb/
│ └── social/
│ ├── API.java
│ ├── SDK.java
│ ├── bean/
│ │ ├── Error.java
│ │ ├── Gender.java
│ │ ├── JsonBean.java
│ │ ├── OnlineStatus.java
│ │ └── Result.java
│ ├── captcha/
│ │ ├── api/
│ │ │ └── Yundama.java
│ │ └── bean/
│ │ └── YundamaType.java
│ ├── exception/
│ │ └── SocialException.java
│ ├── http/
│ │ ├── Http.java
│ │ └── HttpException.java
│ ├── mail/
│ │ └── api/
│ │ └── POP3.java
│ ├── qq/
│ │ ├── connect/
│ │ │ ├── api/
│ │ │ │ ├── OAuth2.java
│ │ │ │ ├── QQConnect.java
│ │ │ │ ├── QZone.java
│ │ │ │ ├── User.java
│ │ │ │ └── Weibo.java
│ │ │ └── bean/
│ │ │ ├── AccessToken.java
│ │ │ ├── Album.java
│ │ │ ├── AlbumPrivilege.java
│ │ │ ├── Company.java
│ │ │ ├── Display.java
│ │ │ ├── Education.java
│ │ │ ├── FanList.java
│ │ │ ├── Gut.java
│ │ │ ├── IdolList.java
│ │ │ ├── Image.java
│ │ │ ├── Music.java
│ │ │ ├── NewT.java
│ │ │ ├── OpenID.java
│ │ │ ├── Photo.java
│ │ │ ├── PicUploadResult.java
│ │ │ ├── RepostList.java
│ │ │ ├── Scope.java
│ │ │ ├── SendPrivate.java
│ │ │ ├── Tag.java
│ │ │ ├── TenpayAddress.java
│ │ │ ├── TweetInfo.java
│ │ │ ├── User.java
│ │ │ ├── Video.java
│ │ │ └── WeiboUser.java
│ │ ├── mail/
│ │ │ ├── api/
│ │ │ │ └── Contact.java
│ │ │ └── bean/
│ │ │ ├── Address.java
│ │ │ ├── Email.java
│ │ │ ├── Group.java
│ │ │ ├── Org.java
│ │ │ ├── Tel.java
│ │ │ ├── User.java
│ │ │ └── ValidationCode.java
│ │ ├── qzone/
│ │ │ └── api/
│ │ │ └── Visitor.java
│ │ └── t/
│ │ └── api/
│ │ ├── OAuth2.java
│ │ └── QQT.java
│ ├── weibo/
│ │ ├── api/
│ │ │ ├── OAuth2.java
│ │ │ ├── User.java
│ │ │ └── Weibo.java
│ │ └── bean/
│ │ ├── AccessToken.java
│ │ ├── Comment.java
│ │ ├── Display.java
│ │ ├── Geo.java
│ │ ├── Privacy.java
│ │ ├── Remind.java
│ │ ├── Scope.java
│ │ ├── Status.java
│ │ ├── TokenInfo.java
│ │ ├── UrlShort.java
│ │ ├── User.java
│ │ ├── UserCounts.java
│ │ └── Visible.java
│ └── weixin/
│ ├── api/
│ │ ├── Group.java
│ │ ├── Media.java
│ │ ├── Menu.java
│ │ ├── OAuth2.java
│ │ ├── User.java
│ │ └── Weixin.java
│ └── bean/
│ ├── AccessToken.java
│ ├── ApiTicket.java
│ ├── Article.java
│ ├── EventType.java
│ ├── GetFollowersResult.java
│ ├── Group.java
│ ├── JSApiTicket.java
│ ├── Media.java
│ ├── MediaType.java
│ ├── Menu.java
│ ├── MenuType.java
│ ├── Message.java
│ ├── MsgType.java
│ ├── QRCreation.java
│ ├── QRTicket.java
│ ├── QRType.java
│ ├── Scope.java
│ ├── User.java
│ ├── Variable.java
│ └── VoiceType.java
└── test/
├── java/
│ └── com/
│ └── belerweb/
│ └── social/
│ ├── SDKTest.java
│ ├── TestConfig.java
│ ├── captcha/
│ │ └── api/
│ │ └── YundamaTest.java
│ ├── mail/
│ │ └── api/
│ │ └── POP3Test.java
│ ├── qq/
│ │ └── connect/
│ │ └── api/
│ │ ├── OAuth2Test.java
│ │ └── UserTest.java
│ ├── weibo/
│ │ └── api/
│ │ ├── OAuth2Test.java
│ │ └── UserTest.java
│ └── weixin/
│ └── api/
│ ├── GroupTest.java
│ ├── MediaTest.java
│ ├── MenuTest.java
│ ├── OAuth2Test.java
│ ├── UserTest.java
│ └── WeixinTest.java
└── resources/
└── logback.xml
SYMBOL INDEX (1424 symbols across 109 files)
FILE: src/main/java/com/belerweb/social/API.java
class API (line 9) | public abstract class API {
method API (line 16) | protected API(Weibo weibo) {
method API (line 20) | protected API(Weixin weixin) {
method API (line 24) | protected API(QQConnect connect) {
method API (line 28) | protected API(QQT t) {
FILE: src/main/java/com/belerweb/social/SDK.java
class SDK (line 20) | public abstract class SDK {
method SDK (line 24) | public SDK() {
method SDK (line 28) | public SDK(Charset defaultCharset) {
method get (line 32) | public String get(String url, List<NameValuePair> params) {
method get (line 41) | public String get(String url) {
method post (line 45) | public String post(String url, HttpEntity postBody) {
method post (line 54) | public String post(String url, List<NameValuePair> params) {
method post (line 63) | public String post(String url) {
method addParameter (line 67) | public void addParameter(List<NameValuePair> params, String name, Obje...
method addNotNullParameter (line 74) | public void addNotNullParameter(List<NameValuePair> params, String nam...
method addTrueParameter (line 80) | public void addTrueParameter(List<NameValuePair> params, String name, ...
method lonLatToAddress (line 92) | public Result<String> lonLatToAddress(Double lon, Double lat) {
FILE: src/main/java/com/belerweb/social/bean/Error.java
class Error (line 5) | public final class Error extends JsonBean {
method Error (line 11) | public Error() {}
method Error (line 13) | public Error(String code, String message) {
method Error (line 18) | private Error(JSONObject jsonObject) {
method getRequest (line 22) | public String getRequest() {
method setRequest (line 26) | public void setRequest(String request) {
method getErrorCode (line 30) | public String getErrorCode() {
method setErrorCode (line 34) | public void setErrorCode(String errorCode) {
method getError (line 38) | public String getError() {
method setError (line 42) | public void setError(String error) {
method toString (line 46) | @Override
method parse (line 51) | public static Error parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/bean/Gender.java
type Gender (line 3) | public enum Gender {
method Gender (line 12) | private Gender(int intValue, String code, String zhValue, String enVal...
method value (line 19) | public int value() {
method code (line 23) | public String code() {
method text (line 27) | public String text() {
method enText (line 31) | public String enText() {
method toString (line 35) | @Override
method parse (line 40) | public static Gender parse(Integer val) {
method parse (line 54) | public static Gender parse(String val) {
FILE: src/main/java/com/belerweb/social/bean/JsonBean.java
class JsonBean (line 5) | public abstract class JsonBean {
method JsonBean (line 9) | protected JsonBean() {}
method JsonBean (line 11) | protected JsonBean(JSONObject jsonObject) {
method getJsonObject (line 15) | public JSONObject getJsonObject() {
FILE: src/main/java/com/belerweb/social/bean/OnlineStatus.java
type OnlineStatus (line 3) | public enum OnlineStatus {
method OnlineStatus (line 11) | private OnlineStatus(int status, String text, String enText) {
method online (line 17) | public boolean online() {
method status (line 21) | public int status() {
method text (line 25) | public String text() {
method enText (line 29) | public String enText() {
method toString (line 33) | @Override
method parse (line 38) | public static OnlineStatus parse(Integer val) {
method parse (line 48) | public static OnlineStatus parse(String val) {
FILE: src/main/java/com/belerweb/social/bean/Result.java
class Result (line 16) | public class Result<T> {
method Result (line 22) | public Result(Error error) {
method Result (line 26) | public Result(T result) {
method Result (line 30) | public Result(List<T> results) {
method success (line 34) | public boolean success() {
method getError (line 38) | public Error getError() {
method getResult (line 42) | public T getResult() {
method getResults (line 46) | public List<T> getResults() {
method parse (line 50) | public static <T> Result<T> parse(String json, Class<T> resultType) {
method parse (line 62) | @SuppressWarnings("unchecked")
method parse (line 77) | @SuppressWarnings("unchecked")
method toString (line 104) | public static String toString(Object obj) {
method parseLong (line 112) | public static Long parseLong(Object obj) {
method parseInteger (line 127) | public static Integer parseInteger(Object obj) {
method parseDouble (line 142) | public static Double parseDouble(Object obj) {
method parseBoolean (line 157) | public static Boolean parseBoolean(Object obj) {
method parseDate (line 174) | public static Date parseDate(Object obj, String pattern, Locale locale) {
method parseTimeSeconds (line 194) | public static Date parseTimeSeconds(Object obj) {
FILE: src/main/java/com/belerweb/social/captcha/api/Yundama.java
class Yundama (line 20) | public class Yundama {
method Yundama (line 27) | public Yundama(String username, String password) {
method decode (line 32) | public Result<String> decode(byte[] img, YundamaType type) {
FILE: src/main/java/com/belerweb/social/captcha/bean/YundamaType.java
type YundamaType (line 4) | public enum YundamaType {
method YundamaType (line 120) | YundamaType(Integer type) {
method getType (line 124) | public Integer getType() {
FILE: src/main/java/com/belerweb/social/exception/SocialException.java
class SocialException (line 3) | public class SocialException extends RuntimeException {
method SocialException (line 7) | public SocialException(Exception exception) {
method SocialException (line 11) | public SocialException(String message) {
FILE: src/main/java/com/belerweb/social/http/Http.java
class Http (line 33) | public final class Http {
method getDefaultCharset (line 77) | private static Charset getDefaultCharset() {
method setDefaultCharset (line 89) | public static void setDefaultCharset(Charset charset) {
method get (line 93) | public static String get(String uri, List<NameValuePair> params) throw...
method get (line 107) | public static String get(String uri, Header... headers) throws HttpExc...
method post (line 117) | public static String post(String uri, HttpEntity postBody, Header... h...
method post (line 132) | public static String post(String uri, List<NameValuePair> params, Stri...
method post (line 154) | public static String post(String uri) throws HttpException {
method execute (line 158) | private static String execute(HttpRequestBase request) throws HttpExce...
method isRequestSuccess (line 176) | public static boolean isRequestSuccess(HttpResponse response) throws H...
method responseToString (line 181) | public static String responseToString(HttpResponse response) throws Ht...
method randomAgent (line 209) | public static String randomAgent() {
method newClient (line 213) | public static HttpClient newClient() {
FILE: src/main/java/com/belerweb/social/http/HttpException.java
class HttpException (line 5) | public class HttpException extends Exception {
method HttpException (line 9) | public HttpException(Exception exception) {
method HttpException (line 13) | public HttpException(String message) {
FILE: src/main/java/com/belerweb/social/mail/api/POP3.java
class POP3 (line 22) | public class POP3 {
method POP3 (line 33) | public POP3(String username, String password, String host) {
method POP3 (line 37) | public POP3(String username, String password, String host, int port, b...
method login (line 50) | private boolean login() throws SocketException, IOException {
method test (line 58) | public boolean test() throws SocialException {
method download (line 79) | public void download(File dir) throws SocialException {
method download (line 136) | public void download(String dir) {
FILE: src/main/java/com/belerweb/social/qq/connect/api/OAuth2.java
class OAuth2 (line 18) | public final class OAuth2 extends API {
method OAuth2 (line 20) | OAuth2(QQConnect connect) {
method authorize (line 29) | public String authorize() {
method authorize (line 39) | public String authorize(String redirectUri) {
method authorize (line 51) | public String authorize(Boolean wap) {
method authorize (line 63) | public String authorize(String redirectUri, Boolean wap) {
method authorize (line 82) | public String authorize(String clientId, String redirectUri, String re...
method accessToken (line 113) | public Result<AccessToken> accessToken(String code) {
method accessToken (line 124) | public Result<AccessToken> accessToken(String code, String redirectUri) {
method accessToken (line 135) | public Result<AccessToken> accessToken(String code, Boolean wap) {
method accessToken (line 146) | public Result<AccessToken> accessToken(String code, String redirectUri...
method accessToken (line 164) | public Result<AccessToken> accessToken(String clientId, String clientS...
method refreshAccessToken (line 188) | public Result<AccessToken> refreshAccessToken(String refreshToken) {
method refreshAccessToken (line 198) | public Result<AccessToken> refreshAccessToken(String clientId, String ...
method refreshAccessToken (line 212) | public Result<AccessToken> refreshAccessToken(String refreshToken, Boo...
method refreshAccessToken (line 223) | public Result<AccessToken> refreshAccessToken(String clientId, String ...
method refreshAccessToken (line 239) | public Result<AccessToken> refreshAccessToken(String clientId, String ...
method openId (line 262) | public Result<OpenID> openId(String accessToken) {
method openId (line 274) | public Result<OpenID> openId(String accessToken, Boolean wap) {
method parseAccessTokenResult (line 301) | private Result<AccessToken> parseAccessTokenResult(String result) {
FILE: src/main/java/com/belerweb/social/qq/connect/api/QQConnect.java
class QQConnect (line 25) | public final class QQConnect extends SDK {
method QQConnect (line 34) | public QQConnect(String clientId, String clientSecret) {
method QQConnect (line 39) | public QQConnect(String clientId, String clientSecret, String redirect...
method addIdol (line 53) | public Result<Error> addIdol(String accessToken, String openId, List<S...
method addIdol (line 67) | public Result<Error> addIdol(String accessToken, String openId, List<S...
method addIdol (line 83) | public Result<Error> addIdol(String accessToken, String oauthConsumerK...
method delIdol (line 108) | public Result<Error> delIdol(String accessToken, String openId, String...
method delIdol (line 122) | public Result<Error> delIdol(String accessToken, String openId, String...
method delIdol (line 137) | public Result<Error> delIdol(String accessToken, String oauthConsumerK...
method addOneBlog (line 159) | public Result<Error> addOneBlog(String accessToken, String openId, Str...
method addOneBlog (line 174) | public Result<Error> addOneBlog(String accessToken, String oauthConsum...
method addT (line 197) | public Result<NewT> addT(String accessToken, String openId, String con...
method addT (line 213) | public Result<NewT> addT(String accessToken, String oauthConsumerKey, ...
method addT (line 235) | public Result<NewT> addT(String accessToken, String oauthConsumerKey, ...
method delT (line 269) | public Result<Error> delT(String accessToken, String openId, String id) {
method addPicT (line 287) | public Result<NewT> addPicT(String accessToken, String openId, String ...
method addPicT (line 306) | public Result<NewT> addPicT(String accessToken, String oauthConsumerKe...
method addPicT (line 332) | public Result<NewT> addPicT(String accessToken, String oauthConsumerKe...
method delT (line 386) | public Result<Error> delT(String accessToken, String oauthConsumerKey,...
method getTenpayAddr (line 404) | public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, S...
method getTenpayAddr (line 420) | public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, S...
method getTenpayAddr (line 438) | public Result<List<TenpayAddress>> getTenpayAddr(String accessToken, S...
method getOAuth2 (line 481) | public OAuth2 getOAuth2() {
method getUser (line 488) | public User getUser() {
method getClientId (line 495) | public String getClientId() {
method setClientId (line 499) | public void setClientId(String clientId) {
method getClientSecret (line 503) | public String getClientSecret() {
method setClientSecret (line 507) | public void setClientSecret(String clientSecret) {
method getRedirectUri (line 511) | public String getRedirectUri() {
method setRedirectUri (line 515) | public void setRedirectUri(String redirectUri) {
FILE: src/main/java/com/belerweb/social/qq/connect/api/QZone.java
class QZone (line 30) | public final class QZone extends API {
method QZone (line 32) | protected QZone(QQConnect connect) {
method listAlbum (line 44) | public Result<Album> listAlbum(String accessToken, String openid) {
method listAlbum (line 57) | public Result<Album> listAlbum(String oAuthConsumerKey, String accessT...
method addAlbum (line 86) | public Result<Album> addAlbum(String accessToken, String openid, Strin...
method addAlbum (line 112) | public Result<Album> addAlbum(String oAuthConsumerKey, String accessTo...
method uploadPic (line 155) | public Result<PicUploadResult> uploadPic(String oAuthConsumerKey, Stri...
method listPhoto (line 214) | public Result<Photo> listPhoto(String accessToken, String openid, Stri...
method listPhoto (line 228) | public Result<Photo> listPhoto(String oAuthConsumerKey, String accessT...
FILE: src/main/java/com/belerweb/social/qq/connect/api/User.java
class User (line 14) | public final class User extends API {
method User (line 16) | protected User(QQConnect connect) {
method getUserInfo (line 29) | public Result<com.belerweb.social.qq.connect.bean.User> getUserInfo(St...
method getUserInfo (line 44) | public Result<com.belerweb.social.qq.connect.bean.User> getUserInfo(St...
method getSimpleUserInfo (line 65) | public Result<com.belerweb.social.qq.connect.bean.User> getSimpleUserI...
method getVipInfo (line 86) | public Result<com.belerweb.social.qq.connect.bean.User> getVipInfo(Str...
method getVipInfo (line 102) | public Result<com.belerweb.social.qq.connect.bean.User> getVipInfo(Str...
method getVipRichInfo (line 123) | public Result<com.belerweb.social.qq.connect.bean.User> getVipRichInfo...
method getVipRichInfo (line 139) | public Result<com.belerweb.social.qq.connect.bean.User> getVipRichInfo...
FILE: src/main/java/com/belerweb/social/qq/connect/api/Weibo.java
class Weibo (line 20) | public final class Weibo extends API {
method Weibo (line 22) | protected Weibo(QQConnect connect) {
method getInfo (line 34) | public Result<WeiboUser> getInfo(String accessToken, String openid) {
method getInfo (line 47) | public Result<WeiboUser> getInfo(String oAuthConsumerKey, String acces...
method getOtherInfo (line 71) | public Result<WeiboUser> getOtherInfo(String accessToken, String openi...
method getOtherInfo (line 86) | public Result<WeiboUser> getOtherInfo(String oAuthConsumerKey, String ...
method getFansList (line 114) | public Result<FanList> getFansList(String accessToken, String openid, ...
method getFansList (line 134) | public Result<FanList> getFansList(String oAuthConsumerKey, String acc...
method getIdolList (line 167) | public Result<IdolList> getIdolList(String accessToken, String openid,...
method getIdolList (line 185) | public Result<IdolList> getIdolList(String oAuthConsumerKey, String ac...
method getRepostList (line 217) | public Result<RepostList> getRepostList(String accessToken, String ope...
method getRepostList (line 238) | public Result<RepostList> getRepostList(String oAuthConsumerKey, Strin...
FILE: src/main/java/com/belerweb/social/qq/connect/bean/AccessToken.java
class AccessToken (line 8) | public class AccessToken extends JsonBean {
method AccessToken (line 10) | public AccessToken() {}
method AccessToken (line 12) | private AccessToken(JSONObject jsonObject) {
method getToken (line 23) | public String getToken() {
method setToken (line 27) | public void setToken(String token) {
method getExpiresIn (line 35) | public Long getExpiresIn() {
method setExpiresIn (line 39) | public void setExpiresIn(Long expiresIn) {
method getRefreshToken (line 46) | public String getRefreshToken() {
method setRefreshToken (line 50) | public void setRefreshToken(String refreshToken) {
method parse (line 54) | public static AccessToken parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Album.java
class Album (line 10) | public class Album extends JsonBean {
method Album (line 12) | public Album() {}
method Album (line 14) | private Album(JSONObject jsonObject) {
method getAlbumId (line 26) | public String getAlbumId() {
method setAlbumId (line 30) | public void setAlbumId(String albumId) {
method getClassId (line 34) | public String getClassId() {
method setClassId (line 38) | public void setClassId(String classId) {
method getCreateTime (line 42) | public Date getCreateTime() {
method setCreateTime (line 46) | public void setCreateTime(Date createTime) {
method getName (line 50) | public String getName() {
method setName (line 54) | public void setName(String name) {
method getDescription (line 58) | public String getDescription() {
method setDescription (line 62) | public void setDescription(String description) {
method getCover (line 66) | public String getCover() {
method setCover (line 70) | public void setCover(String cover) {
method getPicNum (line 74) | public Integer getPicNum() {
method setPicNum (line 78) | public void setPicNum(Integer picNum) {
method parse (line 82) | public static Album parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/AlbumPrivilege.java
type AlbumPrivilege (line 3) | public enum AlbumPrivilege {
method AlbumPrivilege (line 8) | private AlbumPrivilege(Integer value) {
method value (line 12) | public Integer value() {
method toString (line 16) | @Override
method parse (line 21) | public static AlbumPrivilege parse(Integer value) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Company.java
class Company (line 8) | public class Company extends JsonBean {
method Company (line 10) | public Company() {}
method Company (line 12) | private Company(JSONObject jsonObject) {
method getId (line 22) | public String getId() {
method setId (line 26) | public void setId(String id) {
method getCompanyName (line 30) | public String getCompanyName() {
method setCompanyName (line 34) | public void setCompanyName(String companyName) {
method getDepartmentName (line 38) | public String getDepartmentName() {
method setDepartmentName (line 42) | public void setDepartmentName(String departmentName) {
method getBeginYear (line 46) | public Integer getBeginYear() {
method setBeginYear (line 50) | public void setBeginYear(Integer beginYear) {
method getEndYear (line 54) | public Integer getEndYear() {
method setEndYear (line 58) | public void setEndYear(Integer endYear) {
method parse (line 62) | public static Company parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Display.java
type Display (line 3) | public enum Display {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Education.java
class Education (line 8) | public class Education extends JsonBean {
method Education (line 10) | public Education() {}
method Education (line 12) | private Education(JSONObject jsonObject) {
method getId (line 22) | public String getId() {
method setId (line 26) | public void setId(String id) {
method getYear (line 30) | public Integer getYear() {
method setYear (line 34) | public void setYear(Integer year) {
method getSchoolId (line 38) | public String getSchoolId() {
method setSchoolId (line 42) | public void setSchoolId(String schoolId) {
method getDepartmentId (line 46) | public String getDepartmentId() {
method setDepartmentId (line 50) | public void setDepartmentId(String departmentId) {
method getLevel (line 54) | public Integer getLevel() {
method setLevel (line 58) | public void setLevel(Integer level) {
method parse (line 62) | public static Education parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/FanList.java
class FanList (line 11) | public class FanList extends JsonBean {
method FanList (line 13) | public FanList() {}
method FanList (line 15) | private FanList(JSONObject jsonObject) {
method getTimestamp (line 23) | public Date getTimestamp() {
method setTimestamp (line 27) | public void setTimestamp(Date timestamp) {
method getHasNext (line 31) | public Boolean getHasNext() {
method setHasNext (line 35) | public void setHasNext(Boolean hasNext) {
method getFans (line 39) | public List<WeiboUser> getFans() {
method setFans (line 43) | public void setFans(List<WeiboUser> fans) {
method parse (line 47) | public static FanList parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Gut.java
type Gut (line 6) | public enum Gut {
method Gut (line 14) | private Gut(int value) {
method value (line 18) | public int value() {
method toString (line 22) | @Override
FILE: src/main/java/com/belerweb/social/qq/connect/bean/IdolList.java
class IdolList (line 11) | public class IdolList extends JsonBean {
method IdolList (line 13) | public IdolList() {}
method IdolList (line 15) | private IdolList(JSONObject jsonObject) {
method getTimestamp (line 23) | public Date getTimestamp() {
method setTimestamp (line 27) | public void setTimestamp(Date timestamp) {
method getHasNext (line 31) | public Boolean getHasNext() {
method setHasNext (line 35) | public void setHasNext(Boolean hasNext) {
method getFans (line 39) | public List<WeiboUser> getFans() {
method setFans (line 43) | public void setFans(List<WeiboUser> fans) {
method parse (line 47) | public static IdolList parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Image.java
class Image (line 8) | public class Image extends JsonBean {
method Image (line 10) | public Image() {}
method Image (line 12) | private Image(JSONObject jsonObject) {
method getUrl (line 20) | public String getUrl() {
method setUrl (line 24) | public void setUrl(String url) {
method getWidth (line 28) | public Integer getWidth() {
method setWidth (line 32) | public void setWidth(Integer width) {
method getHeight (line 36) | public Integer getHeight() {
method setHeight (line 40) | public void setHeight(Integer height) {
method parse (line 44) | public static Image parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Music.java
class Music (line 8) | public class Music extends JsonBean {
method Music (line 10) | public Music() {}
method Music (line 12) | private Music(JSONObject jsonObject) {
method getAuthor (line 21) | public String getAuthor() {
method setAuthor (line 25) | public void setAuthor(String author) {
method getUrl (line 29) | public String getUrl() {
method setUrl (line 33) | public void setUrl(String url) {
method getTitle (line 37) | public String getTitle() {
method setTitle (line 41) | public void setTitle(String title) {
method parse (line 45) | public static Music parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/NewT.java
class NewT (line 13) | public class NewT extends JsonBean {
method NewT (line 15) | public NewT() {}
method NewT (line 17) | private NewT(JSONObject jsonObject) {
method getId (line 25) | public Long getId() {
method setId (line 29) | public void setId(Long id) {
method getTime (line 33) | public Date getTime() {
method setTime (line 37) | public void setTime(Date time) {
method getImgUrl (line 41) | public String getImgUrl() {
method setImgUrl (line 45) | public void setImgUrl(String imgUrl) {
method parse (line 49) | public static NewT parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/OpenID.java
class OpenID (line 7) | public class OpenID extends JsonBean {
method OpenID (line 9) | public OpenID() {}
method OpenID (line 11) | private OpenID(JSONObject jsonObject) {
method getClientId (line 21) | public String getClientId() {
method setClientId (line 25) | public void setClientId(String clientId) {
method getOpenId (line 29) | public String getOpenId() {
method setOpenId (line 33) | public void setOpenId(String openId) {
method parse (line 37) | public static OpenID parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Photo.java
class Photo (line 11) | public class Photo extends JsonBean {
method Photo (line 13) | public Photo() {}
method Photo (line 15) | private Photo(JSONObject jsonObject) {
method getsLoc (line 28) | public String getsLoc() {
method setsLoc (line 32) | public void setsLoc(String sLoc) {
method getlLoc (line 36) | public String getlLoc() {
method setlLoc (line 40) | public void setlLoc(String lLoc) {
method getName (line 44) | public String getName() {
method setName (line 48) | public void setName(String name) {
method getDescription (line 52) | public String getDescription() {
method setDescription (line 56) | public void setDescription(String description) {
method getUpdatedTime (line 60) | public Date getUpdatedTime() {
method setUpdatedTime (line 64) | public void setUpdatedTime(Date updatedTime) {
method getUploadedTime (line 68) | public Date getUploadedTime() {
method setUploadedTime (line 72) | public void setUploadedTime(Date uploadedTime) {
method getSmallUrl (line 76) | public String getSmallUrl() {
method setSmallUrl (line 80) | public void setSmallUrl(String smallUrl) {
method getLargeImage (line 84) | public Image getLargeImage() {
method setLargeImage (line 88) | public void setLargeImage(Image largeImage) {
method parse (line 92) | public static Photo parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/PicUploadResult.java
class PicUploadResult (line 8) | public class PicUploadResult extends JsonBean {
method PicUploadResult (line 10) | public PicUploadResult() {}
method PicUploadResult (line 12) | private PicUploadResult(JSONObject jsonObject) {
method getAlbumId (line 24) | public String getAlbumId() {
method setAlbumId (line 28) | public void setAlbumId(String albumId) {
method getlLoc (line 32) | public String getlLoc() {
method setlLoc (line 36) | public void setlLoc(String lLoc) {
method getsLoc (line 40) | public String getsLoc() {
method setsLoc (line 44) | public void setsLoc(String sLoc) {
method getLargeUrl (line 48) | public String getLargeUrl() {
method setLargeUrl (line 52) | public void setLargeUrl(String largeUrl) {
method getSmallUrl (line 56) | public String getSmallUrl() {
method setSmallUrl (line 60) | public void setSmallUrl(String smallUrl) {
method getWidth (line 64) | public Integer getWidth() {
method setWidth (line 68) | public void setWidth(Integer width) {
method getHeight (line 72) | public Integer getHeight() {
method setHeight (line 76) | public void setHeight(Integer height) {
method parse (line 80) | public static PicUploadResult parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/RepostList.java
class RepostList (line 14) | public class RepostList extends JsonBean {
method RepostList (line 16) | public RepostList() {}
method RepostList (line 18) | private RepostList(JSONObject jsonObject) {
method getTimestamp (line 28) | public Date getTimestamp() {
method setTimestamp (line 32) | public void setTimestamp(Date timestamp) {
method getHasNext (line 36) | public Boolean getHasNext() {
method setHasNext (line 40) | public void setHasNext(Boolean hasNext) {
method getTotalNum (line 44) | public Integer getTotalNum() {
method setTotalNum (line 48) | public void setTotalNum(Integer totalNum) {
method getTweets (line 52) | public List<TweetInfo> getTweets() {
method setTweets (line 56) | public void setTweets(List<TweetInfo> tweets) {
method parse (line 60) | public static RepostList parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Scope.java
type Scope (line 6) | public enum Scope {
method Scope (line 115) | private Scope(String scope) {
method value (line 119) | public String value() {
method toString (line 123) | @Override
FILE: src/main/java/com/belerweb/social/qq/connect/bean/SendPrivate.java
type SendPrivate (line 3) | public enum SendPrivate {
method SendPrivate (line 8) | private SendPrivate(Integer value) {
method value (line 12) | public Integer value() {
method toString (line 16) | @Override
method parse (line 21) | public static SendPrivate parse(Integer value) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Tag.java
class Tag (line 8) | public class Tag extends JsonBean {
method Tag (line 10) | public Tag() {}
method Tag (line 12) | private Tag(JSONObject jsonObject) {
method getId (line 20) | public String getId() {
method setId (line 24) | public void setId(String id) {
method getName (line 28) | public String getName() {
method setName (line 32) | public void setName(String name) {
method parse (line 36) | public static Tag parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/TenpayAddress.java
class TenpayAddress (line 8) | public class TenpayAddress {
method getIndex (line 23) | public Integer getIndex() {
method setIndex (line 27) | public void setIndex(Integer index) {
method getRegionId (line 31) | public Integer getRegionId() {
method setRegionId (line 35) | public void setRegionId(Integer regionId) {
method getStreet (line 39) | public String getStreet() {
method setStreet (line 43) | public void setStreet(String street) {
method getZipcode (line 47) | public String getZipcode() {
method setZipcode (line 51) | public void setZipcode(String zipcode) {
method getMobile (line 55) | public String getMobile() {
method setMobile (line 59) | public void setMobile(String mobile) {
method getTel (line 63) | public String getTel() {
method setTel (line 67) | public void setTel(String tel) {
method getName (line 71) | public String getName() {
method setName (line 75) | public void setName(String name) {
method getCreated (line 79) | public Date getCreated() {
method setCreated (line 83) | public void setCreated(Date created) {
method getModified (line 87) | public Date getModified() {
method setModified (line 91) | public void setModified(Date modified) {
method getLastUsed (line 95) | public Date getLastUsed() {
method setLastUsed (line 99) | public void setLastUsed(Date lastUsed) {
method getUsedCount (line 103) | public Integer getUsedCount() {
method setUsedCount (line 107) | public void setUsedCount(Integer usedCount) {
method getTotal (line 111) | public Integer getTotal() {
method setTotal (line 115) | public void setTotal(Integer total) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/TweetInfo.java
class TweetInfo (line 10) | public class TweetInfo extends JsonBean {
method TweetInfo (line 12) | public TweetInfo() {}
method TweetInfo (line 14) | private TweetInfo(JSONObject jsonObject) {
method getId (line 43) | public String getId() {
method setId (line 47) | public void setId(String id) {
method getCountryCode (line 51) | public String getCountryCode() {
method setCountryCode (line 55) | public void setCountryCode(String countryCode) {
method getProvinceCode (line 59) | public String getProvinceCode() {
method setProvinceCode (line 63) | public void setProvinceCode(String provinceCode) {
method getCityCode (line 67) | public String getCityCode() {
method setCityCode (line 71) | public void setCityCode(String cityCode) {
method getEmotionType (line 75) | public String getEmotionType() {
method setEmotionType (line 79) | public void setEmotionType(String emotionType) {
method getEmotionUrl (line 83) | public String getEmotionUrl() {
method setEmotionUrl (line 87) | public void setEmotionUrl(String emotionUrl) {
method getFrom (line 91) | public String getFrom() {
method setFrom (line 95) | public void setFrom(String from) {
method getFromUrl (line 99) | public String getFromUrl() {
method setFromUrl (line 103) | public void setFromUrl(String fromUrl) {
method getImage (line 107) | public String getImage() {
method setImage (line 111) | public void setImage(String image) {
method getGeo (line 115) | public String getGeo() {
method setGeo (line 119) | public void setGeo(String geo) {
method getLocation (line 123) | public String getLocation() {
method setLocation (line 127) | public void setLocation(String location) {
method getLongitude (line 131) | public Double getLongitude() {
method setLongitude (line 135) | public void setLongitude(Double longitude) {
method getLatitude (line 139) | public Double getLatitude() {
method setLatitude (line 143) | public void setLatitude(Double latitude) {
method getMusic (line 147) | public Music getMusic() {
method setMusic (line 151) | public void setMusic(Music music) {
method getOrigText (line 155) | public String getOrigText() {
method setOrigText (line 159) | public void setOrigText(String origText) {
method getSelf (line 163) | public Boolean getSelf() {
method setSelf (line 167) | public void setSelf(Boolean self) {
method getStatus (line 171) | public Integer getStatus() {
method setStatus (line 175) | public void setStatus(Integer status) {
method getText (line 179) | public String getText() {
method setText (line 183) | public void setText(String text) {
method getTimestamp (line 187) | public Date getTimestamp() {
method setTimestamp (line 191) | public void setTimestamp(Date timestamp) {
method getType (line 195) | public Integer getType() {
method setType (line 199) | public void setType(Integer type) {
method getVideo (line 203) | public Video getVideo() {
method setVideo (line 207) | public void setVideo(Video video) {
method getCount (line 211) | public Integer getCount() {
method setCount (line 215) | public void setCount(Integer count) {
method getmCount (line 219) | public Integer getmCount() {
method setmCount (line 223) | public void setmCount(Integer mCount) {
method getIsVip (line 227) | public Boolean getIsVip() {
method setIsVip (line 231) | public void setIsVip(Boolean isVip) {
method parse (line 235) | public static TweetInfo parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/User.java
class User (line 11) | public class User extends JsonBean {
method User (line 13) | public User() {}
method User (line 15) | private User(JSONObject jsonObject) {
method getNickname (line 56) | public String getNickname() {
method setNickname (line 60) | public void setNickname(String nickname) {
method getFigureUrl (line 67) | public String getFigureUrl() {
method setFigureUrl (line 71) | public void setFigureUrl(String figureUrl) {
method getFigureUrl1 (line 78) | public String getFigureUrl1() {
method setFigureUrl1 (line 82) | public void setFigureUrl1(String figureUrl1) {
method getFigureUrl2 (line 89) | public String getFigureUrl2() {
method setFigureUrl2 (line 93) | public void setFigureUrl2(String figureUrl2) {
method getFigureUrlQQ1 (line 100) | public String getFigureUrlQQ1() {
method setFigureUrlQQ1 (line 104) | public void setFigureUrlQQ1(String figureUrlQQ1) {
method getFigureUrlQQ2 (line 111) | public String getFigureUrlQQ2() {
method setFigureUrlQQ2 (line 115) | public void setFigureUrlQQ2(String figureUrlQQ2) {
method getGender (line 122) | public Gender getGender() {
method setGender (line 126) | public void setGender(Gender gender) {
method getIsYellowVip (line 133) | public Boolean getIsYellowVip() {
method setIsYellowVip (line 137) | public void setIsYellowVip(Boolean isYellowVip) {
method getVip (line 144) | public Boolean getVip() {
method setVip (line 148) | public void setVip(Boolean vip) {
method getYellowVipLevel (line 155) | public Integer getYellowVipLevel() {
method setYellowVipLevel (line 159) | public void setYellowVipLevel(Integer yellowVipLevel) {
method getLevel (line 166) | public Integer getLevel() {
method setLevel (line 170) | public void setLevel(Integer level) {
method getIsYellowYearVip (line 177) | public Boolean getIsYellowYearVip() {
method setIsYellowYearVip (line 181) | public void setIsYellowYearVip(Boolean isYellowYearVip) {
method getIsQQVip (line 188) | public Boolean getIsQQVip() {
method setIsQQVip (line 192) | public void setIsQQVip(Boolean isQQVip) {
method getQqVipLevel (line 199) | public Integer getQqVipLevel() {
method setQqVipLevel (line 203) | public void setQqVipLevel(Integer qqVipLevel) {
method getIsQQYearVip (line 210) | public Boolean getIsQQYearVip() {
method setIsQQYearVip (line 214) | public void setIsQQYearVip(Boolean isQQYearVip) {
method getIsLost (line 218) | public Boolean getIsLost() {
method setIsLost (line 222) | public void setIsLost(Boolean isLost) {
method getQqVipStart (line 229) | public Date getQqVipStart() {
method setQqVipStart (line 233) | public void setQqVipStart(Date qqVipStart) {
method getQqVipEnd (line 240) | public Date getQqVipEnd() {
method setQqVipEnd (line 244) | public void setQqVipEnd(Date qqVipEnd) {
method getQqVipPayway (line 251) | public Integer getQqVipPayway() {
method setQqVipPayway (line 255) | public void setQqVipPayway(Integer qqVipPayway) {
method getQqYearVipStart (line 262) | public Date getQqYearVipStart() {
method setQqYearVipStart (line 266) | public void setQqYearVipStart(Date qqYearVipStart) {
method getQqYearVipEnd (line 273) | public Date getQqYearVipEnd() {
method setQqYearVipEnd (line 277) | public void setQqYearVipEnd(Date qqYearVipEnd) {
method getQqYearVipPayway (line 284) | public Integer getQqYearVipPayway() {
method setQqYearVipPayway (line 288) | public void setQqYearVipPayway(Integer qqYearVipPayway) {
method getQqZuanhuangStart (line 295) | public Date getQqZuanhuangStart() {
method setQqZuanhuangStart (line 299) | public void setQqZuanhuangStart(Date qqZuanhuangStart) {
method getQqZuanhuangEnd (line 306) | public Date getQqZuanhuangEnd() {
method setQqZuanhuangEnd (line 310) | public void setQqZuanhuangEnd(Date qqZuanhuangEnd) {
method getQqZuanhuangPayway (line 317) | public Integer getQqZuanhuangPayway() {
method setQqZuanhuangPayway (line 321) | public void setQqZuanhuangPayway(Integer qqZuanhuangPayway) {
method getQqHaohuaStart (line 328) | public Date getQqHaohuaStart() {
method setQqHaohuaStart (line 332) | public void setQqHaohuaStart(Date qqHaohuaStart) {
method getQqHaohuaEnd (line 339) | public Date getQqHaohuaEnd() {
method setQqHaohuaEnd (line 343) | public void setQqHaohuaEnd(Date qqHaohuaEnd) {
method getQqHaohuaPayway (line 350) | public Integer getQqHaohuaPayway() {
method setQqHaohuaPayway (line 354) | public void setQqHaohuaPayway(Integer qqHaohuaPayway) {
method getQqSvipStart (line 361) | public Date getQqSvipStart() {
method setQqSvipStart (line 365) | public void setQqSvipStart(Date qqSvipStart) {
method getQqSvipEnd (line 372) | public Date getQqSvipEnd() {
method setQqSvipEnd (line 376) | public void setQqSvipEnd(Date qqSvipEnd) {
method getQqSvipPayway (line 383) | public Integer getQqSvipPayway() {
method setQqSvipPayway (line 387) | public void setQqSvipPayway(Integer qqSvipPayway) {
method getHistoryPayTime (line 394) | public Date getHistoryPayTime() {
method setHistoryPayTime (line 398) | public void setHistoryPayTime(Date historyPayTime) {
method getHistoryEndTime (line 405) | public Date getHistoryEndTime() {
method setHistoryEndTime (line 409) | public void setHistoryEndTime(Date historyEndTime) {
method parse (line 413) | public static User parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/Video.java
class Video (line 8) | public class Video extends JsonBean {
method Video (line 10) | public Video() {}
method Video (line 12) | private Video(JSONObject jsonObject) {
method getPicUrl (line 22) | public String getPicUrl() {
method setPicUrl (line 26) | public void setPicUrl(String picUrl) {
method getPlayer (line 30) | public String getPlayer() {
method setPlayer (line 34) | public void setPlayer(String player) {
method getRealUrl (line 38) | public String getRealUrl() {
method setRealUrl (line 42) | public void setRealUrl(String realUrl) {
method getShortUrl (line 46) | public String getShortUrl() {
method setShortUrl (line 50) | public void setShortUrl(String shortUrl) {
method getTitle (line 54) | public String getTitle() {
method setTitle (line 58) | public void setTitle(String title) {
method parse (line 62) | public static Video parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/connect/bean/WeiboUser.java
class WeiboUser (line 15) | public class WeiboUser extends JsonBean {
method WeiboUser (line 17) | public WeiboUser() {}
method WeiboUser (line 19) | private WeiboUser(JSONObject jsonObject) {
method getOpenId (line 62) | public String getOpenId() {
method setOpenId (line 66) | public void setOpenId(String openId) {
method getName (line 70) | public String getName() {
method setName (line 74) | public void setName(String name) {
method getNick (line 78) | public String getNick() {
method setNick (line 82) | public void setNick(String nick) {
method getRegTime (line 86) | public Date getRegTime() {
method setRegTime (line 90) | public void setRegTime(Date regTime) {
method getBirth (line 94) | public Date getBirth() {
method setBirth (line 98) | public void setBirth(Date birth) {
method getCountryCode (line 102) | public String getCountryCode() {
method setCountryCode (line 106) | public void setCountryCode(String countryCode) {
method getProvinceCode (line 110) | public String getProvinceCode() {
method setProvinceCode (line 114) | public void setProvinceCode(String provinceCode) {
method getCityCode (line 118) | public String getCityCode() {
method setCityCode (line 122) | public void setCityCode(String cityCode) {
method getCompanies (line 126) | public List<Company> getCompanies() {
method setCompanies (line 130) | public void setCompanies(List<Company> companies) {
method getEducations (line 134) | public List<Education> getEducations() {
method setEducations (line 138) | public void setEducations(List<Education> educations) {
method getFansNum (line 142) | public Integer getFansNum() {
method setFansNum (line 146) | public void setFansNum(Integer fansNum) {
method getFavNum (line 150) | public Integer getFavNum() {
method setFavNum (line 154) | public void setFavNum(Integer favNum) {
method getHead (line 158) | public String getHead() {
method setHead (line 162) | public void setHead(String head) {
method getHomeCountryCode (line 166) | public String getHomeCountryCode() {
method setHomeCountryCode (line 170) | public void setHomeCountryCode(String homeCountryCode) {
method getHomeProvinceCode (line 174) | public String getHomeProvinceCode() {
method setHomeProvinceCode (line 178) | public void setHomeProvinceCode(String homeProvinceCode) {
method getHomeCityCode (line 182) | public String getHomeCityCode() {
method setHomeCityCode (line 186) | public void setHomeCityCode(String homeCityCode) {
method getHometownCode (line 190) | public String getHometownCode() {
method setHometownCode (line 194) | public void setHometownCode(String hometownCode) {
method getHomepage (line 198) | public String getHomepage() {
method setHomepage (line 202) | public void setHomepage(String homepage) {
method getIdolNum (line 206) | public Integer getIdolNum() {
method setIdolNum (line 210) | public void setIdolNum(Integer idolNum) {
method getIndustryCode (line 214) | public String getIndustryCode() {
method setIndustryCode (line 218) | public void setIndustryCode(String industryCode) {
method getIntroduction (line 222) | public String getIntroduction() {
method setIntroduction (line 226) | public void setIntroduction(String introduction) {
method getIsEnt (line 230) | public Boolean getIsEnt() {
method setIsEnt (line 234) | public void setIsEnt(Boolean isEnt) {
method getIsMyBlack (line 238) | public Boolean getIsMyBlack() {
method setIsMyBlack (line 242) | public void setIsMyBlack(Boolean isMyBlack) {
method getIsMyFans (line 246) | public Boolean getIsMyFans() {
method setIsMyFans (line 250) | public void setIsMyFans(Boolean isMyFans) {
method getIsMyIdol (line 254) | public Boolean getIsMyIdol() {
method setIsMyIdol (line 258) | public void setIsMyIdol(Boolean isMyIdol) {
method getIsRealName (line 262) | public Boolean getIsRealName() {
method setIsRealName (line 266) | public void setIsRealName(Boolean isRealName) {
method getIsVip (line 270) | public Boolean getIsVip() {
method setIsVip (line 274) | public void setIsVip(Boolean isVip) {
method getLocation (line 278) | public String getLocation() {
method setLocation (line 282) | public void setLocation(String location) {
method getMutualFansNum (line 286) | public Integer getMutualFansNum() {
method setMutualFansNum (line 290) | public void setMutualFansNum(Integer mutualFansNum) {
method getSendPrivate (line 294) | public SendPrivate getSendPrivate() {
method setSendPrivate (line 298) | public void setSendPrivate(SendPrivate sendPrivate) {
method getGender (line 302) | public Gender getGender() {
method setGender (line 306) | public void setGender(Gender gender) {
method getTags (line 310) | public List<Tag> getTags() {
method setTags (line 314) | public void setTags(List<Tag> tags) {
method getTweets (line 318) | public List<TweetInfo> getTweets() {
method setTweets (line 322) | public void setTweets(List<TweetInfo> tweets) {
method getTweetNum (line 326) | public Integer getTweetNum() {
method setTweetNum (line 330) | public void setTweetNum(Integer tweetNum) {
method getVerifyInfo (line 334) | public String getVerifyInfo() {
method setVerifyInfo (line 338) | public void setVerifyInfo(String verifyInfo) {
method getExp (line 342) | public Integer getExp() {
method setExp (line 346) | public void setExp(Integer exp) {
method getLevel (line 350) | public Integer getLevel() {
method setLevel (line 354) | public void setLevel(Integer level) {
method getSeqId (line 358) | public String getSeqId() {
method setSeqId (line 362) | public void setSeqId(String seqId) {
method parse (line 366) | public static WeiboUser parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/qq/mail/api/Contact.java
class Contact (line 51) | public class Contact {
method Contact (line 67) | public Contact(String email, String password, Yundama yundama) {
method get (line 74) | private List<Group> get(Group group) throws SocialException {
method get (line 134) | public List<Group> get() throws SocialException {
method login (line 154) | public String login() throws SocialException {
method check (line 298) | public ValidationCode check() throws SocialException {
method getValidationCode (line 330) | public byte[] getValidationCode() throws SocialException {
method getValidationCode2 (line 359) | public byte[] getValidationCode2() throws SocialException {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/Address.java
class Address (line 3) | public class Address {
method getLabel (line 13) | public String getLabel() {
method setLabel (line 17) | public void setLabel(String label) {
method getType (line 21) | public String getType() {
method setType (line 25) | public void setType(String type) {
method getCountry (line 29) | public String getCountry() {
method setCountry (line 33) | public void setCountry(String country) {
method getProvince (line 37) | public String getProvince() {
method setProvince (line 41) | public void setProvince(String province) {
method getCity (line 45) | public String getCity() {
method setCity (line 49) | public void setCity(String city) {
method getStreet (line 53) | public String getStreet() {
method setStreet (line 57) | public void setStreet(String street) {
method getPostcode (line 61) | public String getPostcode() {
method setPostcode (line 65) | public void setPostcode(String postcode) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/Email.java
class Email (line 3) | public class Email {
method getLabel (line 9) | public String getLabel() {
method setLabel (line 13) | public void setLabel(String label) {
method getType (line 17) | public String getType() {
method setType (line 21) | public void setType(String type) {
method getEmail (line 25) | public String getEmail() {
method setEmail (line 29) | public void setEmail(String email) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/Group.java
class Group (line 5) | public class Group {
method getId (line 13) | public String getId() {
method setId (line 17) | public void setId(String id) {
method getType (line 21) | public String getType() {
method setType (line 25) | public void setType(String type) {
method getName (line 29) | public String getName() {
method setName (line 33) | public void setName(String name) {
method getUsers (line 37) | public List<User> getUsers() {
method setUsers (line 41) | public void setUsers(List<User> users) {
method getOwner (line 45) | public String getOwner() {
method setOwner (line 49) | public void setOwner(String owner) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/Org.java
class Org (line 3) | public class Org {
method getOrg1 (line 9) | public String getOrg1() {
method setOrg1 (line 13) | public void setOrg1(String org1) {
method getOrg2 (line 17) | public String getOrg2() {
method setOrg2 (line 21) | public void setOrg2(String org2) {
method getTitle (line 25) | public String getTitle() {
method setTitle (line 29) | public void setTitle(String title) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/Tel.java
class Tel (line 3) | public class Tel {
method getLabel (line 9) | public String getLabel() {
method setLabel (line 13) | public void setLabel(String label) {
method getType (line 17) | public String getType() {
method setType (line 21) | public void setType(String type) {
method getNum (line 25) | public String getNum() {
method setNum (line 29) | public void setNum(String num) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/User.java
class User (line 5) | public class User {
method getId (line 26) | public String getId() {
method setId (line 30) | public void setId(String id) {
method getLevel (line 34) | public String getLevel() {
method setLevel (line 38) | public void setLevel(String level) {
method getType (line 42) | public String getType() {
method setType (line 46) | public void setType(String type) {
method getName (line 50) | public String getName() {
method setName (line 54) | public void setName(String name) {
method getNickName (line 58) | public String getNickName() {
method setNickName (line 62) | public void setNickName(String nickName) {
method getFamilyName (line 66) | public String getFamilyName() {
method setFamilyName (line 70) | public void setFamilyName(String familyName) {
method getGivenName (line 74) | public String getGivenName() {
method setGivenName (line 78) | public void setGivenName(String givenName) {
method getRelate (line 82) | public String getRelate() {
method setRelate (line 86) | public void setRelate(String relate) {
method getUrl (line 90) | public String getUrl() {
method setUrl (line 94) | public void setUrl(String url) {
method getDate (line 98) | public String getDate() {
method setDate (line 102) | public void setDate(String date) {
method getBirthday (line 106) | public String getBirthday() {
method setBirthday (line 110) | public void setBirthday(String birthday) {
method getIm (line 114) | public String getIm() {
method setIm (line 118) | public void setIm(String im) {
method getCustom (line 122) | public String getCustom() {
method setCustom (line 126) | public void setCustom(String custom) {
method getNote (line 130) | public String getNote() {
method setNote (line 134) | public void setNote(String note) {
method getAddress (line 138) | public Address getAddress() {
method setAddress (line 142) | public void setAddress(Address address) {
method getOrg (line 146) | public Org getOrg() {
method setOrg (line 150) | public void setOrg(Org org) {
method getEmails (line 154) | public List<Email> getEmails() {
method setEmails (line 158) | public void setEmails(List<Email> emails) {
method getTels (line 162) | public List<Tel> getTels() {
method setTels (line 166) | public void setTels(List<Tel> tels) {
FILE: src/main/java/com/belerweb/social/qq/mail/bean/ValidationCode.java
class ValidationCode (line 3) | public class ValidationCode {
method ValidationCode (line 9) | public ValidationCode() {}
method ValidationCode (line 11) | public ValidationCode(String response) {
method getStatus (line 18) | public String getStatus() {
method setStatus (line 22) | public void setStatus(String status) {
method getCode (line 26) | public String getCode() {
method setCode (line 30) | public void setCode(String code) {
method getUid (line 34) | public String getUid() {
method setUid (line 38) | public void setUid(String uid) {
method need (line 42) | public boolean need() {
FILE: src/main/java/com/belerweb/social/qq/qzone/api/Visitor.java
class Visitor (line 35) | public class Visitor {
method Visitor (line 50) | public Visitor(String qq, String password, Yundama yundama) {
method openLogin (line 57) | private void openLogin() throws ClientProtocolException, IOException, ...
method loginCheck (line 83) | private ValidationCode loginCheck() throws ClientProtocolException, IO...
method getValidationCode (line 105) | private byte[] getValidationCode() throws ClientProtocolException, IOE...
method login (line 121) | private void login() throws ClientProtocolException, IOException, Deco...
method getSimple (line 190) | public JSONObject getSimple() throws SocialException {
FILE: src/main/java/com/belerweb/social/qq/t/api/OAuth2.java
class OAuth2 (line 11) | public final class OAuth2 extends API {
method OAuth2 (line 13) | OAuth2(QQT t) {
method authorize (line 24) | public String authorize() {
method authorize (line 36) | public String authorize(String redirectUri) {
method authorize (line 56) | public String authorize(String clientId, String redirectUri, String re...
FILE: src/main/java/com/belerweb/social/qq/t/api/QQT.java
class QQT (line 5) | public final class QQT extends SDK {
method QQT (line 11) | public QQT(String clientId, String clientSecret) {
method QQT (line 16) | public QQT(String clientId, String clientSecret, String redirectUri) {
method getClientId (line 21) | public String getClientId() {
method setClientId (line 25) | public void setClientId(String clientId) {
method getClientSecret (line 29) | public String getClientSecret() {
method setClientSecret (line 33) | public void setClientSecret(String clientSecret) {
method getRedirectUri (line 37) | public String getRedirectUri() {
method setRedirectUri (line 41) | public void setRedirectUri(String redirectUri) {
FILE: src/main/java/com/belerweb/social/weibo/api/OAuth2.java
class OAuth2 (line 19) | public final class OAuth2 extends API {
method OAuth2 (line 21) | OAuth2(Weibo weibo) {
method authorize (line 33) | public String authorize() {
method authorize (line 47) | public String authorize(String redirectUri) {
method authorize (line 67) | public String authorize(String clientId, String redirectUri, Scope[] s...
method accessToken (line 88) | public Result<AccessToken> accessToken(String code) {
method accessToken (line 97) | public Result<AccessToken> accessToken(String code, String redirectUri) {
method accessToken (line 113) | public Result<AccessToken> accessToken(String clientId, String clientS...
method getTokenInfo (line 134) | public Result<TokenInfo> getTokenInfo(String accessToken) {
method getOAuth2Token (line 156) | public void getOAuth2Token(String oauthConsumerKey, String oauthToken,
method revokeOAuth2 (line 169) | public Result<Boolean> revokeOAuth2(String accessToken) {
FILE: src/main/java/com/belerweb/social/weibo/api/User.java
class User (line 17) | public final class User extends API {
method User (line 19) | protected User(Weibo weibo) {
method show (line 39) | public Result<com.belerweb.social.weibo.bean.User> show(String source,...
method domainShow (line 63) | public Result<com.belerweb.social.weibo.bean.User> domainShow(String s...
method counts (line 86) | public Result<UserCounts> counts(String source, String accessToken, Li...
FILE: src/main/java/com/belerweb/social/weibo/api/Weibo.java
class Weibo (line 5) | public final class Weibo extends SDK {
method Weibo (line 14) | public Weibo(String clientId, String clientSecret) {
method Weibo (line 20) | public Weibo(String clientId, String clientSecret, String redirectUri) {
method getOAuth2 (line 26) | public OAuth2 getOAuth2() {
method getUser (line 34) | public User getUser() {
method getClientId (line 42) | public String getClientId() {
method setClientId (line 46) | public void setClientId(String clientId) {
method getClientSecret (line 50) | public String getClientSecret() {
method setClientSecret (line 54) | public void setClientSecret(String clientSecret) {
method getRedirectUri (line 58) | public String getRedirectUri() {
method setRedirectUri (line 62) | public void setRedirectUri(String redirectUri) {
FILE: src/main/java/com/belerweb/social/weibo/bean/AccessToken.java
class AccessToken (line 8) | public class AccessToken extends JsonBean {
method AccessToken (line 10) | public AccessToken() {}
method AccessToken (line 12) | private AccessToken(JSONObject jsonObject) {
method getToken (line 24) | public String getToken() {
method setToken (line 28) | public void setToken(String token) {
method getExpiresIn (line 35) | public Long getExpiresIn() {
method setExpiresIn (line 39) | public void setExpiresIn(Long expiresIn) {
method getRemindIn (line 46) | public Long getRemindIn() {
method setRemindIn (line 50) | public void setRemindIn(Long remindIn) {
method getUid (line 57) | public String getUid() {
method setUid (line 61) | public void setUid(String uid) {
method parse (line 65) | public static AccessToken parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Comment.java
class Comment (line 16) | public class Comment extends JsonBean {
method Comment (line 18) | public Comment() {}
method Comment (line 20) | private Comment(JSONObject jsonObject) {
method getId (line 37) | public String getId() {
method setId (line 41) | public void setId(String id) {
method getMid (line 48) | public String getMid() {
method setMid (line 52) | public void setMid(String mid) {
method getIdstr (line 59) | public String getIdstr() {
method setIdstr (line 63) | public void setIdstr(String idstr) {
method getCreatedAt (line 70) | public Date getCreatedAt() {
method setCreatedAt (line 74) | public void setCreatedAt(Date createdAt) {
method getText (line 81) | public String getText() {
method setText (line 85) | public void setText(String text) {
method getSource (line 92) | public String getSource() {
method setSource (line 96) | public void setSource(String source) {
method getUser (line 103) | public User getUser() {
method setUser (line 107) | public void setUser(User user) {
method getStatus (line 114) | public Status getStatus() {
method setStatus (line 118) | public void setStatus(Status status) {
method getReplyComment (line 125) | public Comment getReplyComment() {
method setReplyComment (line 129) | public void setReplyComment(Comment replyComment) {
method parse (line 133) | public static Comment parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Display.java
type Display (line 6) | public enum Display {
method Display (line 35) | private Display(String display) {
method value (line 39) | public String value() {
method toString (line 43) | @Override
FILE: src/main/java/com/belerweb/social/weibo/bean/Geo.java
class Geo (line 14) | public class Geo extends JsonBean {
method Geo (line 16) | public Geo() {}
method Geo (line 18) | private Geo(JSONObject jsonObject) {
method getLongitude (line 35) | public Double getLongitude() {
method setLongitude (line 39) | public void setLongitude(Double longitude) {
method getLatitude (line 46) | public Double getLatitude() {
method setLatitude (line 50) | public void setLatitude(Double latitude) {
method getCity (line 57) | public String getCity() {
method setCity (line 61) | public void setCity(String city) {
method getProvince (line 68) | public String getProvince() {
method setProvince (line 72) | public void setProvince(String province) {
method getCityName (line 79) | public String getCityName() {
method setCityName (line 83) | public void setCityName(String cityName) {
method getProvinceName (line 90) | public String getProvinceName() {
method setProvinceName (line 94) | public void setProvinceName(String provinceName) {
method getAddress (line 101) | public String getAddress() {
method setAddress (line 105) | public void setAddress(String address) {
method getPinyin (line 112) | public String getPinyin() {
method setPinyin (line 116) | public void setPinyin(String pinyin) {
method getMore (line 123) | public String getMore() {
method setMore (line 127) | public void setMore(String more) {
method parse (line 131) | public static Geo parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Privacy.java
class Privacy (line 11) | public class Privacy extends JsonBean {
method Privacy (line 13) | public Privacy() {}
method Privacy (line 15) | private Privacy(JSONObject jsonObject) {
method getComment (line 30) | public Integer getComment() {
method setComment (line 34) | public void setComment(Integer comment) {
method getGeo (line 41) | public Integer getGeo() {
method setGeo (line 45) | public void setGeo(Integer geo) {
method getMessage (line 52) | public Integer getMessage() {
method setMessage (line 56) | public void setMessage(Integer message) {
method getRealname (line 63) | public Integer getRealname() {
method setRealname (line 67) | public void setRealname(Integer realname) {
method getBadge (line 74) | public Integer getBadge() {
method setBadge (line 78) | public void setBadge(Integer badge) {
method getMobile (line 85) | public Integer getMobile() {
method setMobile (line 89) | public void setMobile(Integer mobile) {
method getWebim (line 96) | public Integer getWebim() {
method setWebim (line 100) | public void setWebim(Integer webim) {
method parse (line 104) | public static Privacy parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Remind.java
class Remind (line 11) | public class Remind extends JsonBean {
method Remind (line 13) | public Remind() {}
method Remind (line 15) | private Remind(JSONObject jsonObject) {
method getStatus (line 36) | public Integer getStatus() {
method setStatus (line 40) | public void setStatus(Integer status) {
method getFollower (line 47) | public Integer getFollower() {
method setFollower (line 51) | public void setFollower(Integer follower) {
method getCmt (line 58) | public Integer getCmt() {
method setCmt (line 62) | public void setCmt(Integer cmt) {
method getDm (line 69) | public Integer getDm() {
method setDm (line 73) | public void setDm(Integer dm) {
method getMentionStatus (line 80) | public Integer getMentionStatus() {
method setMentionStatus (line 84) | public void setMentionStatus(Integer mentionStatus) {
method getMentionCmt (line 91) | public Integer getMentionCmt() {
method setMentionCmt (line 95) | public void setMentionCmt(Integer mentionCmt) {
method getGroup (line 102) | public Integer getGroup() {
method setGroup (line 106) | public void setGroup(Integer group) {
method getPrivateGroup (line 113) | public Integer getPrivateGroup() {
method setPrivateGroup (line 117) | public void setPrivateGroup(Integer privateGroup) {
method getNotice (line 124) | public Integer getNotice() {
method setNotice (line 128) | public void setNotice(Integer notice) {
method getInvite (line 135) | public Integer getInvite() {
method setInvite (line 139) | public void setInvite(Integer invite) {
method getBadge (line 146) | public Integer getBadge() {
method setBadge (line 150) | public void setBadge(Integer badge) {
method getPhoto (line 157) | public Integer getPhoto() {
method setPhoto (line 161) | public void setPhoto(Integer photo) {
method getMsgbox (line 168) | public Integer getMsgbox() {
method setMsgbox (line 172) | public void setMsgbox(Integer msgbox) {
method parse (line 176) | public static Remind parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Scope.java
type Scope (line 8) | public enum Scope {
method Scope (line 57) | private Scope(String scope) {
method value (line 61) | public String value() {
method toString (line 65) | @Override
FILE: src/main/java/com/belerweb/social/weibo/bean/Status.java
class Status (line 17) | public class Status extends JsonBean {
method Status (line 19) | public Status() {}
method Status (line 21) | private Status(JSONObject jsonObject) {
method getId (line 53) | public String getId() {
method setId (line 57) | public void setId(String id) {
method getMid (line 64) | public String getMid() {
method setMid (line 68) | public void setMid(String mid) {
method getIdstr (line 75) | public String getIdstr() {
method setIdstr (line 79) | public void setIdstr(String idstr) {
method getCreatedAt (line 86) | public Date getCreatedAt() {
method setCreatedAt (line 90) | public void setCreatedAt(Date createdAt) {
method getText (line 97) | public String getText() {
method setText (line 101) | public void setText(String text) {
method getSource (line 108) | public String getSource() {
method setSource (line 112) | public void setSource(String source) {
method getFavorited (line 119) | public Boolean getFavorited() {
method setFavorited (line 123) | public void setFavorited(Boolean favorited) {
method getTruncated (line 130) | public Boolean getTruncated() {
method setTruncated (line 134) | public void setTruncated(Boolean truncated) {
method getInReplyToStatusId (line 141) | public String getInReplyToStatusId() {
method setInReplyToStatusId (line 145) | public void setInReplyToStatusId(String inReplyToStatusId) {
method getInReplyToUserId (line 152) | public String getInReplyToUserId() {
method setInReplyToUserId (line 156) | public void setInReplyToUserId(String inReplyToUserId) {
method getInReplyToScreenName (line 163) | public String getInReplyToScreenName() {
method setInReplyToScreenName (line 167) | public void setInReplyToScreenName(String inReplyToScreenName) {
method getThumbnailPic (line 174) | public String getThumbnailPic() {
method setThumbnailPic (line 178) | public void setThumbnailPic(String thumbnailPic) {
method getBmiddlePic (line 185) | public String getBmiddlePic() {
method setBmiddlePic (line 189) | public void setBmiddlePic(String bmiddlePic) {
method getOriginalPic (line 196) | public String getOriginalPic() {
method setOriginalPic (line 200) | public void setOriginalPic(String originalPic) {
method getGeo (line 207) | public Geo getGeo() {
method setGeo (line 211) | public void setGeo(Geo geo) {
method getUser (line 218) | public User getUser() {
method setUser (line 222) | public void setUser(User user) {
method getRetweetedStatus (line 229) | public Status getRetweetedStatus() {
method setRetweetedStatus (line 233) | public void setRetweetedStatus(Status retweetedStatus) {
method getRepostsCount (line 240) | public Integer getRepostsCount() {
method setRepostsCount (line 244) | public void setRepostsCount(Integer repostsCount) {
method getCommentsCount (line 251) | public Integer getCommentsCount() {
method setCommentsCount (line 255) | public void setCommentsCount(Integer commentsCount) {
method getAttitudesCount (line 262) | public Integer getAttitudesCount() {
method setAttitudesCount (line 266) | public void setAttitudesCount(Integer attitudesCount) {
method getMlevel (line 273) | public Integer getMlevel() {
method setMlevel (line 277) | public void setMlevel(Integer mlevel) {
method getVisible (line 284) | public Visible getVisible() {
method setVisible (line 288) | public void setVisible(Visible visible) {
method getPicUrls (line 295) | public List<String> getPicUrls() {
method setPicUrls (line 299) | public void setPicUrls(List<String> picUrls) {
method getAd (line 306) | public List<String> getAd() {
method setAd (line 310) | public void setAd(List<String> ad) {
method parse (line 314) | public static Status parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/TokenInfo.java
class TokenInfo (line 8) | public class TokenInfo extends JsonBean {
method TokenInfo (line 10) | public TokenInfo() {}
method TokenInfo (line 12) | private TokenInfo(JSONObject jsonObject) {
method getUid (line 25) | public String getUid() {
method setUid (line 29) | public void setUid(String uid) {
method getAppkey (line 36) | public String getAppkey() {
method setAppkey (line 40) | public void setAppkey(String appkey) {
method getScope (line 47) | public String getScope() {
method setScope (line 51) | public void setScope(String scope) {
method getCreateAt (line 58) | public Long getCreateAt() {
method setCreateAt (line 62) | public void setCreateAt(Long createAt) {
method getExpireIn (line 70) | public Long getExpireIn() {
method setExpireIn (line 74) | public void setExpireIn(Long expireIn) {
method parse (line 78) | public static TokenInfo parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/UrlShort.java
class UrlShort (line 11) | public class UrlShort extends JsonBean {
method UrlShort (line 13) | public UrlShort() {}
method UrlShort (line 15) | private UrlShort(JSONObject jsonObject) {
method getUrlShort (line 27) | public String getUrlShort() {
method setUrlShort (line 31) | public void setUrlShort(String urlShort) {
method getUrlLong (line 38) | public String getUrlLong() {
method setUrlLong (line 42) | public void setUrlLong(String urlLong) {
method getType (line 49) | public Integer getType() {
method setType (line 53) | public void setType(Integer type) {
method getResult (line 60) | public Boolean getResult() {
method setResult (line 64) | public void setResult(Boolean result) {
method parse (line 68) | public static UrlShort parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/User.java
class User (line 18) | public class User extends JsonBean {
method User (line 20) | public User() {}
method User (line 22) | private User(JSONObject jsonObject) {
method getId (line 63) | public String getId() {
method setId (line 67) | public void setId(String id) {
method getIdstr (line 74) | public String getIdstr() {
method setIdstr (line 78) | public void setIdstr(String idstr) {
method getScreenName (line 85) | public String getScreenName() {
method setScreenName (line 89) | public void setScreenName(String screenName) {
method getName (line 96) | public String getName() {
method setName (line 100) | public void setName(String name) {
method getProvince (line 107) | public Integer getProvince() {
method setProvince (line 111) | public void setProvince(Integer province) {
method getCity (line 118) | public Integer getCity() {
method setCity (line 122) | public void setCity(Integer city) {
method getLocation (line 129) | public String getLocation() {
method setLocation (line 133) | public void setLocation(String location) {
method getDescription (line 140) | public String getDescription() {
method setDescription (line 144) | public void setDescription(String description) {
method getUrl (line 151) | public String getUrl() {
method setUrl (line 155) | public void setUrl(String url) {
method getProfileImageUrl (line 162) | public String getProfileImageUrl() {
method setProfileImageUrl (line 166) | public void setProfileImageUrl(String profileImageUrl) {
method getProfileUrl (line 173) | public String getProfileUrl() {
method setProfileUrl (line 177) | public void setProfileUrl(String profileUrl) {
method getDomain (line 184) | public String getDomain() {
method setDomain (line 188) | public void setDomain(String domain) {
method getWeihao (line 195) | public String getWeihao() {
method setWeihao (line 199) | public void setWeihao(String weihao) {
method getGender (line 206) | public Gender getGender() {
method setGender (line 210) | public void setGender(Gender gender) {
method getFollowersCount (line 217) | public Integer getFollowersCount() {
method setFollowersCount (line 221) | public void setFollowersCount(Integer followersCount) {
method getFriendsCount (line 228) | public Integer getFriendsCount() {
method setFriendsCount (line 232) | public void setFriendsCount(Integer friendsCount) {
method getStatusesCount (line 239) | public Integer getStatusesCount() {
method setStatusesCount (line 243) | public void setStatusesCount(Integer statusesCount) {
method getFavouritesCount (line 250) | public Integer getFavouritesCount() {
method setFavouritesCount (line 254) | public void setFavouritesCount(Integer favouritesCount) {
method getCreatedAt (line 261) | public Date getCreatedAt() {
method setCreatedAt (line 265) | public void setCreatedAt(Date createdAt) {
method getFollowing (line 272) | public Boolean getFollowing() {
method setFollowing (line 276) | public void setFollowing(Boolean following) {
method getAllowAllActMsg (line 283) | public Boolean getAllowAllActMsg() {
method setAllowAllActMsg (line 287) | public void setAllowAllActMsg(Boolean allowAllActMsg) {
method getGeoEnabled (line 294) | public Boolean getGeoEnabled() {
method setGeoEnabled (line 298) | public void setGeoEnabled(Boolean geoEnabled) {
method getVerified (line 305) | public Boolean getVerified() {
method setVerified (line 309) | public void setVerified(Boolean verified) {
method getVerifiedType (line 316) | public Integer getVerifiedType() {
method setVerifiedType (line 320) | public void setVerifiedType(Integer verifiedType) {
method getRemark (line 327) | public String getRemark() {
method setRemark (line 331) | public void setRemark(String remark) {
method getStatus (line 338) | public Status getStatus() {
method setStatus (line 342) | public void setStatus(Status status) {
method getAllowAllComment (line 349) | public Boolean getAllowAllComment() {
method setAllowAllComment (line 353) | public void setAllowAllComment(Boolean allowAllComment) {
method getAvatarLarge (line 360) | public String getAvatarLarge() {
method setAvatarLarge (line 364) | public void setAvatarLarge(String avatarLarge) {
method getVerifiedReason (line 371) | public String getVerifiedReason() {
method setVerifiedReason (line 375) | public void setVerifiedReason(String verifiedReason) {
method getFollowMe (line 382) | public Boolean getFollowMe() {
method setFollowMe (line 386) | public void setFollowMe(Boolean followMe) {
method getOnlineStatus (line 393) | public OnlineStatus getOnlineStatus() {
method setOnlineStatus (line 397) | public void setOnlineStatus(OnlineStatus onlineStatus) {
method getBiFollowersCount (line 404) | public Integer getBiFollowersCount() {
method setBiFollowersCount (line 408) | public void setBiFollowersCount(Integer biFollowersCount) {
method getLang (line 415) | public String getLang() {
method setLang (line 419) | public void setLang(String lang) {
method parse (line 423) | public static User parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/UserCounts.java
class UserCounts (line 11) | public class UserCounts extends JsonBean {
method UserCounts (line 13) | public UserCounts() {}
method UserCounts (line 15) | private UserCounts(JSONObject jsonObject) {
method getId (line 28) | public String getId() {
method setId (line 32) | public void setId(String id) {
method getFollowersCount (line 39) | public Integer getFollowersCount() {
method setFollowersCount (line 43) | public void setFollowersCount(Integer followersCount) {
method getFriendsCount (line 50) | public Integer getFriendsCount() {
method setFriendsCount (line 54) | public void setFriendsCount(Integer friendsCount) {
method getStatusesCount (line 61) | public Integer getStatusesCount() {
method setStatusesCount (line 65) | public void setStatusesCount(Integer statusesCount) {
method getPrivateFriendsCount (line 72) | public Integer getPrivateFriendsCount() {
method setPrivateFriendsCount (line 76) | public void setPrivateFriendsCount(Integer privateFriendsCount) {
method parse (line 81) | public static UserCounts parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weibo/bean/Visible.java
class Visible (line 11) | public class Visible extends JsonBean {
method Visible (line 13) | public Visible() {}
method Visible (line 15) | private Visible(JSONObject jsonObject) {
method getType (line 25) | public Integer getType() {
method setType (line 29) | public void setType(Integer type) {
method getListId (line 36) | public Integer getListId() {
method setListId (line 40) | public void setListId(Integer listId) {
method parse (line 44) | public static Visible parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/api/Group.java
class Group (line 21) | public class Group extends API {
method Group (line 23) | protected Group(Weixin weixin) {
method get (line 30) | public Result<List<com.belerweb.social.weixin.bean.Group>> get() {
method get (line 39) | public Result<List<com.belerweb.social.weixin.bean.Group>> get(String ...
method create (line 59) | public Result<com.belerweb.social.weixin.bean.Group> create(String nam...
method create (line 71) | public Result<com.belerweb.social.weixin.bean.Group> create(String acc...
method update (line 99) | public Result<Error> update(String id, String name) {
method update (line 110) | public Result<Error> update(String accessToken, String id, String name) {
method move (line 133) | public Result<Error> move(String openId, String groupId) {
method move (line 144) | public Result<Error> move(String accessToken, String openId, String gr...
FILE: src/main/java/com/belerweb/social/weixin/api/Media.java
class Media (line 32) | public class Media extends API {
method Media (line 34) | protected Media(Weixin weixin) {
method upload (line 44) | public Result<com.belerweb.social.weixin.bean.Media> upload(MediaType ...
method upload (line 64) | public Result<com.belerweb.social.weixin.bean.Media> upload(String acc...
method get (line 96) | public Result<com.belerweb.social.weixin.bean.Media> get(String mediaI...
method get (line 108) | public Result<com.belerweb.social.weixin.bean.Media> get(String access...
FILE: src/main/java/com/belerweb/social/weixin/api/Menu.java
class Menu (line 23) | public class Menu extends API {
method Menu (line 25) | protected Menu(Weixin weixin) {
method create (line 34) | public Result<Error> create(List<com.belerweb.social.weixin.bean.Menu>...
method create (line 47) | public Result<Error> create(String accessToken, List<com.belerweb.soci...
method get (line 97) | public Result<List<com.belerweb.social.weixin.bean.Menu>> get() {
method get (line 106) | public Result<List<com.belerweb.social.weixin.bean.Menu>> get(String a...
method delete (line 127) | public Result<Error> delete() {
method delete (line 136) | public Result<Error> delete(String accessToken) {
FILE: src/main/java/com/belerweb/social/weixin/api/OAuth2.java
class OAuth2 (line 16) | public final class OAuth2 extends API {
method OAuth2 (line 18) | OAuth2(Weixin weixin) {
method authorize (line 29) | public String authorize() {
method authorize (line 40) | public String authorize(Boolean wechatRedirect) {
method authorize (line 52) | public String authorize(String redirectUri) {
method authorize (line 64) | public String authorize(String redirectUri, Boolean wechatRedirect) {
method authorize (line 81) | public String authorize(String appId, String redirectUri, String respo...
method authorizeLogin (line 112) | public String authorizeLogin(String state) {
method accessToken (line 136) | public Result<AccessToken> accessToken(String code) {
method accessToken (line 148) | public Result<AccessToken> accessToken(String appId, String secret, St...
method accessToken (line 160) | public Result<AccessToken> accessToken(String appId, String secret, St...
method refreshAccessToken (line 178) | public Result<AccessToken> refreshAccessToken(String refreshToken) {
method refreshAccessToken (line 188) | public Result<AccessToken> refreshAccessToken(String appId, String ref...
method refreshAccessToken (line 199) | public Result<AccessToken> refreshAccessToken(String appId, String gra...
FILE: src/main/java/com/belerweb/social/weixin/api/User.java
class User (line 24) | public class User extends API {
method User (line 26) | protected User(Weixin weixin) {
method snsapiUserInfo (line 38) | public Result<com.belerweb.social.weixin.bean.User> snsapiUserInfo(Str...
method userInfo (line 56) | public Result<com.belerweb.social.weixin.bean.User> userInfo(String ac...
method getFollowUsers (line 67) | public Result<List<com.belerweb.social.weixin.bean.User>> getFollowUse...
method getFollowUsers (line 76) | public Result<List<com.belerweb.social.weixin.bean.User>> getFollowUse...
method getFollowers (line 98) | public Result<GetFollowersResult> getFollowers() {
method getFollowers (line 107) | public Result<GetFollowersResult> getFollowers(String accessToken) {
method getFollowers (line 141) | public Result<GetFollowersResult> getFollowers(String accessToken, Str...
FILE: src/main/java/com/belerweb/social/weixin/api/Weixin.java
class Weixin (line 31) | public final class Weixin extends SDK {
method Weixin (line 62) | public Weixin(String token) {
method Weixin (line 73) | public Weixin(String appId, String secret) {
method Weixin (line 89) | public Weixin(String appId, String secret, String token) {
method Weixin (line 94) | public Weixin(String appid, String secret, String redirectUri, String ...
method validate (line 109) | public boolean validate(String signature, String timestamp, String non...
method signature (line 128) | public String signature(String... args) {
method jsapiSignature (line 144) | public String jsapiSignature(String url, long timestamp, String nonce) {
method getAppId (line 154) | public String getAppId() {
method setAppId (line 158) | public void setAppId(String appId) {
method getSecret (line 162) | public String getSecret() {
method setSecret (line 166) | public void setSecret(String secret) {
method getRedirectUri (line 170) | public String getRedirectUri() {
method setRedirectUri (line 174) | public void setRedirectUri(String redirectUri) {
method getAccessToken (line 186) | public synchronized AccessToken getAccessToken() {
method getApiTicket (line 214) | public synchronized ApiTicket getApiTicket() {
method getJsApiTicket (line 241) | public synchronized JSApiTicket getJsApiTicket() {
method createQR (line 270) | public Result<QRTicket> createQR(QRType type, Integer sceneId) {
method createQR (line 285) | public Result<QRTicket> createQR(String accessToken, QRType type, Inte...
method sendCustomMessage (line 309) | public Result<Boolean> sendCustomMessage(Message message) {
method sendCustomMessage (line 324) | public Result<Boolean> sendCustomMessage(String accessToken, Message m...
method sendTemplateMessage (line 363) | public Result<Boolean> sendTemplateMessage(Message message) {
method sendTemplateMessage (line 394) | public Result<Boolean> sendTemplateMessage(String accessToken, Message...
method getToken (line 410) | public String getToken() {
method setToken (line 414) | public void setToken(String token) {
method getOAuth2 (line 418) | public OAuth2 getOAuth2() {
method getUser (line 426) | public User getUser() {
method getGroup (line 434) | public Group getGroup() {
method getMedia (line 442) | public Media getMedia() {
method getMenu (line 450) | public Menu getMenu() {
FILE: src/main/java/com/belerweb/social/weixin/bean/AccessToken.java
class AccessToken (line 11) | public class AccessToken extends JsonBean {
method AccessToken (line 13) | public AccessToken() {}
method AccessToken (line 15) | private AccessToken(JSONObject jsonObject) {
method getToken (line 29) | public String getToken() {
method setToken (line 33) | public void setToken(String token) {
method getExpiresIn (line 40) | public Long getExpiresIn() {
method setExpiresIn (line 44) | public void setExpiresIn(Long expiresIn) {
method getRefreshToken (line 51) | public String getRefreshToken() {
method setRefreshToken (line 55) | public void setRefreshToken(String refreshToken) {
method getOpenId (line 62) | public String getOpenId() {
method setOpenId (line 66) | public void setOpenId(String openId) {
method getScope (line 73) | public Scope getScope() {
method setScope (line 77) | public void setScope(Scope scope) {
method getUnionid (line 81) | public String getUnionid() {
method setUnionid (line 85) | public void setUnionid(String unionid) {
method parse (line 89) | public static AccessToken parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/ApiTicket.java
class ApiTicket (line 11) | public class ApiTicket extends JsonBean {
method ApiTicket (line 13) | public ApiTicket() {}
method ApiTicket (line 15) | private ApiTicket(JSONObject jsonObject) {
method getTicket (line 22) | public String getTicket() {
method setTicket (line 26) | public void setTicket(String ticket) {
method getExpiresIn (line 30) | public Long getExpiresIn() {
method setExpiresIn (line 34) | public void setExpiresIn(Long expiresIn) {
method parse (line 38) | public static ApiTicket parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Article.java
class Article (line 6) | public class Article {
method getTitle (line 16) | public String getTitle() {
method setTitle (line 20) | public void setTitle(String title) {
method getDescription (line 27) | public String getDescription() {
method setDescription (line 31) | public void setDescription(String description) {
method getPicUrl (line 38) | public String getPicUrl() {
method setPicUrl (line 42) | public void setPicUrl(String picUrl) {
method getUrl (line 49) | public String getUrl() {
method setUrl (line 53) | public void setUrl(String url) {
FILE: src/main/java/com/belerweb/social/weixin/bean/EventType.java
type EventType (line 7) | public enum EventType {
method EventType (line 41) | private EventType(String type) {
method value (line 45) | public String value() {
method toString (line 49) | @Override
method parse (line 54) | public static EventType parse(Object val) {
FILE: src/main/java/com/belerweb/social/weixin/bean/GetFollowersResult.java
class GetFollowersResult (line 15) | public class GetFollowersResult extends JsonBean {
method GetFollowersResult (line 17) | public GetFollowersResult() {}
method GetFollowersResult (line 19) | private GetFollowersResult(JSONObject jsonObject) {
method getTotal (line 31) | public Integer getTotal() {
method setTotal (line 35) | public void setTotal(Integer total) {
method getCount (line 42) | public Integer getCount() {
method setCount (line 46) | public void setCount(Integer count) {
method getOpenIds (line 53) | public List<String> getOpenIds() {
method setOpenIds (line 57) | public void setOpenIds(List<String> openIds) {
method getNextOpenid (line 64) | public String getNextOpenid() {
method setNextOpenid (line 68) | public void setNextOpenid(String nextOpenid) {
method parse (line 72) | public static GetFollowersResult parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Group.java
class Group (line 11) | public class Group extends JsonBean {
method Group (line 13) | public Group() {}
method Group (line 15) | private Group(JSONObject jsonObject) {
method getId (line 26) | public String getId() {
method setId (line 30) | public void setId(String id) {
method getName (line 37) | public String getName() {
method setName (line 41) | public void setName(String name) {
method getCount (line 48) | public Integer getCount() {
method setCount (line 52) | public void setCount(Integer count) {
method parse (line 56) | public static Group parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/JSApiTicket.java
class JSApiTicket (line 11) | public class JSApiTicket extends JsonBean {
method JSApiTicket (line 13) | public JSApiTicket() {}
method JSApiTicket (line 15) | private JSApiTicket(JSONObject jsonObject) {
method getTicket (line 22) | public String getTicket() {
method setTicket (line 26) | public void setTicket(String ticket) {
method getExpiresIn (line 30) | public Long getExpiresIn() {
method setExpiresIn (line 34) | public void setExpiresIn(Long expiresIn) {
method parse (line 38) | public static JSApiTicket parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Media.java
class Media (line 7) | public class Media {
method getId (line 14) | public String getId() {
method setId (line 18) | public void setId(String id) {
method getName (line 22) | public String getName() {
method setName (line 26) | public void setName(String name) {
method getContentType (line 30) | public String getContentType() {
method setContentType (line 34) | public void setContentType(String contentType) {
method getContent (line 38) | public byte[] getContent() {
method setContent (line 42) | public void setContent(byte[] content) {
FILE: src/main/java/com/belerweb/social/weixin/bean/MediaType.java
type MediaType (line 7) | public enum MediaType {
method MediaType (line 41) | private MediaType(String type) {
method value (line 45) | public String value() {
method toString (line 49) | @Override
method contentType (line 54) | public String contentType() {
FILE: src/main/java/com/belerweb/social/weixin/bean/Menu.java
class Menu (line 14) | public class Menu extends JsonBean {
method Menu (line 16) | public Menu() {}
method Menu (line 18) | private Menu(JSONObject jsonObject) {
method getType (line 28) | public MenuType getType() {
method setType (line 32) | public void setType(MenuType type) {
method getKey (line 36) | public String getKey() {
method setKey (line 40) | public void setKey(String key) {
method getUrl (line 44) | public String getUrl() {
method setUrl (line 48) | public void setUrl(String url) {
method getName (line 52) | public String getName() {
method setName (line 56) | public void setName(String name) {
method getSubs (line 60) | public List<Menu> getSubs() {
method setSubs (line 64) | public void setSubs(List<Menu> subs) {
method parse (line 68) | public static Menu parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/MenuType.java
type MenuType (line 7) | public enum MenuType {
method MenuType (line 53) | private MenuType(String type) {
method value (line 57) | public String value() {
method toString (line 61) | @Override
method parse (line 66) | public static MenuType parse(Object val) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Message.java
class Message (line 18) | public class Message extends JsonBean {
method Message (line 20) | public Message() {}
method Message (line 22) | public Message(MsgType msgType) {
method Message (line 26) | private Message(JSONObject jsonObject) {
method getMsgId (line 67) | public Long getMsgId() {
method setMsgId (line 71) | public void setMsgId(Long msgId) {
method getFromUser (line 78) | public String getFromUser() {
method setFromUser (line 82) | public void setFromUser(String fromUser) {
method getToUser (line 89) | public String getToUser() {
method setToUser (line 93) | public void setToUser(String toUser) {
method getCreateTime (line 100) | public Date getCreateTime() {
method setCreateTime (line 104) | public void setCreateTime(Date createTime) {
method getMsgType (line 111) | public MsgType getMsgType() {
method setMsgType (line 115) | public void setMsgType(MsgType msgType) {
method getContent (line 122) | public String getContent() {
method setContent (line 126) | public void setContent(String content) {
method getMediaId (line 133) | public String getMediaId() {
method setMediaId (line 137) | public void setMediaId(String mediaId) {
method getPicUrl (line 144) | public String getPicUrl() {
method setPicUrl (line 148) | public void setPicUrl(String picUrl) {
method getVoiceType (line 155) | public VoiceType getVoiceType() {
method setVoiceType (line 159) | public void setVoiceType(VoiceType voiceType) {
method getRecognition (line 167) | public String getRecognition() {
method setRecognition (line 171) | public void setRecognition(String recognition) {
method getThumbMediaId (line 178) | public String getThumbMediaId() {
method setThumbMediaId (line 182) | public void setThumbMediaId(String thumbMediaId) {
method getLon (line 189) | public Double getLon() {
method setLon (line 193) | public void setLon(Double lon) {
method getLat (line 200) | public Double getLat() {
method setLat (line 204) | public void setLat(Double lat) {
method getScale (line 211) | public Integer getScale() {
method setScale (line 215) | public void setScale(Integer scale) {
method getLabel (line 222) | public String getLabel() {
method setLabel (line 226) | public void setLabel(String label) {
method getTitle (line 233) | public String getTitle() {
method setTitle (line 237) | public void setTitle(String title) {
method getDescription (line 244) | public String getDescription() {
method setDescription (line 248) | public void setDescription(String description) {
method getUrl (line 255) | public String getUrl() {
method setUrl (line 259) | public void setUrl(String url) {
method getMusicUrl (line 266) | public String getMusicUrl() {
method setMusicUrl (line 270) | public void setMusicUrl(String musicUrl) {
method getHqMusicUrl (line 277) | public String getHqMusicUrl() {
method setHqMusicUrl (line 281) | public void setHqMusicUrl(String hqMusicUrl) {
method getEventType (line 288) | public EventType getEventType() {
method setEventType (line 292) | public void setEventType(EventType eventType) {
method getEventKey (line 299) | public String getEventKey() {
method setEventKey (line 303) | public void setEventKey(String eventKey) {
method getTicket (line 312) | public String getTicket() {
method setTicket (line 316) | public void setTicket(String ticket) {
method getPrecision (line 323) | public Double getPrecision() {
method setPrecision (line 327) | public void setPrecision(Double precision) {
method getArticles (line 334) | public List<Article> getArticles() {
method setArticles (line 338) | public void setArticles(List<Article> articles) {
method getTemplateId (line 345) | public String getTemplateId() {
method setTemplateId (line 349) | public void setTemplateId(String templateId) {
method getTopColor (line 356) | public String getTopColor() {
method setTopColor (line 360) | public void setTopColor(String topColor) {
method getVariables (line 369) | public List<Variable> getVariables() {
method setVariables (line 376) | public void setVariables(List<Variable> variables) {
method addVariable (line 380) | public Message addVariable(Variable variable) {
method toXML (line 388) | public String toXML() {
method toJSON (line 443) | public String toJSON() {
method parse (line 513) | public static Message parse(String xml) {
method parse (line 517) | public static Message parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/MsgType.java
type MsgType (line 7) | public enum MsgType {
method MsgType (line 71) | private MsgType(String type) {
method value (line 75) | public String value() {
method toString (line 79) | @Override
method parse (line 84) | public static MsgType parse(Object val) {
FILE: src/main/java/com/belerweb/social/weixin/bean/QRCreation.java
class QRCreation (line 5) | public class QRCreation {
method getType (line 11) | public QRType getType() {
method setType (line 15) | public void setType(QRType type) {
method getExpireSeconds (line 19) | public Integer getExpireSeconds() {
method setExpireSeconds (line 23) | public void setExpireSeconds(Integer expireSeconds) {
method getSceneId (line 27) | public Integer getSceneId() {
method setSceneId (line 31) | public void setSceneId(Integer sceneId) {
method toString (line 35) | @Override
FILE: src/main/java/com/belerweb/social/weixin/bean/QRTicket.java
class QRTicket (line 11) | public class QRTicket extends JsonBean {
method QRTicket (line 13) | public QRTicket() {}
method QRTicket (line 15) | private QRTicket(JSONObject jsonObject) {
method getTicket (line 25) | public String getTicket() {
method setTicket (line 29) | public void setTicket(String ticket) {
method getQRUrl (line 36) | public String getQRUrl() {
method getExpireSeconds (line 43) | public Integer getExpireSeconds() {
method setExpireSeconds (line 47) | public void setExpireSeconds(Integer expireSeconds) {
method parse (line 51) | public static QRTicket parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/QRType.java
type QRType (line 7) | public enum QRType {
method QRType (line 21) | private QRType(String type) {
method value (line 25) | public String value() {
method toString (line 29) | @Override
method parse (line 34) | public static QRType parse(Object val) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Scope.java
type Scope (line 7) | public enum Scope {
method Scope (line 26) | private Scope(String scope) {
method value (line 30) | public String value() {
method toString (line 34) | @Override
method parse (line 39) | public static Scope parse(Object val) {
FILE: src/main/java/com/belerweb/social/weixin/bean/User.java
class User (line 15) | public class User extends JsonBean {
method User (line 17) | public User() {}
method User (line 19) | private User(JSONObject jsonObject) {
method getOpenId (line 39) | public String getOpenId() {
method setOpenId (line 43) | public void setOpenId(String openId) {
method getNickname (line 50) | public String getNickname() {
method setNickname (line 54) | public void setNickname(String nickname) {
method getGender (line 61) | public Gender getGender() {
method setGender (line 65) | public void setGender(Gender gender) {
method getProvince (line 72) | public String getProvince() {
method setProvince (line 76) | public void setProvince(String province) {
method getCity (line 83) | public String getCity() {
method setCity (line 87) | public void setCity(String city) {
method getCountry (line 94) | public String getCountry() {
method setCountry (line 98) | public void setCountry(String country) {
method getPrivilege (line 105) | public List<String> getPrivilege() {
method setPrivilege (line 109) | public void setPrivilege(List<String> privilege) {
method getLanguage (line 116) | public String getLanguage() {
method setLanguage (line 120) | public void setLanguage(String language) {
method getHeadImgUrl (line 127) | public String getHeadImgUrl() {
method setHeadImgUrl (line 131) | public void setHeadImgUrl(String headImgUrl) {
method getSubscribe (line 138) | public Boolean getSubscribe() {
method setSubscribe (line 142) | public void setSubscribe(Boolean subscribe) {
method getSubscribeTime (line 149) | public Date getSubscribeTime() {
method setSubscribeTime (line 153) | public void setSubscribeTime(Date subscribeTime) {
method getUnionID (line 162) | public String getUnionID() {
method setUnionID (line 166) | public void setUnionID(String unionID) {
method parse (line 170) | public static User parse(JSONObject jsonObject) {
FILE: src/main/java/com/belerweb/social/weixin/bean/Variable.java
class Variable (line 8) | public class Variable {
method Variable (line 14) | public Variable() {}
method Variable (line 16) | public Variable(String name, String value) {
method Variable (line 21) | public Variable(String name, String value, String color) {
method getName (line 30) | public String getName() {
method setName (line 34) | public void setName(String name) {
method getValue (line 41) | public String getValue() {
method setValue (line 45) | public void setValue(String value) {
method getColor (line 52) | public String getColor() {
method setColor (line 56) | public void setColor(String color) {
FILE: src/main/java/com/belerweb/social/weixin/bean/VoiceType.java
type VoiceType (line 7) | public enum VoiceType {
method VoiceType (line 21) | private VoiceType(String type) {
method value (line 25) | public String value() {
method toString (line 29) | @Override
method parse (line 34) | public static VoiceType parse(Object val) {
FILE: src/test/java/com/belerweb/social/SDKTest.java
class SDKTest (line 10) | public class SDKTest extends TestConfig {
method testLonLatToAddress (line 14) | @Test
FILE: src/test/java/com/belerweb/social/TestConfig.java
class TestConfig (line 9) | public class TestConfig {
method initialize (line 15) | @Before
FILE: src/test/java/com/belerweb/social/captcha/api/YundamaTest.java
class YundamaTest (line 11) | public class YundamaTest {
method testDecode (line 15) | @Test
FILE: src/test/java/com/belerweb/social/mail/api/POP3Test.java
class POP3Test (line 7) | public class POP3Test {
method testDownload (line 9) | @Test
FILE: src/test/java/com/belerweb/social/qq/connect/api/OAuth2Test.java
class OAuth2Test (line 13) | public class OAuth2Test extends TestConfig {
method testAuthorize (line 17) | @Test
method testAuthorizeWap (line 24) | @Test
method testAccessToken (line 31) | @Test
method testAccessTokenWap (line 43) | @Test
method testOpenId (line 55) | @Test
method testOpenIdWap (line 63) | @Test
method testRefreshAccessToken (line 71) | @Test
method testRefreshAccessTokenWap (line 79) | @Test
FILE: src/test/java/com/belerweb/social/qq/connect/api/UserTest.java
class UserTest (line 11) | public class UserTest extends TestConfig {
method testGetUserInfo (line 14) | @Test
method testGetSimpleUserInfo (line 25) | @Test
FILE: src/test/java/com/belerweb/social/weibo/api/OAuth2Test.java
class OAuth2Test (line 13) | public class OAuth2Test extends TestConfig {
method testAuthorize (line 20) | @Test
method testAccessToken (line 30) | @Test
method testGetTokenInfo (line 42) | @Test
method testRevokeOAuth2 (line 50) | @Test
FILE: src/test/java/com/belerweb/social/weibo/api/UserTest.java
class UserTest (line 15) | public class UserTest extends TestConfig {
method testShow (line 19) | @Test
method testDomainShow (line 28) | @Test
method testCounts (line 36) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/GroupTest.java
class GroupTest (line 16) | public class GroupTest extends TestConfig {
method testCreate (line 19) | @Test
method testGet (line 26) | @Test
method testUpdate (line 35) | @Test
method testMove (line 42) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/MediaTest.java
class MediaTest (line 16) | public class MediaTest extends TestConfig {
method testUpload (line 19) | @Test
method testGet (line 32) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/MenuTest.java
class MenuTest (line 16) | public class MenuTest extends TestConfig {
method testGet (line 18) | @Test
method testDelete (line 24) | @Test
method testCreate (line 30) | @Test
method testCreate1 (line 52) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/OAuth2Test.java
class OAuth2Test (line 12) | public class OAuth2Test extends TestConfig {
method testAuthorize (line 15) | @Test
method testAccessToken (line 22) | @Test
method testRefreshAccessToken (line 34) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/UserTest.java
class UserTest (line 13) | public class UserTest extends TestConfig {
method testSnsapiUserInfo (line 17) | @Test
method testUserInfo (line 27) | @Test
method testGetFollowUsers (line 36) | @Test
FILE: src/test/java/com/belerweb/social/weixin/api/WeixinTest.java
class WeixinTest (line 25) | public class WeixinTest extends TestConfig {
method testGetAccessToken (line 28) | @Test
method testGetJSApiTicket (line 35) | @Test
method testGetApiTicket (line 42) | @Test
method testSignature (line 49) | @Test
method testJsApiSignature (line 58) | @Test
method testCreateQR (line 67) | @Test
method testCreateQR2 (line 74) | @Test
method testSendCustomMessage (line 82) | @Test
method testSendTemplateMessage (line 91) | @Test
method testSendTemplateMessage1 (line 106) | @Test
Condensed preview — 114 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (464K chars).
[
{
"path": ".gitignore",
"chars": 794,
"preview": "# Eclipse\n.externalToolBuilders/\n.settings/\nbin/\ntmp/\n.metadata\n.gradle\n*.tmp\n*.bak\n*.swp\n*~.nib\nlocal.properties\n.loadp"
},
{
"path": "README.md",
"chars": 1871,
"preview": "social-sdk\n==========\n\nsocial-sdk是一个集成[新浪微博开放平台][1]、[QQ互联][2]、[腾讯微博开发平台][3]、[微信公众平台][4]等社交平台的接口的Java库。\n\n\n\n其实在开始这个项目之前,各个"
},
{
"path": "eclipse-java-google-style.xml",
"chars": 30884,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<profiles version=\"11\">\n<profile kind=\"CodeFormatterProfile\" name"
},
{
"path": "pom.xml",
"chars": 4948,
"preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocat"
},
{
"path": "src/main/java/com/belerweb/social/API.java",
"chars": 590,
"preview": "package com.belerweb.social;\n\nimport com.belerweb.social.qq.connect.api.QQConnect;\nimport com.belerweb.social.qq.t.api.Q"
},
{
"path": "src/main/java/com/belerweb/social/SDK.java",
"chars": 3242,
"preview": "package com.belerweb.social;\n\nimport java.nio.charset.Charset;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimpor"
},
{
"path": "src/main/java/com/belerweb/social/bean/Error.java",
"chars": 2186,
"preview": "package com.belerweb.social.bean;\n\nimport org.json.JSONObject;\n\npublic final class Error extends JsonBean {\n\n private S"
},
{
"path": "src/main/java/com/belerweb/social/bean/Gender.java",
"chars": 1503,
"preview": "package com.belerweb.social.bean;\n\npublic enum Gender {\n\n MALE(1, \"m\", \"男\", \"Male\"), FEMALE(0, \"f\", \"女\", \"Female\"), UNK"
},
{
"path": "src/main/java/com/belerweb/social/bean/JsonBean.java",
"chars": 312,
"preview": "package com.belerweb.social.bean;\n\nimport org.json.JSONObject;\n\npublic abstract class JsonBean {\n\n private JSONObject j"
},
{
"path": "src/main/java/com/belerweb/social/bean/OnlineStatus.java",
"chars": 1017,
"preview": "package com.belerweb.social.bean;\n\npublic enum OnlineStatus {\n\n ONLINE(1, \"在线\", \"online\"), OFFLINE(0, \"不在线\", \"offline\")"
},
{
"path": "src/main/java/com/belerweb/social/bean/Result.java",
"chars": 4868,
"preview": "package com.belerweb.social.bean;\n\nimport java.lang.reflect.Method;\nimport java.text.ParseException;\nimport java.text.Si"
},
{
"path": "src/main/java/com/belerweb/social/captcha/api/Yundama.java",
"chars": 2919,
"preview": "package com.belerweb.social.captcha.api;\n\nimport java.io.IOException;\n\nimport org.apache.commons.io.IOUtils;\nimport org."
},
{
"path": "src/main/java/com/belerweb/social/captcha/bean/YundamaType.java",
"chars": 1654,
"preview": "package com.belerweb.social.captcha.bean;\n\n\npublic enum YundamaType {\n /**\n * 不定长英文数字 2.5题分一个字符(按文本长度收费)\n */\n ALPH"
},
{
"path": "src/main/java/com/belerweb/social/exception/SocialException.java",
"chars": 312,
"preview": "package com.belerweb.social.exception;\n\npublic class SocialException extends RuntimeException {\n\n private static final "
},
{
"path": "src/main/java/com/belerweb/social/http/Http.java",
"chars": 11413,
"preview": "package com.belerweb.social.http;\n\nimport java.io.IOException;\nimport java.io.UnsupportedEncodingException;\nimport java."
},
{
"path": "src/main/java/com/belerweb/social/http/HttpException.java",
"chars": 297,
"preview": "package com.belerweb.social.http;\n\n\n\npublic class HttpException extends Exception {\n\n private static final long serialV"
},
{
"path": "src/main/java/com/belerweb/social/mail/api/POP3.java",
"chars": 3858,
"preview": "package com.belerweb.social.mail.api;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/api/OAuth2.java",
"chars": 11368,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commo"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/api/QQConnect.java",
"chars": 20082,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Li"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/api/QZone.java",
"chars": 9464,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Li"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/api/User.java",
"chars": 5878,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.http."
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/api/Weibo.java",
"chars": 10670,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.http."
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/AccessToken.java",
"chars": 1410,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Album.java",
"chars": 2036,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.s"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/AlbumPrivilege.java",
"chars": 674,
"preview": "package com.belerweb.social.qq.connect.bean;\n\npublic enum AlbumPrivilege {\n PUBLIC(1), PRIVATE(3), FRIEND(4), QUESTION("
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Company.java",
"chars": 1697,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Display.java",
"chars": 94,
"preview": "package com.belerweb.social.qq.connect.bean;\n\npublic enum Display {\n\n DEFAULT,\n\n MOBILE;\n\n}\n"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Education.java",
"chars": 1672,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/FanList.java",
"chars": 1227,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\nimport java.util.List;\n\nimport org.json.JSONObject;"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Gut.java",
"chars": 315,
"preview": "package com.belerweb.social.qq.connect.bean;\n\n/**\n * QQ登录页面版本\n */\npublic enum Gut {\n\n WML(1),\n\n XHTML(2);\n\n private i"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/IdolList.java",
"chars": 1233,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\nimport java.util.List;\n\nimport org.json.JSONObject;"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Image.java",
"chars": 1068,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Music.java",
"chars": 1081,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/NewT.java",
"chars": 1119,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.s"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/OpenID.java",
"chars": 1002,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\n\npu"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Photo.java",
"chars": 2381,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\nimport java.util.Locale;\n\nimport org.json.JSONObjec"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/PicUploadResult.java",
"chars": 2010,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/RepostList.java",
"chars": 1911,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.Iterator"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Scope.java",
"chars": 2050,
"preview": "package com.belerweb.social.qq.connect.bean;\n\n/**\n * 请求用户授权时向用户显示的可进行授权的列表。\n */\npublic enum Scope {\n\n /**\n * do_like\n"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/SendPrivate.java",
"chars": 595,
"preview": "package com.belerweb.social.qq.connect.bean;\n\npublic enum SendPrivate {\n IDOL(0), FRIEND(1), PUBLIC(2);\n\n private Inte"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Tag.java",
"chars": 831,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/TenpayAddress.java",
"chars": 2119,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\n\n/**\n * 财付通收货地址\n */\npublic class TenpayAddress {\n\n "
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/TweetInfo.java",
"chars": 6088,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.s"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/User.java",
"chars": 10796,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.Date;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.s"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/Video.java",
"chars": 1574,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimp"
},
{
"path": "src/main/java/com/belerweb/social/qq/connect/bean/WeiboUser.java",
"chars": 11213,
"preview": "package com.belerweb.social.qq.connect.bean;\n\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.List;\n"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/api/Contact.java",
"chars": 18035,
"preview": "package com.belerweb.social.qq.mail.api;\n\nimport java.io.IOException;\nimport java.net.URLEncoder;\nimport java.util.Array"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/Address.java",
"chars": 1127,
"preview": "package com.belerweb.social.qq.mail.bean;\n\npublic class Address {\n\n private String label;\n private String type;\n priv"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/Email.java",
"chars": 493,
"preview": "package com.belerweb.social.qq.mail.bean;\n\npublic class Email {\n\n private String label;\n private String type;\n privat"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/Group.java",
"chars": 789,
"preview": "package com.belerweb.social.qq.mail.bean;\n\nimport java.util.List;\n\npublic class Group {\n\n private String id;\n private "
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/Org.java",
"chars": 484,
"preview": "package com.belerweb.social.qq.mail.bean;\n\npublic class Org {\n\n private String org1;\n private String org2;\n private S"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/Tel.java",
"chars": 477,
"preview": "package com.belerweb.social.qq.mail.bean;\n\npublic class Tel {\n\n private String label;\n private String type;\n private "
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/User.java",
"chars": 2736,
"preview": "package com.belerweb.social.qq.mail.bean;\n\nimport java.util.List;\n\npublic class User {\n\n private String id;\n private S"
},
{
"path": "src/main/java/com/belerweb/social/qq/mail/bean/ValidationCode.java",
"chars": 918,
"preview": "package com.belerweb.social.qq.mail.bean;\n\npublic class ValidationCode {\n\n private String status;\n private String code"
},
{
"path": "src/main/java/com/belerweb/social/qq/qzone/api/Visitor.java",
"chars": 10382,
"preview": "package com.belerweb.social.qq.qzone.api;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List"
},
{
"path": "src/main/java/com/belerweb/social/qq/t/api/OAuth2.java",
"chars": 2151,
"preview": "package com.belerweb.social.qq.t.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.lan"
},
{
"path": "src/main/java/com/belerweb/social/qq/t/api/QQT.java",
"chars": 932,
"preview": "package com.belerweb.social.qq.t.api;\n\nimport com.belerweb.social.SDK;\n\npublic final class QQT extends SDK {\n\n private "
},
{
"path": "src/main/java/com/belerweb/social/weibo/api/OAuth2.java",
"chars": 6560,
"preview": "package com.belerweb.social.weibo.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.la"
},
{
"path": "src/main/java/com/belerweb/social/weibo/api/User.java",
"chars": 3206,
"preview": "package com.belerweb.social.weibo.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.la"
},
{
"path": "src/main/java/com/belerweb/social/weibo/api/Weibo.java",
"chars": 1215,
"preview": "package com.belerweb.social.weibo.api;\n\nimport com.belerweb.social.SDK;\n\npublic final class Weibo extends SDK {\n\n priva"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/AccessToken.java",
"chars": 1647,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Comment.java",
"chars": 2908,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport java.util.Date;\nimport java.util.Locale;\n\nimport org.json.JSONObject;\n\ni"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Display.java",
"chars": 674,
"preview": "package com.belerweb.social.weibo.bean;\n\n/**\n * 授权页面的终端类型\n */\npublic enum Display {\n\n /**\n * 默认的授权页面,适用于web浏览器。\n */"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Geo.java",
"chars": 2963,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Privacy.java",
"chars": 2474,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Remind.java",
"chars": 3822,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Scope.java",
"chars": 1070,
"preview": "package com.belerweb.social.weibo.bean;\n\n/**\n * scope是OAuth2.0授权机制中authorize接口的一个参数\n * \n * 通过scope,平台将开放更多的微博核心功能给开发者,同时"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Status.java",
"chars": 7512,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport java.util.Date;\nimport java.util.List;\nimport java.util.Locale;\n\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/TokenInfo.java",
"chars": 1768,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/UrlShort.java",
"chars": 1569,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/User.java",
"chars": 10168,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport java.util.Date;\nimport java.util.Locale;\n\nimport org.json.JSONObject;\n\ni"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/UserCounts.java",
"chars": 1952,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weibo/bean/Visible.java",
"chars": 1020,
"preview": "package com.belerweb.social.weibo.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport c"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/Group.java",
"chars": 4555,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.UnsupportedEncodingException;\nimport java.util.ArrayList;\nimport"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/Media.java",
"chars": 4583,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.IOException;\n\nimport org.apache.commons.io.IOUtils;\nimport org.a"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/Menu.java",
"chars": 4313,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.UnsupportedEncodingException;\nimport java.util.ArrayList;\nimport"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/OAuth2.java",
"chars": 6844,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLEncoder;\nimport"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/User.java",
"chars": 5386,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.l"
},
{
"path": "src/main/java/com/belerweb/social/weixin/api/Weixin.java",
"chars": 13181,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.UnsupportedEncodingException;\nimport java.nio.charset.Charset;\ni"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/AccessToken.java",
"chars": 2300,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/ApiTicket.java",
"chars": 1046,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Article.java",
"chars": 906,
"preview": "package com.belerweb.social.weixin.bean;\n\n/**\n * 图文\n */\npublic class Article {\n\n private String title;// 图文消息标题\n priva"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/EventType.java",
"chars": 1020,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 事件类型\n */\npublic enum EventType {\n\n /**\n * 订阅\n */\n SUBSCRIBE(\"sub"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/GetFollowersResult.java",
"chars": 1944,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.json.JSONArray;"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Group.java",
"chars": 1165,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/JSApiTicket.java",
"chars": 1073,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Media.java",
"chars": 688,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 媒体文件\n */\npublic class Media {\n\n private String id;\n private String n"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/MediaType.java",
"chars": 853,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 媒体文件类型\n */\npublic enum MediaType {\n\n /**\n * 图片\n */\n IMAGE(\"image"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Menu.java",
"chars": 1478,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport java.util.List;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.socia"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/MenuType.java",
"chars": 1586,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 自定义菜单类型\n */\npublic enum MenuType {\n\n /**\n * 用户点击click类型按钮后,微信服务器会通过"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Message.java",
"chars": 13793,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.List;\n\nimp"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/MsgType.java",
"chars": 1599,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 普通消息\n */\npublic enum MsgType {\n\n /**\n * 文本消息\n */\n TEXT(\"text\"),\n"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/QRCreation.java",
"chars": 1155,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\npublic class QRCreation {\n\n private QRType type;"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/QRTicket.java",
"chars": 1327,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport org.json.JSONObject;\n\nimport com.belerweb.social.bean.JsonBean;\nimport "
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/QRType.java",
"chars": 598,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 带参数的二维码类型\n */\npublic enum QRType {\n\n /**\n * 临时二维码\n */\n QR_SCENE("
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Scope.java",
"chars": 837,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 应用授权作用域\n */\npublic enum Scope {\n\n /**\n * 不弹出授权页面,直接跳转,只能获取用户openid\n"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/User.java",
"chars": 4383,
"preview": "package com.belerweb.social.weixin.bean;\n\nimport java.util.Date;\nimport java.util.List;\n\nimport org.json.JSONObject;\n\nim"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/Variable.java",
"chars": 908,
"preview": "package com.belerweb.social.weixin.bean;\n\n/**\n * 模板消息中的变量\n * \n * @date Aug 28, 2014\n */\npublic class Variable {\n\n priva"
},
{
"path": "src/main/java/com/belerweb/social/weixin/bean/VoiceType.java",
"chars": 544,
"preview": "package com.belerweb.social.weixin.bean;\n\n\n/**\n * 语音格式\n */\npublic enum VoiceType {\n\n /**\n * amr\n */\n AMR(\"amr\"),\n\n"
},
{
"path": "src/test/java/com/belerweb/social/SDKTest.java",
"chars": 497,
"preview": "package com.belerweb.social;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimport org.slf4j."
},
{
"path": "src/test/java/com/belerweb/social/TestConfig.java",
"chars": 824,
"preview": "package com.belerweb.social;\n\nimport org.junit.Before;\n\nimport com.belerweb.social.qq.connect.api.QQConnect;\nimport com."
},
{
"path": "src/test/java/com/belerweb/social/captcha/api/YundamaTest.java",
"chars": 16821,
"preview": "package com.belerweb.social.captcha.api;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimpor"
},
{
"path": "src/test/java/com/belerweb/social/mail/api/POP3Test.java",
"chars": 466,
"preview": "package com.belerweb.social.mail.api;\n\nimport org.junit.Test;\n\nimport com.belerweb.social.mail.api.POP3;\n\npublic class P"
},
{
"path": "src/test/java/com/belerweb/social/qq/connect/api/OAuth2Test.java",
"chars": 2873,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nim"
},
{
"path": "src/test/java/com/belerweb/social/qq/connect/api/UserTest.java",
"chars": 1174,
"preview": "package com.belerweb.social.qq.connect.api;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nim"
},
{
"path": "src/test/java/com/belerweb/social/weibo/api/OAuth2Test.java",
"chars": 1715,
"preview": "package com.belerweb.social.weibo.api;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimport "
},
{
"path": "src/test/java/com/belerweb/social/weibo/api/UserTest.java",
"chars": 1552,
"preview": "package com.belerweb.social.weibo.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.junit.Assert;\nimp"
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/GroupTest.java",
"chars": 1485,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.util.List;\n\nimport org.apache.commons.lang.RandomStringUtils;\nimpor"
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/MediaTest.java",
"chars": 1334,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.io.File;\n\nimport org.apache.commons.io.FileUtils;\nimport org.junit."
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/MenuTest.java",
"chars": 3449,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.commons.l"
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/OAuth2Test.java",
"chars": 1310,
"preview": "package com.belerweb.social.weixin.api;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimport"
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/UserTest.java",
"chars": 1430,
"preview": "package com.belerweb.social.weixin.api;\n\nimport java.util.List;\n\nimport org.junit.Assert;\nimport org.junit.Test;\nimport "
},
{
"path": "src/test/java/com/belerweb/social/weixin/api/WeixinTest.java",
"chars": 4727,
"preview": "package com.belerweb.social.weixin.api;\n\nimport static org.junit.Assert.assertEquals;\n\nimport java.util.Date;\n\nimport or"
},
{
"path": "src/test/resources/logback.xml",
"chars": 412,
"preview": "<configuration>\n <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n <!-- encoders are assigned th"
}
]
About this extraction
This page contains the full source code of the belerweb/social-sdk GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 114 files (384.3 KB), approximately 118.0k tokens, and a symbol index with 1424 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.