麒麟线路表
This commit is contained in:
353
extends/jinyouapi/Jinyou.php
Normal file
353
extends/jinyouapi/Jinyou.php
Normal file
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/**
|
||||
* 伽莱网络开放平台 SDK
|
||||
* @version 1.6.1 发布日期:2023-02-08 17:30
|
||||
* @copyright 2023 ip6b.com
|
||||
* APPID:49330ae23dad78f9
|
||||
*APPKEY:ddb4311a227fb118cacd63cc68416ab5
|
||||
*
|
||||
*/
|
||||
namespace extend\jinyouapi;
|
||||
/**
|
||||
* 通信编码协定 UTF-8
|
||||
*/
|
||||
|
||||
class jinyou{
|
||||
private static $ServerUrl="https://www.ip6b.com/openapi/";
|
||||
/**
|
||||
* 通信方法
|
||||
*/
|
||||
private static function send_post($method, $post_data)
|
||||
{
|
||||
$post_data=self::signAct($post_data);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, self::$ServerUrl.$method);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response= curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $response;
|
||||
}
|
||||
/**
|
||||
* key排序签名
|
||||
*/
|
||||
private static function signAct($body)
|
||||
{
|
||||
$authStr="";
|
||||
$body["st"]=time();
|
||||
$body["appid"]="49330ae23dad78f9";
|
||||
ksort($body);
|
||||
foreach ($body as $item)
|
||||
{
|
||||
if(!is_object($item))
|
||||
$authStr=$authStr.$item;
|
||||
}
|
||||
|
||||
$body["sign"]=md5(md5($authStr)."ddb4311a227fb118cacd63cc68416ab5");
|
||||
return $body;
|
||||
}
|
||||
/**
|
||||
* 获取当前账户的可用余额
|
||||
* @return @json
|
||||
*/
|
||||
public static function getMyPoint()
|
||||
{
|
||||
$res=self::send_post('Get_MyPoint', []);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* 获取所有动态服务器列表
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicLine($type=3)
|
||||
{
|
||||
$post_data = array(
|
||||
'type'=>$type,
|
||||
);
|
||||
$res=self::send_post('Get_Dynamic_Line',$post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 获取动态用户列表
|
||||
* @param $page *当前分页
|
||||
* @param $page_count *分页条目数 1-100
|
||||
* @param $t_id @接入方客户唯一值UID用于查询客户账号列表、0或缺省则查询当前应用下全部客户账号,非必填字段
|
||||
* @param $user @根据账号名称查询账号信息,非必填字段
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicAccount($page,$page_count,$t_id=0,$user="")
|
||||
{
|
||||
$post_data = array(
|
||||
't_id'=>$t_id,
|
||||
'user'=>$user,
|
||||
'page'=>$page,
|
||||
'page_count'=>$page_count,
|
||||
);
|
||||
$res=self::send_post('Get_Dynamic_Account', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 创建动态账号
|
||||
* @param $width *订购带宽 1-20 单位 Mbps
|
||||
* @param $meal *订购套餐 1-5 分别为 天卡、周卡、月卡、季卡、年卡,31为2小时测试卡,每个用户只允许开通一次
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @param $password *拨号密码 6-20位字符串
|
||||
* @param $conn_max *连接数(同账号可以在不同服务器中同时在线的数量)1-100
|
||||
* @param $t_id *接入方平台注册用户的唯一值,用于绑定客户账号
|
||||
* @return @json
|
||||
*/
|
||||
public static function createDynamic($width,$meal,$account,$password,$conn_max,$t_id)
|
||||
{
|
||||
$post_data = array(
|
||||
'width'=>$width,
|
||||
'combos'=>$meal,
|
||||
'account'=>$account,
|
||||
'password'=>$password,
|
||||
'conn_max'=>$conn_max,
|
||||
't_id'=>$t_id,
|
||||
);
|
||||
$res=self::send_post('Create_Dynamic', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 创建平台第三方接入账号
|
||||
* @param $phone *接入方平台用户注册手机号 同应用下手机号码不可重复
|
||||
* @param $cn_name *用户实名认证后的真实姓名
|
||||
* @param $cn_id *用户实名认证后的身份证号码
|
||||
* @param $t_id *接入方平台中客户唯一的身份标识,整型 数字范围1-999999999
|
||||
* @return @json
|
||||
*/
|
||||
public static function createUsers($phone,$cn_name,$cn_id,$t_id)
|
||||
{
|
||||
$post_data = array(
|
||||
'phone'=>$phone,
|
||||
'cn_name'=>$cn_name,
|
||||
'cn_id'=>$cn_id,
|
||||
't_id'=>$t_id,
|
||||
);
|
||||
$res=self::send_post('Create_Users', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 获取代理商基础定价
|
||||
* @param $width *订购带宽 1-20 单位 Mbps
|
||||
* @param $meal *订购套餐 1-5 分别为 天卡、周卡、月卡、季卡、年卡
|
||||
* @param $conn_max *连接数(同账号可以在不同服务器中同时在线的数量)1-100
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicPoint($width,$meal,$conn_max)
|
||||
{
|
||||
$post_data = array(
|
||||
'width'=>$width,
|
||||
'combos'=>$meal,
|
||||
'conn_max'=>$conn_max,
|
||||
);
|
||||
$res=self::send_post('Get_Dynamic_Point', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 续费动态账号
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @param $meal *订购套餐 1-5 分别为 天卡、周卡、月卡、季卡、年卡
|
||||
* @return @json
|
||||
*/
|
||||
public static function reNewDynamic($account,$meal)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
'combos'=>$meal,
|
||||
);
|
||||
$res=self::send_post('Renew_Dynamic', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 修改动态账户密码
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @param $password *新密码 6-20位字符串
|
||||
* @return @json
|
||||
*/
|
||||
public static function reSetDynamicPassword($account,$password)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
'password'=>$password,
|
||||
);
|
||||
$res=self::send_post('Reset_Password_Dynamic', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 获取动态服务器完整列表
|
||||
* @param $page *当前分页
|
||||
* @param $page_count *分页条目数 1-100
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicOnline($account,$page,$page_count)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
'page'=>$page,
|
||||
'page_count'=>$page_count,
|
||||
);
|
||||
$res=self::send_post('Get_Dynamic_Online', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 针对动态在线用户踢出下线
|
||||
* @param $sid *sid参数即为{getDynamicOnline}函数锁返回的在线ID,应为32位字符串。
|
||||
* @return @json
|
||||
*/
|
||||
public static function kickOffDynamicLine($sid)
|
||||
{
|
||||
$post_data = array(
|
||||
'sid'=>$sid,
|
||||
);
|
||||
$res=self::send_post('Kick_Off_Dynamic_Line', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 设置动态账号防火墙状态
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @param $status *防火墙状态:0关闭、1开启。
|
||||
* @return @json
|
||||
*/
|
||||
public static function setDynamicFirewallStatus($account,$status)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
'status'=>$status,
|
||||
);
|
||||
$res=self::send_post('Set_Dynamic_Firewall_Status', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 上传用户手持身份证照片
|
||||
* @param $t_id *接入方平台中客户唯一的身份标识,整型 数字范围1-999999999
|
||||
* @param $upload_img *上传图片文件,格式要求jpg格式,文件小于1MB。
|
||||
* @return @json
|
||||
*/
|
||||
public static function uploadExamine($t_id,$upload_img)
|
||||
{
|
||||
$post_data = array(
|
||||
't_id'=>$t_id,
|
||||
'upload_img'=>new \CURLFile($upload_img->getRealPath(),$upload_img->getOriginalMime(),$upload_img->getOriginalName()),
|
||||
);
|
||||
$res=self::send_post('Upload_Examine', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 上传用户手持身份证照片
|
||||
* @param $t_id *接入方平台中客户唯一的身份标识,整型 数字范围1-999999999
|
||||
* @param $upload_imgurl *本地图片URL,格式要求jpg格式,文件小于1MB。
|
||||
* @return @json
|
||||
*/
|
||||
public static function uploadExamineFile($t_id,$upload_imgurl)
|
||||
{
|
||||
$post_data = array(
|
||||
't_id'=>$t_id,
|
||||
'upload_img'=>new \CURLFile($upload_imgurl,mime_content_type($upload_imgurl),basename($upload_imgurl)),
|
||||
);
|
||||
$res=self::send_post('Upload_Examine', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
public static function uploadExaminePrepare($t_id,$upload_imgurl)
|
||||
{
|
||||
$post_data = array(
|
||||
't_id'=>$t_id,
|
||||
'upload_img'=>new \CURLFile($upload_imgurl,mime_content_type($upload_imgurl),basename($upload_imgurl)),
|
||||
);
|
||||
$res=self::send_post('Upload_Examine_Prepare', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 查询第三方接入用户状态
|
||||
* @param $t_id *接入方平台中客户唯一的身份标识,整型 数字范围1-999999999
|
||||
* @return @json
|
||||
*/
|
||||
public static function examineStatus($t_id)
|
||||
{
|
||||
$post_data = array(
|
||||
't_id'=>$t_id,
|
||||
);
|
||||
$res=self::send_post('Examine_Status', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 查询第三方接入用户状态
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @return @json
|
||||
*/
|
||||
public static function dynamicAccountExists($account)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
);
|
||||
$res=self::send_post('Dynamic_Account_Exists', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 变更静态账户出口指向
|
||||
* @param $account *拨号账号 6-20位字符串。
|
||||
* @param $ename *出口服务器名 1-20位字符串。
|
||||
* @param $pool *出口线路名 1-20位字符串。
|
||||
* @return @json
|
||||
*/
|
||||
public static function editStaticOut($account,$ename,$pool)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$account,
|
||||
'ename'=>$ename,
|
||||
'pool'=>$pool,
|
||||
);
|
||||
$res=self::send_post('Edit_Static_Out', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 获取指定城市的静态出口列表
|
||||
* @param $city *城市ID
|
||||
* @return @json
|
||||
*/
|
||||
public static function getStaticOut($city)
|
||||
{
|
||||
$post_data = array(
|
||||
'city'=>$city,
|
||||
);
|
||||
$res=self::send_post('Get_Static_Out', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 获取独立定价账户下的产品列表
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicProduct()
|
||||
{
|
||||
$res=self::send_post('Get_Dynamic_Product', []);
|
||||
return json_decode($res);
|
||||
}
|
||||
/**
|
||||
* * 获取独立定价账户下的产品列表所对应的带宽套餐
|
||||
* @return @json
|
||||
*/
|
||||
public static function getDynamicProductWidth($meal)
|
||||
{
|
||||
$post_data = array(
|
||||
'meal'=>$meal,
|
||||
);
|
||||
$res=self::send_post('Get_Dynamic_Product_Width', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
public static function getaccount($meal)
|
||||
{
|
||||
$post_data = array(
|
||||
'account'=>$meal,
|
||||
);
|
||||
$res=self::send_post('Dynamic_Account_Exists', $post_data);
|
||||
return json_decode($res);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
function auto_format_list(){
|
||||
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26];
|
||||
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26,27];
|
||||
foreach ($product_list as $product) {
|
||||
switch ($product) {
|
||||
case 0:
|
||||
@@ -62,6 +62,10 @@ function auto_format_list(){
|
||||
case 26:
|
||||
format_product(__DIR__ . '/data/liebao.csv','lbip.cc');
|
||||
break;
|
||||
|
||||
case 27:
|
||||
format_product(__DIR__ . '/data/qilin.csv','qlip.cc');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,6 +136,9 @@ function format_all_product($file_path)
|
||||
case '猎豹':
|
||||
$dns = 'lbip.cc';
|
||||
break;
|
||||
case 'qilin':
|
||||
$dns = 'qlip.cc';
|
||||
break;
|
||||
default:
|
||||
$dns = 'xlip.vip';
|
||||
break;
|
||||
|
||||
@@ -73,6 +73,9 @@ switch ($id) {
|
||||
case 26:
|
||||
get_product(__DIR__ . '/data/download/liebao.csv');
|
||||
break;
|
||||
case 27:
|
||||
get_product(__DIR__ . '/data/download/qilin.csv');
|
||||
break;
|
||||
}
|
||||
|
||||
function get_all_product($file_path)
|
||||
|
||||
@@ -5,28 +5,30 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-03 11:04:15
|
||||
* @LastEditors: “wanyongkang” “937888580@qq.com”
|
||||
* @LastEditTime: 2024-01-04 15:30:18
|
||||
* @LastEditTime: 2024-01-15 16:46:41
|
||||
*/
|
||||
|
||||
use extend\jinyouapi\jinyou;
|
||||
|
||||
$is_script = 1;
|
||||
include_once __DIR__ . '/../../index.php';
|
||||
include_once __DIR__ . '/auto_format.php';
|
||||
|
||||
// // //测试用----------------------------------------------------------------------------------------------------------
|
||||
// $dnx_has_exit = [];
|
||||
// $qilin = new jinyou;
|
||||
|
||||
// //先锋
|
||||
// $xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
|
||||
// $qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
|
||||
|
||||
|
||||
// if($xianfeng){
|
||||
// $xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv');
|
||||
// $xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w');
|
||||
// //写入先锋文件
|
||||
// xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
||||
// fclose($xianfeng_f);
|
||||
// if ($qilin_api_data) {
|
||||
// $qilin_data = get_product(__DIR__ . '/data/qilin.csv');
|
||||
// $qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
|
||||
// qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
|
||||
// fclose($qilin_f);
|
||||
// }
|
||||
// die;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
$dnx_has_exit = [];
|
||||
|
||||
//强子迅联特征码
|
||||
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
|
||||
|
||||
@@ -152,6 +154,19 @@ xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
|
||||
fclose($xianfeng_f);
|
||||
}
|
||||
|
||||
//麒麟动态
|
||||
$dnx_has_exit = [];
|
||||
$qilin = new jinyou;
|
||||
|
||||
$qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
|
||||
|
||||
if ($qilin_api_data) {
|
||||
$qilin_data = get_product(__DIR__ . '/data/qilin.csv');
|
||||
$qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
|
||||
qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
|
||||
fclose($qilin_f);
|
||||
}
|
||||
|
||||
|
||||
// $time = time();
|
||||
// $noce = md5(time());
|
||||
@@ -798,6 +813,72 @@ function mogu_getList($data, &$file, &$all )
|
||||
|
||||
}
|
||||
|
||||
//麒麟服务器解析规则
|
||||
function qilin_getList($data, &$file, &$all, $exit )
|
||||
{
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
$key = '';
|
||||
$list1 = [];
|
||||
|
||||
$province_record = [];
|
||||
|
||||
foreach ($data as $val) {
|
||||
$val = (array)$val;
|
||||
$record = [];
|
||||
$record['name'] = '麒麟';
|
||||
|
||||
$record['city'] = $val['info']->province_name;
|
||||
$province_record[] = $val['info']->province_name;
|
||||
|
||||
$key = $record['city'];
|
||||
$list1[$key][] = $record;
|
||||
|
||||
$record['city'] = $val['info']->province_name.'混拨';
|
||||
$record['supply'] = '';
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = '正常';
|
||||
$record['status'] = '';
|
||||
$record['nasname'] = $val['info']->province_domain;
|
||||
$list1[$key][] = $record;
|
||||
|
||||
foreach($val['line'] as $city_info) {
|
||||
$city_info = (array)$city_info;
|
||||
|
||||
$record['city'] = $city_info['city_name'];
|
||||
$record['supply'] = $city_info['isp'];
|
||||
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = $city_info['status'] ? '正常' : '故障';
|
||||
$record['status'] = '';
|
||||
$record['nasname'] = $city_info['domain'];
|
||||
$list1[$key][] = $record;
|
||||
|
||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
||||
fputcsv($dnx_exit, [$record['name'], explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach ($list1 as $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
fputcsv($file, $net_data);
|
||||
fputcsv($all, $net_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function laoying_getList($list, &$file, &$all, $exit)
|
||||
{
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-07 11:13:08
|
||||
* @LastEditors: “wanyongkang” “937888580@qq.com”
|
||||
* @LastEditTime: 2023-05-14 17:33:46
|
||||
* @LastEditTime: 2024-01-12 10:45:00
|
||||
*/
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header("Access-Control-Allow-Methods: *");
|
||||
@@ -75,6 +75,9 @@ if($_GET['type'] == 1){
|
||||
case 26:
|
||||
search_product(__DIR__ . '/data/download/liebao.csv','lbip.cc');
|
||||
break;
|
||||
case 27:
|
||||
search_product(__DIR__ . '/data/download/qilin.csv','qlip.cc');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +157,9 @@ function search_all_product($file_path,$search){
|
||||
case '猎豹':
|
||||
$dns = 'lbip.cc';
|
||||
break;
|
||||
case '麒麟':
|
||||
$dns = 'qlip.cc';
|
||||
break;
|
||||
}
|
||||
|
||||
$data['city'] = $info[1];
|
||||
|
||||
Reference in New Issue
Block a user