CollectionDeleteController.class.php
1.26 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
<?php
/**
* CollectionDeleteController.class.php
* 取消收藏 RPC 接口
* @author Xtong
* @version $Id$
*/
namespace Rpc\Controller\Collection;
use Common\Service\CommonCollectionService;
use Think\Log;
/**
* 取消收藏 RPC 接口
*
* @uses 调用方法:\Com\Rpc::phprpc(rpc 接口 url)->invoke(接口方法名, 需要传入的参数数组key-value);
*/
class CollectionDeleteController extends AbstractController
{
/**
* 取消收藏
* @desc 【RPC】取消收藏
* @param mixed app:true 被推荐数据所在应用模块目录标识名
* @param mixed uid:true 用户uid,可以为空,但必须传
* @param mixed dataId:true 被推荐数据的原始数据 Id
* @return boolean
*/
public function Index()
{
if (!$this->_checkKeyParams()) {
return false;
}
$collectionService = new CommonCollectionService();
$collectionService->delete_by_conds([
'uid' => $this->_params['uid'],
'app_dir' => $this->_params['app'],
'data_id' => $this->_params['dataId']
]);
Log::record('<!-- 开始取消收藏数据:');
Log::record($this->_params);
Log::record('结束取消收藏 -->');
return true;
}
}