Exemplo n.º 1
0
  // 删除评论
  @Override
  public int deleteComment(long id) {

    int code = 13034;

    try {
      Comment comment = commentDao.getComment(id);
      if (commentDao.delete(comment)) {
        code = 13031;
      } else {
        code = 13033;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return code;
  }
Exemplo n.º 2
0
  // 更新评论
  @Override
  public int updateComment(long id, String content) {

    int code = 13024;

    try {
      Comment comment = commentDao.getComment(id);
      comment.setContent(content);
      if (commentDao.update(comment)) {
        code = 13021;
      } else {
        code = 13023;
      }

    } catch (Exception e) {
      e.printStackTrace();
    }

    return code;
  }
Exemplo n.º 3
0
 // 获取评论
 @Override
 public Comment getComment(long id) {
   return commentDao.getComment(id);
 }