Merge branch 'master' into 1.8.0
This commit is contained in:
commit
4854dc8e0b
@ -11,6 +11,14 @@
|
|||||||
<name>weixin4j-base</name>
|
<name>weixin4j-base</name>
|
||||||
<description>微信开发基础工程</description>
|
<description>微信开发基础工程</description>
|
||||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-base</url>
|
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-base</url>
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
package com.foxinmy.weixin4j.util;
|
package com.foxinmy.weixin4j.util;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量类
|
* 常量类
|
||||||
@ -12,8 +15,24 @@ import java.nio.charset.Charset;
|
|||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
public final class Consts {
|
public final class Consts {
|
||||||
public static final String WEIXIN4J = "weixin4j";
|
|
||||||
public final static String VERSION = "1.7.9";
|
private static Properties loadProperties() {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
InputStream inputStream = Consts.class.getResourceAsStream("../weixin4j.properties");
|
||||||
|
try {
|
||||||
|
properties.load(inputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} finally {
|
||||||
|
IOUtil.close(inputStream);
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Properties PROPERTIES = loadProperties();
|
||||||
|
|
||||||
|
public static final String WEIXIN4J = PROPERTIES.getProperty("weixin4j.name");
|
||||||
|
public static final String VERSION = PROPERTIES.getProperty("weixin4j.version");
|
||||||
public static final Charset UTF_8 = Charset.forName("UTF-8");
|
public static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||||
public static final Charset GBK = Charset.forName("GBK");
|
public static final Charset GBK = Charset.forName("GBK");
|
||||||
public static final String SUCCESS = "SUCCESS";
|
public static final String SUCCESS = "SUCCESS";
|
||||||
|
|||||||
@ -0,0 +1,2 @@
|
|||||||
|
weixin4j.name=weixin4j
|
||||||
|
weixin4j.version=${project.version}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.foxinmy.weixin4j.util;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class ConstsTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
assertEquals("weixin4j", Consts.WEIXIN4J);
|
||||||
|
assertFalse(Consts.VERSION.equals("${project.version}"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user