You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
<?php
|
|
|
|
namespace task\tasks;
|
|
include 'Base.php';
|
|
class LibLease extends Base
|
|
{
|
|
public function run()
|
|
{
|
|
|
|
$config = $this->config('api_config');
|
|
$url = 'http://10.99.57.79:9999/SSBusiness/monitor/getLibraryService?library=044007';
|
|
$result = $this->get_data($url,'balib','Ba2015lib');
|
|
$result_data = json_decode($result,true);
|
|
|
|
if ($result_data['success'] != 1) return '失败';
|
|
$content = $result_data['content'];
|
|
if (!$content) return '数据不存在';
|
|
|
|
$requestData = [
|
|
[
|
|
'library' => $result_data['library'],
|
|
'newreader' => $content['newreader'],
|
|
'servcount' => $content['servcount'],
|
|
'returncount' => $content['returncount']
|
|
]
|
|
];
|
|
$requestRes = $this->request_create_data($requestData,'/api/library.pass/createLibraryLease',$config['host_path'],true);
|
|
|
|
if (!$requestRes['status']) return $requestRes['msg'];
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|
|
$lib = new LibLease();
|
|
echo $lib->run();
|
|
|