Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
0ffb5df7414f94964f3cf790fb49944c9c0de2bc
1 parent
5d6cddc3
code review by fei.hong: do add app hotfix and lifeboat api
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
yohobuy/m.yohobuy.com/application/controllers/Hf.php
yohobuy/m.yohobuy.com/application/controllers/Hf.php
0 → 100644
View file @
0ffb5df
<?php
use
Action\AbstractAction
;
/**
* 专为APP客户端调用的 hf(hotfix) Api
*
* @name HfController
* @package
* @copyright yoho.inc
* @version 1.0 (2016-2-3 11:34:40)
* @author fei.hong <fei.hong@yoho.cn>
*/
class
HfController
extends
AbstractAction
{
/* 私钥 */
const
PRIVATE_KEY
=
'fd4ad5fcsa0de589af23234ks1923ks'
;
/**
* V1版本
*
* 参数列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* app_version 当前版本号 string 3.8.0
* uid 用户ID string 13423331
* client_type 用户手机系统:Android,IOS string Android
* screen_size 屏幕尺寸 string 1080x1920
* udid 设备唯一码 string 1d123sadao3
* os_version 设备版本号 string 1d123sadao3
* patchv 补丁版本号,如果本地没有补丁,传空 string 100
*
* 返回列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* code 返回的code,200,304等,具体的服务器定义 int 200
* message 信息 string "Config Success"
* md5 当前请求的唯一码 string "1234567890123456"
* data 配置参数数据,参考data列表 object
* [
* url 补丁url地址,没有传空 string http://yohocdn.com/fpath/fpkk.js
* patchv 当前补丁的版本号,没有就传空 string "100"
* filecode md5(md5(文件内容) + "yohopatch2016") string "1233321121212332"
* ]
*/
public
function
v1Action
()
{
$result
=
array
(
'code'
=>
200
,
'message'
=>
'Config Success'
,
'md5'
=>
''
,
'data'
=>
array
());
// 根据版本号返回补丁文件信息
$version
=
$this
->
post
(
'app_version'
);
switch
(
$version
)
{
case
'4.0.0'
:
// 版本号
case
'3.8.0'
:
$result
[
'data'
][
'url'
]
=
'http://cdn.yoho.cn/analysis/v1/js/om_code.js'
;
$result
[
'data'
][
'patchv'
]
=
'100'
;
$result
[
'data'
][
'filecode'
]
=
md5
(
'496c71eb82ce76410d5e0b3a74c02b43'
.
'yohopatch2016'
);
$result
[
'md5'
]
=
md5
(
self
::
PRIVATE_KEY
.
':'
.
json_encode
(
$result
[
'data'
]));
break
;
default
:
// 默认
$result
[
'data'
][
'url'
]
=
''
;
$result
[
'data'
][
'patchv'
]
=
''
;
$result
[
'data'
][
'filecode'
]
=
''
;
$result
[
'md5'
]
=
md5
(
self
::
PRIVATE_KEY
.
':'
.
json_encode
(
$result
[
'data'
]));
}
$this
->
echoJson
(
$result
);
}
}
...
...
Please
register
or
login
to post a comment