示例#1
0
 /**
  * 创建一则评论
  *
  * @access public
  * @param int eventId
  * @param string content 评论内容,最多255
  * @param int replayId
  * @return void
  */
 public function create()
 {
     $this->checkAccessToken();
     $this->params = $this->require_params(array('eventId', 'content'));
     $this->params['replayId'] = F::request('replayId', 0);
     if (strlen($this->params['content']) > self::MAX_COMMENT_LENGTH) {
         throw new Exception('评论内容过长,不可超过255个字节', 107);
     }
     $this->commentModel->create($GLOBALS['userId'], $this->params['eventId'], $this->params['content'], $this->params['replayId']);
     F::rest()->show_result();
 }