DoubanComment.php
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @file DuobanComment.php
* @brief 豆瓣回复API接口
* @author JonChou <ilorn.mc@gmail.com>
* @date 2012-12-05
*/
class DoubanComment extends DoubanBase {
/**
* @brief 构造函数,初始设置clientId
*
* @param string $clientId
*
* @return void
*/
public function __construct($clientId)
{
$this->clientId = $clientId;
}
public function getCommentsList($target, $id)
{
$this->uri = '/v2/'.$target.'/'.$id.'/comments';
$this->type = 'GET';
return $this;
}
public function addComment($target, $id)
{
$this->uri = '/v2/'.$target.'/'.$id.'/comments';
$this->type = 'POST';
return $this;
}
public function getComment($target, $targetId, $commentId)
{
$this->uri = '/v2/'.$target.'/'.$targetId.'/comment/'.$commentId;
$this->type = 'GET';
return $this;
}
public function deleteComment($target, $targetId, $commentId)
{
$this->uri = '/v2/'.$target.'/'.$targetId.'/comment/'.$commentId;
$this->type = 'DELETE';
return $this;
}
}