Authored by whb

缓存java api

... ... @@ -30,11 +30,11 @@ class Yohobuy
// const API_OLD = 'http://api2.open.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
// const API_URL = 'http://192.168.102.205:8080/gateway/'; // 先临时使用网关
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
/* 预览环境 */
// const API_URL = 'http://preapi.yoho.cn/';
... ... @@ -44,10 +44,10 @@ class Yohobuy
// const API_OLD = 'http://api2.open.yohobuy.com/';
/* PC重构地址 */
const API_URL = 'http://test.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://api2.open.yohobuy.com/';
// const API_URL = 'http://test.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://api2.open.yohobuy.com/';
/**
* 私钥列表
... ... @@ -162,7 +162,6 @@ class Yohobuy
if (!empty($data)) {
$url = self::httpBuildQuery($url, $data);
}
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
... ...
... ... @@ -32,13 +32,14 @@ class IndexData
* @param string $client_type
* @return array
*/
public static function getResourceData($content_code, $client_type = 'web')
public static function getResourceData($content_code, $client_type = 'android')
{
// 构建必传参数
$params = Yohobuy::param();
$params['content_code'] = $content_code;
$params['client_type'] = $client_type;
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_RESOURCE_GET, $params);
}
}
\ No newline at end of file
... ...