Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
2dfa62c1d75a89dea6059ed1a3fea326d28650ee
1 parent
84ad40c8
do guang plusstar test use rpc yar call service
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
27 additions
and
6 deletions
library/Api/Yohobuy.php
library/LibModels/Wap/Channel/PlusstarData.php → library/LibModels/Wap/Guang/PlusstarData.php
library/LibModels/Wap/Channel/NewsaleData.php → library/LibModels/Wap/Product/NewsaleData.php
library/LibModels/Wap/Product/RecomData.php
template/m.yohobuy.com/actions/channel/newsale/new.phtml → template/m.yohobuy.com/actions/guang/plusstar/detail.phtml
template/m.yohobuy.com/actions/channel/plusstar/list.phtml → template/m.yohobuy.com/actions/guang/plusstar/list.phtml
template/m.yohobuy.com/actions/channel/newsale/sale.phtml → template/m.yohobuy.com/actions/product/newsale/new.phtml
template/m.yohobuy.com/actions/channel/plusstar/detail.phtml → template/m.yohobuy.com/actions/product/newsale/sale.phtml
yohobuy/m.yohobuy.com/application/controllers/Index.php
yohobuy/m.yohobuy.com/application/modules/Channel/controllers/Plusstar.php → yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Plusstar.php
yohobuy/m.yohobuy.com/application/modules/Channel/controllers/Newsale.php → yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
library/Api/Yohobuy.php
View file @
2dfa62c
...
...
@@ -239,5 +239,23 @@ class Yohobuy
return
$result
;
}
/**
* rpc调用远程服务(YAR)
*
* @see http://php.net/manual/zh/yar-client.setopt.php
* @return array
*/
public
static
function
yarClient
(
$uri
,
$method
,
$data
=
array
(),
$timeout
=
3000
)
{
$client
=
new
\Yar_Client
(
$uri
);
$client
->
SetOpt
(
YAR_OPT_PACKAGER
,
'php'
);
$client
->
SetOpt
(
YAR_OPT_TIMEOUT
,
$timeout
);
$client
->
SetOpt
(
YAR_OPT_CONNECT_TIMEOUT
,
$timeout
);
$result
=
$client
->
$method
(
$data
);
return
$result
;
}
}
...
...
library/LibModels/Wap/
Channel
/PlusstarData.php → library/LibModels/Wap/
Guang
/PlusstarData.php
View file @
2dfa62c
library/LibModels/Wap/
Channel
/NewsaleData.php → library/LibModels/Wap/
Product
/NewsaleData.php
View file @
2dfa62c
library/LibModels/Wap/Product/RecomData.php
View file @
2dfa62c
<?php
namespace
LibModels\Wap\Product
;
use
Api\Sign
;
...
...
@@ -15,6 +16,7 @@ use Api\Yohobuy;
*/
class
RecomData
{
/**
* 你可能喜欢的BOYS或GIRLS的商品列表
*
...
...
@@ -33,10 +35,10 @@ class RecomData
$param
[
'limit'
]
=
$limit
;
$param
[
'yh_channel'
]
=
$channel
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
true
);
}
/**
* 你可能喜欢的潮童的商品列表
*
...
...
@@ -55,7 +57,7 @@ class RecomData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
true
);
}
/**
* 你可能喜欢的创意生活的新品到着和人气单品列表
*
...
...
@@ -74,6 +76,5 @@ class RecomData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
true
);
}
}
}
...
...
template/m.yohobuy.com/actions/
channel/newsale/new
.phtml → template/m.yohobuy.com/actions/
guang/plusstar/detail
.phtml
View file @
2dfa62c
template/m.yohobuy.com/actions/
channel
/plusstar/list.phtml → template/m.yohobuy.com/actions/
guang
/plusstar/list.phtml
View file @
2dfa62c
template/m.yohobuy.com/actions/
channel/newsale/sale
.phtml → template/m.yohobuy.com/actions/
product/newsale/new
.phtml
View file @
2dfa62c
template/m.yohobuy.com/actions/
channel/plusstar/detail
.phtml → template/m.yohobuy.com/actions/
product/newsale/sale
.phtml
View file @
2dfa62c
yohobuy/m.yohobuy.com/application/controllers/Index.php
View file @
2dfa62c
<?php
use
Action\AbstractAction
;
use
LibModels\Wap\Product\RecomData
;
use
Api\Yohobuy
;
/**
* 频道选择
...
...
@@ -11,5 +11,7 @@ class IndexController extends AbstractAction
{
$this
->
_view
->
assign
(
'title'
,
'YOHO!有货'
);
$this
->
_view
->
display
(
'index'
,
array
(
'test'
=>
'hello world'
));
//$test = Yohobuy::yarClient('http://service.api.yohobuy.com/guang/service/v1/plustar/', 'getBrandInfo', array('id' => 289));
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/modules/
Channel
/controllers/Plusstar.php → yohobuy/m.yohobuy.com/application/modules/
Guang
/controllers/Plusstar.php
View file @
2dfa62c
yohobuy/m.yohobuy.com/application/modules/
Channel
/controllers/Newsale.php → yohobuy/m.yohobuy.com/application/modules/
Product
/controllers/Newsale.php
View file @
2dfa62c
Please
register
or
login
to post a comment