예제 #1
0
 public void init() {
   if (dao.count(ForumTip.class) < 1) {
     ForumTip forumTip = new ForumTip();
     forumTip.setUid(1);
     forumTip.setContent("第一条测试信息--论坛信息");
     forumTip.setCreateTime(System.currentTimeMillis());
     dao.insert(forumTip);
   }
 }
예제 #2
0
 @At("/f/newTip")
 public boolean newTip(@Param("content") String content, HttpSession session) {
   if (Strings.isBlank(content)) return false;
   AuthUserInfo authUserInfo = (AuthUserInfo) session.getAttribute(AuthUserInfo.class.getName());
   if (authUserInfo == null) return false;
   ForumTip forumTip = new ForumTip();
   forumTip.setAuthUserInfo(authUserInfo);
   forumTip.setUid(authUserInfo.getUid());
   forumTip.setContent(content);
   forumTip.setCreateTime(System.currentTimeMillis());
   dao.insert(forumTip);
   return true;
 }