StarClassData.php
3.72 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016-4-12
* Time: 13:21
*/
namespace LibModels\Wap\Guang;
use Api\Sign;
use Api\Yohobuy;
/**
* Class StarClassData
* 星潮教室相关接口
* @package LibModels\Wap\Guang
*/
class StarClassData
{
//用户当前亲密度,排名
public static function rankInfoDataUrl($uid)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['method'] = 'app.starClass.rankInfo';
$param['client_secret'] = Sign::getSign($param);
//print_r($param);
return Yohobuy::httpBuildQuery(Yohobuy::DEV_API_URL, $param);
}
/**
* 获取资源位数据(url)
* @param string $contentCode 内容位置码
* @return array 首页频道数据
*/
public static function getResourceDataUrl($contentCode)
{
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::httpBuildQuery(Yohobuy::DEV_SERVICE_URL . 'operations/api/v5/resource/get', $param);
}
/**
* 获取资源位数据
* @param string $contentCode 内容位置码
* @return array 首页频道数据
*/
public static function getResourceData($contentCode)
{
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_SERVICE_URL . 'operations/api/v5/resource/get', $param);
}
/**
*星潮教室-签到
*/
public static function sign($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.sign';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_API_URL, $param);
}
/**
* 星潮教室-星搭配文章
*/
public static function collocationData($page)
{
$param = Yohobuy::param();
$param['page'] = $page;
$param['client_secret'] = Sign::getSign($param);
//print_r($param);
return Yohobuy::get(Yohobuy::DEV_SERVICE_URL . 'guang/api/v5/article/getStarClassroomArticleList', $param);
}
/**
* 点赞
*/
public static function setPraise($articleId, $udid)
{
$param = Yohobuy::param();
$param['articleId'] = $articleId;
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_SERVICE_URL . 'guang/api/v5/praise/setPraise', $param);
}
/**
* 转发
*/
public static function forward($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.forward';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_API_URL, $param);
}
/**
* 收藏资讯文章
*/
public static function setFavorite($articleId, $uid, $type)
{
if (!empty($type) && $type == 'fav') {
$url = '/guang/api/v5/favorite/setFavorite';
}elseif($type == 'del'){
$url = '/guang/api/v5/favorite/cancelFavorite';
}
$param = Yohobuy::param();
$param['articleId'] = $articleId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_SERVICE_URL . $url, $param);
}
/**
* 排名前100
*/
public static function Top()
{
$param = Yohobuy::param();
$param['method'] = 'app.starClass.top100';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::DEV_API_URL, $param);
}
}