/**
  * 发表帖子
  * @param int $tid
  * @param int $fid
  * @param string $subject
  * @param string $content
  * return bool
  */
 public function postThread($uid, $fid, $subject, $content)
 {
     list($uid, $fid, $subject, $content) = array(intval($uid), intval($fid), trim($subject), trim($content));
     if ($uid < 1 || $fid < 1 || !$subject || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS, "参数错误");
     }
     $user = PwUserBo::getInstance($uid);
     if (!$user->isExists()) {
         return $this->buildResponse(USER_NOT_EXISTS, "用户不存在");
     }
     Wind::import('SRV:forum.srv.PwPost');
     Wind::import('SRV:forum.srv.post.PwTopicPost');
     $postAction = new PwTopicPost($fid);
     $pwPost = new PwPost($postAction);
     $postDm = $pwPost->getDm();
     $postDm->setFid($fid)->setTitle($subject)->setContent($content)->setAuthor($uid, $user->username, $user->ip);
     if (($result = $pwPost->execute($postDm)) !== true) {
         $this->buildResponse(-1, $result->getError());
     }
     $tid = $pwPost->getNewId();
     return $this->buildResponse(0, array('tid' => $tid));
 }
 /**
  * 发送回复
  * @param int $tid
  * @param int $uid
  * @param string $title
  * @param string $content
  * return bool
  */
 public function sendPost($tid, $uid, $title, $content)
 {
     list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
     if ($uid < 1 || $tid < 1 || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS, "参数错误");
     }
     if ($this->_getOnline()->isOnline($uid) !== true) {
         $this->buildResponse(USER_NOT_LOGIN, "用户没有登录");
     }
     Wind::import('SRV:forum.srv.PwPost');
     Wind::import('SRV:forum.srv.post.PwReplyPost');
     $postAction = new PwReplyPost($tid);
     $pwPost = new PwPost($postAction);
     $info = $pwPost->getInfo();
     $title == 'Re:' . $info['subject'] && ($title = '');
     $postDm = $pwPost->getDm();
     $postDm->setTitle($title)->setContent($content)->setAuthor($uid, $user->username, $user->ip);
     if (($result = $pwPost->execute($postDm)) !== true) {
         $this->buildResponse(-1, $result->getError());
     }
     $postId = $pwPost->getNewId();
     return $this->buildResponse(0, array('pid' => $postId));
 }