mirror of
https://github.com/fghrsh/live2d_api.git
synced 2024-11-30 07:06:50 +08:00
20 lines
604 B
PHP
20 lines
604 B
PHP
<?php
|
|
isset($_GET['id']) ? $modelId = (int)$_GET['id'] : exit('error');
|
|
|
|
require '../tools/modelList.php';
|
|
require '../tools/jsonCompatible.php';
|
|
|
|
$modelList = new modelList();
|
|
$jsonCompatible = new jsonCompatible();
|
|
|
|
$modelList = $modelList->get_list();
|
|
$modelSwitchId = $modelId + 1;
|
|
if (!isset($modelList['models'][$modelSwitchId-1])) $modelSwitchId = 1;
|
|
|
|
header("Content-type: application/json");
|
|
echo $jsonCompatible->json_encode(array('model' => array(
|
|
'id' => $modelSwitchId,
|
|
'name' => $modelList['models'][$modelSwitchId-1],
|
|
'message' => $modelList['messages'][$modelSwitchId-1]
|
|
)));
|