Commit 7ef6b679 by 吴博
parents 61bff431 5e05a3bd
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<name>pcloud-common-core</name> <name>pcloud-common-core</name>
<properties> <properties>
<universe-error-alarm.version>3.0.1-SNAPSHOT</universe-error-alarm.version>
</properties> </properties>
<dependencies> <dependencies>
...@@ -50,6 +50,17 @@ ...@@ -50,6 +50,17 @@
<artifactId>jackson-mapper-asl</artifactId> <artifactId>jackson-mapper-asl</artifactId>
</dependency> </dependency>
<!-- Jackson End --> <!-- Jackson End -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>com.pcloud.universe</groupId>
<artifactId>universe-error-alarm</artifactId>
<version>${universe-error-alarm.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -41,6 +41,10 @@ public class DataSourceConfig { ...@@ -41,6 +41,10 @@ public class DataSourceConfig {
public static final String SESSION_FACTORY_NAME = "sqlSessionFactory"; public static final String SESSION_FACTORY_NAME = "sqlSessionFactory";
public static final String SESSION_TEMPLATE_NAME = "sqlSessionTemplate"; public static final String SESSION_TEMPLATE_NAME = "sqlSessionTemplate";
static {
System.setProperty("druid.mysql.usePingMethod","false");
}
private String url; private String url;
private String type; private String type;
......
...@@ -108,5 +108,6 @@ public enum AppProductTypeEnum { ...@@ -108,5 +108,6 @@ public enum AppProductTypeEnum {
AppTypeEnum.TEST_PAPER.value, AppTypeEnum.AUDIO.value, AppTypeEnum.VIDEO.value, AppTypeEnum.MATCH_LISTEN.value, AppTypeEnum.TEST_PAPER.value, AppTypeEnum.AUDIO.value, AppTypeEnum.VIDEO.value, AppTypeEnum.MATCH_LISTEN.value,
AppTypeEnum.PBSTORY.value, AppTypeEnum.WORD_DICTATION.value, AppTypeEnum.ENGLISH_WALKMAN.value, AppTypeEnum.PBSTORY.value, AppTypeEnum.WORD_DICTATION.value, AppTypeEnum.ENGLISH_WALKMAN.value,
AppTypeEnum.ARTICLE_READING.value, AppTypeEnum.ORAL_EVALUATION.value, AppTypeEnum.IMAGE.value, AppTypeEnum.ARTICLE_READING.value, AppTypeEnum.ORAL_EVALUATION.value, AppTypeEnum.IMAGE.value,
AppTypeEnum.STROKE_ORDER.value, AppTypeEnum.SUBJECTNOTE.value, AppTypeEnum.ZSCORE.value, AppTypeEnum.RECITE_WORD.value}; AppTypeEnum.STROKE_ORDER.value, AppTypeEnum.SUBJECTNOTE.value, AppTypeEnum.ZSCORE.value, AppTypeEnum.RECITE_WORD.value,
AppTypeEnum.ARTICLE.value};
} }
...@@ -14,8 +14,8 @@ import java.util.ResourceBundle; ...@@ -14,8 +14,8 @@ import java.util.ResourceBundle;
* @创建时间:2016年3月10日,上午11:46:33 * @创建时间:2016年3月10日,上午11:46:33
* @版本:1.0 * @版本:1.0
*/ */
public class ResourceUtils { class ResourceUtils {
private ResourceBundle resourceBundle; private ResourceBundle resourceBundle;
private ResourceUtils(String resource) { private ResourceUtils(String resource) {
resourceBundle = ResourceBundle.getBundle(resource); resourceBundle = ResourceBundle.getBundle(resource);
...@@ -26,7 +26,7 @@ private ResourceBundle resourceBundle; ...@@ -26,7 +26,7 @@ private ResourceBundle resourceBundle;
* @param resource 资源 * @param resource 资源
* @return 解析 * @return 解析
*/ */
public static ResourceUtils getResource(String resource) { static ResourceUtils getResource(String resource) {
return new ResourceUtils(resource); return new ResourceUtils(resource);
} }
...@@ -36,7 +36,7 @@ private ResourceBundle resourceBundle; ...@@ -36,7 +36,7 @@ private ResourceBundle resourceBundle;
* @param args value中参数序列,参数:{0},{1}...,{n} * @param args value中参数序列,参数:{0},{1}...,{n}
* @return * @return
*/ */
public String getValue(String key, Object... args) { String getValue(String key, Object... args) {
String temp = resourceBundle.getString(key); String temp = resourceBundle.getString(key);
return MessageFormat.format(temp, args); return MessageFormat.format(temp, args);
} }
...@@ -45,7 +45,7 @@ private ResourceBundle resourceBundle; ...@@ -45,7 +45,7 @@ private ResourceBundle resourceBundle;
* 获取所有资源的Map表示 * 获取所有资源的Map表示
* @return 资源Map * @return 资源Map
*/ */
public Map<String, String> getMap() { Map<String, String> getMap() {
Map<String, String> map = new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
for(String key: resourceBundle.keySet()) { for(String key: resourceBundle.keySet()) {
map.put(key, resourceBundle.getString(key)); map.put(key, resourceBundle.getString(key));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment