Subscribe.class.php
1.87 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
51
52
53
54
55
<?php
/**
* 应用订阅
*
* @name Controller_Subscribe
* @package controller
* @copyright yoho.inc
* @version 5.0 (2014-02-08 15:42:53)
* @author fei.hong <fei.hong@yoho.cn>
*/
class Controller_Subscribe extends Controller_Abstract
{
/**
* 修改订阅
*
* @param integer key 应用的ID
* @param string sign 通过应用颁发的密钥所生成的签名
* @param string new_secret 新的颁发密钥<optional>
* @param string scope 新的订阅信息<optional>
* @return json
*/
public function indexAction()
{
$result = null;
if (isset($this->_appId))
{
$newSecret = $this->_request->post('new_key', null);
$scope = $this->_request->post('scope', null);
$result = Facade_Subscribe::upd($this->_appId, $newSecret, null, $scope, null);
if ($result)
{
return $this->returnJson(Config_Code::$success['system']['code'], $result, Config_Code::$success['system']['message']);
}
}
return $this->returnJson(Config_Code::$error['system']['code'], $result, Config_Code::$error['system']['message']);
}
/**
* @todo test interface
*/
public function testAction()
{
return;
$test = Facade_Subscribe::add(null, null, 'YOHOSHOW', 'uid,nick,gender,age,birthday,email,mobile_phone,real_name,head_pic', 1);
$test = Facade_Subscribe::add(null, null, 'YOHOBUY', 'uid,nick,gender,age,birthday,email,mobile_phone,real_name,head_pic', 1);
$test = Facade_Subscribe::upd('1392109210', '6714d55f23339880cd04150f102f80c6', md5('#@!@#$%^yoho'.mt_rand()), null, 'uid,nick,gender,head_pic', null);
$test = Facade_Subscribe::upd('1392109259', '0145ed50917f396584bb78ce36ec70d1', null, null, 'uid,nick,gender,email,head_pic', 0);
}
}