Commit 0e278b86 authored by 吴贤德's avatar 吴贤德

api

parent 0f2907c0
...@@ -20,6 +20,7 @@ class CenterAction extends Action ...@@ -20,6 +20,7 @@ class CenterAction extends Action
} }
echo json_encode($result); echo json_encode($result);
exit;
} }
/** /**
...@@ -40,6 +41,7 @@ class CenterAction extends Action ...@@ -40,6 +41,7 @@ class CenterAction extends Action
} }
echo json_encode($result); echo json_encode($result);
exit;
} }
public function push_log(){ public function push_log(){
...@@ -67,7 +69,6 @@ class CenterAction extends Action ...@@ -67,7 +69,6 @@ class CenterAction extends Action
//echo $rawData."\n"; //echo $rawData."\n";
$json = json_decode($rawData,true); $json = json_decode($rawData,true);
$url = $json["jsonUrl"]; $url = $json["jsonUrl"];
//echo "url:".$url; exit;
$content = file_get_contents($url); $content = file_get_contents($url);
$json = json_decode($content,true); $json = json_decode($content,true);
...@@ -112,6 +113,7 @@ class CenterAction extends Action ...@@ -112,6 +113,7 @@ class CenterAction extends Action
echo 'false'; echo 'false';
} }
} }
exit;
} }
function null2str($str){ function null2str($str){
if (is_null($str)){ if (is_null($str)){
...@@ -162,6 +164,7 @@ class CenterAction extends Action ...@@ -162,6 +164,7 @@ class CenterAction extends Action
$result["list"] = $list; $result["list"] = $list;
echo json_encode($result); echo json_encode($result);
exit;
} }
/** /**
* 增量媒资变更检测接口 * 增量媒资变更检测接口
...@@ -201,6 +204,7 @@ class CenterAction extends Action ...@@ -201,6 +204,7 @@ class CenterAction extends Action
$result["page_num"]=$page_num; $result["page_num"]=$page_num;
echo json_encode($result); echo json_encode($result);
exit;
} }
/** /**
...@@ -292,7 +296,7 @@ class CenterAction extends Action ...@@ -292,7 +296,7 @@ class CenterAction extends Action
D("LogPush")->add($log); D("LogPush")->add($log);
} }
echo json_encode($result); echo json_encode($result);
exit;
} }
......
...@@ -64,8 +64,7 @@ class FrontAction extends Action ...@@ -64,8 +64,7 @@ class FrontAction extends Action
} }
echo json_encode($config); echo json_encode($config);
exit;
//输出
} }
...@@ -112,6 +111,7 @@ class FrontAction extends Action ...@@ -112,6 +111,7 @@ class FrontAction extends Action
$result["list"] = $list; $result["list"] = $list;
echo json_encode($result); echo json_encode($result);
exit;
} }
......
<?php
/**
* Created by PhpStorm.
* User: wuxiande
* Date: 2019/7/19
* Time: 16:36
*/
class GslbAction extends Action
{
/*
* 实时鉴权接口
* /api/gslb?spid=1&hotel_id=1&media_id=&others
*
* 1001, "arg error"
1002, "front conf error"
1003, "url expired"
1004, "sign arg error"
1005, "sign error"
1006, "no media"
*/
public function index(){
$spid=$_GET["spid"];
$hid=$_GET["hotel_id"];
$mcode=$_GET["media_id"];
$sw_time=$_GET["sw_time"];
$sw_sign=$_GET["sw_sign"];
$result["code"]=1;
$result["msg"]="err";
/* 分前端鉴权(暂时不用)
$sql="SELECT virtual_ip,port FROM sh_hotel_device WHERE hotel_id=1 AND type=0;";
$frontArr = M("")->query($sql);
if (empty($frontArr)){
$result["code"]=1002;
$result["msg"]="front conf error";
}
*/
$sql="SELECT mw.id,mw.code,mw.url_play,hm.status,hm.status_inject"
." FROM sh_hotel_media_map_$spid hm,sh_media_wasu mw"
." WHERE mw.code='$mcode' AND hm.hotel_id=$hid AND hm.media_id=mw.id;";
$arr = M("")->query($sql);
if (empty($arr)){
$result["code"]=1006;
$result["msg"]="no media";
}else{
$result["code"]=0;
$result["msg"]="ok";
$result["media"]=$arr[0];
}
echo json_encode($result);
exit;
}
}
\ No newline at end of file
...@@ -84,6 +84,7 @@ class MonitorAction extends Action ...@@ -84,6 +84,7 @@ class MonitorAction extends Action
echo json_encode($Devices); echo json_encode($Devices);
exit;
} }
...@@ -153,6 +154,7 @@ class MonitorAction extends Action ...@@ -153,6 +154,7 @@ class MonitorAction extends Action
$e["错误"] = "找不到该设备!"; $e["错误"] = "找不到该设备!";
echo json_encode($e); echo json_encode($e);
} }
exit;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment