Skip to content

Commit 979ed6f

Browse files
committed
各种增加功能,各种重构
1 parent 898f26d commit 979ed6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1237
-1507
lines changed

pom.xml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
<properties>
1010
<!-- version definitions of dependencies -->
1111
<lombok.version>0.11.0</lombok.version>
12-
<spring-data-jpa.version>1.2.0.RELEASE</spring-data-jpa.version>
12+
<spring-data-jpa.version>1.3.2.RELEASE</spring-data-jpa.version>
1313
<cglib.version>2.2.2</cglib.version>
1414
<spring.version>3.1.3.RELEASE</spring.version>
1515
<slf4j.version>1.7.2</slf4j.version>
1616
<log4j.version>1.2.17</log4j.version>
1717
<commons-io.version>2.4</commons-io.version>
18-
<httpclient.version>4.2.2</httpclient.version>
18+
<httpclient.version>4.3.1</httpclient.version>
1919
<commons-lang3.version>3.1</commons-lang3.version>
2020
<hibernate.version>4.1.8.Final</hibernate.version>
2121
<commons-httpclient.version>3.0.1</commons-httpclient.version>
2222
<h2.version>1.3.170</h2.version>
2323
<junit.version>4.11</junit.version>
2424
<gson.version>2.2.4</gson.version>
25+
<guava.version>15.0</guava.version>
2526
</properties>
2627

2728
<dependencyManagement>
@@ -56,6 +57,12 @@
5657
<version>${gson.version}</version>
5758
</dependency>
5859

60+
<dependency>
61+
<groupId>com.google.guava</groupId>
62+
<artifactId>guava</artifactId>
63+
<version>${guava.version}</version>
64+
</dependency>
65+
5966
<!-- web begin -->
6067
<dependency>
6168
<groupId>org.springframework</groupId>
@@ -97,6 +104,12 @@
97104
<version>${httpclient.version}</version>
98105
</dependency>
99106
<dependency>
107+
<groupId>org.apache.httpcomponents</groupId>
108+
<artifactId>httpmime</artifactId>
109+
<version>${httpclient.version}</version>
110+
</dependency>
111+
112+
<dependency>
100113
<groupId>org.apache.commons</groupId>
101114
<artifactId>commons-lang3</artifactId>
102115
<version>${commons-lang3.version}</version>
@@ -165,6 +178,11 @@
165178
<artifactId>gson</artifactId>
166179
</dependency>
167180

181+
<dependency>
182+
<groupId>com.google.guava</groupId>
183+
<artifactId>guava</artifactId>
184+
</dependency>
185+
168186
<!-- web begin -->
169187
<dependency>
170188
<groupId>org.springframework</groupId>
@@ -198,6 +216,10 @@
198216
<groupId>org.apache.httpcomponents</groupId>
199217
<artifactId>httpclient</artifactId>
200218
</dependency>
219+
<dependency>
220+
<groupId>org.apache.httpcomponents</groupId>
221+
<artifactId>httpmime</artifactId>
222+
</dependency>
201223
<dependency>
202224
<groupId>org.apache.commons</groupId>
203225
<artifactId>commons-lang3</artifactId>

src/main/java/org/hamster/weixinmp/config/WxConfig.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,38 @@
1616
@Data
1717
@Configuration
1818
public class WxConfig {
19+
public static final String TABLE_PREFIX = "wx_";
20+
public static final int COL_LEN_URL = 1024;
21+
public static final int COL_LEN_CONTENT = 4000;
22+
public static final int COL_LEN_TITLE = 200;
23+
public static final int COL_LEN_USER_NAME = 100;
24+
public static final int COL_LEN_INDICATOR = 64;
25+
1926
private @Value("#{wxProperties.wx_token}") String token;
2027
private @Value("#{wxProperties.wx_appid}") String appid;
2128
private @Value("#{wxProperties.wx_appsecret}") String appsecret;
29+
2230
private @Value("#{wxProperties.wx_menu_create_url}") String menuCreateUrl;
31+
private @Value("#{wxProperties.wx_menu_get_url}") String menuGetUrl;
32+
private @Value("#{wxProperties.wx_menu_delete_url}") String menuDeleteUrl;
33+
2334
private @Value("#{wxProperties.wx_access_token_create_url}") String accessTokenCreateUrl;
2435

36+
private @Value("#{wxProperties.wx_custom_send_url}") String customSendUrl;
37+
38+
private @Value("#{wxProperties.wx_media_upload_url}") String mediaUploadUrl;
39+
40+
private @Value("#{wxProperties.wx_qrcode_create_url}") String qrcodeCreateUrl;
41+
42+
private @Value("#{wxProperties.wx_user_info_url}") String userInfoUrl;
43+
private @Value("#{wxProperties.wx_user_get_url}") String userGetUrl;
44+
45+
private @Value("#{wxProperties.wx_groups_create_url}") String groupsCreateUrl;
46+
private @Value("#{wxProperties.wx_groups_get_url}") String groupsGetUrl;
47+
private @Value("#{wxProperties.wx_groups_getid_url}") String groupsGetIdUrl;
48+
private @Value("#{wxProperties.wx_groups_update_url}") String groupsUpdateUrl;
49+
private @Value("#{wxProperties.wx_groups_members_update_url}") String groupsMembersUpdateUrl;
50+
51+
52+
2553
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.hamster.weixinmp.constant;
2+
3+
/**
4+
5+
* @version Jul 28, 2013
6+
*
7+
*/
8+
public enum WxMsgTypeEnum {
9+
10+
11+
TEXT(WxMsgType.TEXT), IMAGE(WxMsgType.IMAGE), LOCATION(WxMsgType.LOCATION),
12+
LINK(WxMsgType.LINK), EVENT(WxMsgType.EVENT), VIDEO(WxMsgType.VIDEO), VOICE(WxMsgType.VOICE);
13+
/**
14+
* @param text
15+
*/
16+
private WxMsgTypeEnum(final String text) {
17+
this._text = text;
18+
}
19+
20+
private final String _text;
21+
22+
/*
23+
* (non-Javadoc)
24+
*
25+
* @see java.lang.Enum#toString()
26+
*/
27+
@Override
28+
public String toString() {
29+
return _text;
30+
}
31+
32+
public static WxMsgTypeEnum inst(String strVal) {
33+
for (WxMsgTypeEnum type : WxMsgTypeEnum.values()) {
34+
if (type.toString().equalsIgnoreCase(strVal)) {
35+
return type;
36+
}
37+
}
38+
return null;
39+
}
40+
41+
}

src/main/java/org/hamster/weixinmp/constant/WxReqTypeEnum.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/main/java/org/hamster/weixinmp/constant/WxRespCode.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/java/org/hamster/weixinmp/constant/WxRespCodeConstants.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/main/java/org/hamster/weixinmp/constant/WxRespTypeEnum.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)