提交 37cd01f7 编写于 作者: 街头小贩's avatar 街头小贩

更新Env取值

上级 cf9b3521
......@@ -33,13 +33,13 @@ public class MemberChangeEvent {
}
private MemberChangeEvent(long memberId, EnumArchitecture archite, Class<?> cls){
if(!EnumArchitecture.class.isAssignableFrom(cls)){
throw new IllegalStateException("参数不是合法值");
}
Optional<String> k = getMapKey(cls);
if(!k.isPresent()){
throw new IllegalStateException("不支持的Key");
}
if(!EnumArchitecture.class.isAssignableFrom(cls)){
throw new IllegalStateException("参数不是合法值");
}
this.memberId = memberId;
this.key = k.get();
this.value = archite.getSymbol();
......
......@@ -78,21 +78,9 @@ public class ThronesAdminAppConfig {
jp.setUrl(env.getProperty("jdbc.url"));
jp.setUsername(env.getProperty("jdbc.username"));
jp.setPassword(env.getProperty("jdbc.password"));
try {
jp.setPoolInit(Integer.valueOf(env.getProperty("jdbc.pool.init")));
} catch (Exception e) {
jp.setPoolInit(1);
}
try {
jp.setPoolMinIdle(Integer.valueOf(env.getProperty("jdbc.pool.minIdle")));
} catch (Exception e) {
jp.setPoolMinIdle(3);
}
try {
jp.setPoolMaxActive(Integer.valueOf(env.getProperty("jdbc.pool.maxActive")));
} catch (Exception e) {
jp.setPoolMaxActive(20);
}
jp.setPoolInit(Commons.stringToInteger(()->env.getProperty("jdbc.pool.init"),1));
jp.setPoolMinIdle(Commons.stringToInteger(()->env.getProperty("jdbc.pool.minIdle"), 3));
jp.setPoolMaxActive(Commons.stringToInteger(()->env.getProperty("jdbc.pool.maxActive"),20));
jp.setPoolTestSql(env.getProperty("jdbc.pool.testSql"));
jp.setJpaUnitName(env.getProperty("jpa.unit-name"));
return jp;
......
......@@ -73,21 +73,9 @@ public class ThronesAppConfig {
jp.setUrl(env.getProperty("jdbc.url"));
jp.setUsername(env.getProperty("jdbc.username"));
jp.setPassword(env.getProperty("jdbc.password"));
try {
jp.setPoolInit(Integer.valueOf(env.getProperty("jdbc.pool.init")));
} catch (Exception e) {
jp.setPoolInit(1);
}
try {
jp.setPoolMinIdle(Integer.valueOf(env.getProperty("jdbc.pool.minIdle")));
} catch (Exception e) {
jp.setPoolMinIdle(3);
}
try {
jp.setPoolMaxActive(Integer.valueOf(env.getProperty("jdbc.pool.maxActive")));
} catch (Exception e) {
jp.setPoolMaxActive(20);
}
jp.setPoolInit(Commons.stringToInteger(()->env.getProperty("jdbc.pool.init"),1));
jp.setPoolMinIdle(Commons.stringToInteger(()->env.getProperty("jdbc.pool.minIdle"), 3));
jp.setPoolMaxActive(Commons.stringToInteger(()->env.getProperty("jdbc.pool.maxActive"),20));
jp.setPoolTestSql(env.getProperty("jdbc.pool.testSql"));
jp.setJpaUnitName(env.getProperty("jpa.unit-name"));
return jp;
......
......@@ -62,7 +62,6 @@ public class ModeratorBornNoticeListener implements MessageListener<ModeratorBor
}
String content = String.format("恭喜您加入社区管理团队, 您现在是%s%s%s", section, level.getTitle(), currentRole.getTitle());
//(String title, String content, long author, String authorNames, ForumLetterTypeEnum type)
ForumLetter fl = ForumLetter.noticeLetter("版主任命通知", content);
return fl;
return ForumLetter.noticeLetter("版主任命通知", content);
}
}
......@@ -65,7 +65,6 @@ public class ModeratorRecallNoticeListener implements MessageListener<ModeratorR
br.getConnect(), br.getTitle());
}
String content = String.format("您现在已经辞去%s版主! 感谢您对社区孜孜不倦的工作付出, 您当前的会员角色: %s", section, currentRole.getTitle());
ForumLetter fl = ForumLetter.noticeLetter("版主卸任通知", content);
return fl;
return ForumLetter.noticeLetter("版主卸任通知", content);
}
}
......@@ -60,7 +60,7 @@ public class PostsQuoteNoticeListener implements MessageListener<PostsPublishEve
//生成引用通知
private ForumLetter getQuoteNotice(Topic topic, Posts posts, long authorReplyFloor) {
String floorLink = String.format("/topic/%s.xhtml#posts-%d", TopicReplica.generateConnectString(topic.getId(), topic.getBoardId(), topic.getVolumesId()), posts.getId());
ForumLetter fl = ForumLetter.noticeLetter(
return ForumLetter.noticeLetter(
posts.getMemberNickname() + "引用了您的回复",
String.format(
"<p><a href=\"/member/%d.xhtml\">%s</a>引用了您在<a href=\"%s\">#%s#</a>%d楼发布的回复内容</p>",
......@@ -69,7 +69,6 @@ public class PostsQuoteNoticeListener implements MessageListener<PostsPublishEve
floorLink,
topic.getTitle(),
authorReplyFloor));
return fl;
}
//提取blockquote属性的cite
private long parseBlockquoteTag(String postsContent) {
......
......@@ -61,7 +61,7 @@ public class PostsReplyNoticeListener implements MessageListener<PostsPublishEve
//content: {张三}: {回复内容} #{主题}#
String floorLink = String.format("/topic/%s.xhtml#posts-%d", topic.getConnect(), posts.getId());
//(String title, String content, long author, String authorNames, ForumLetterTypeEnum type)
ForumLetter fl = ForumLetter.noticeLetter(
return ForumLetter.noticeLetter(
posts.getMemberNickname() + "回复了您的主题",
String.format(
"<p><strong><a href=\"/member/%d.xhtml\">%s</a>: </strong>%s <a class=\"embed-link\" href=\"%s\">#%s#</a></p>", //<a href=\"/member/%d.xhtml\">%s</a>回复了您在<a href=\"/board/%d.xhtml\">%s</a>版块中发布的话题<a href=\"/topic/%d.xhtml\">#%s#</a>
......@@ -70,6 +70,5 @@ public class PostsReplyNoticeListener implements MessageListener<PostsPublishEve
replyContent,
floorLink,
topic.getTitle()));
return fl;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册