update production

This commit is contained in:
Fred 2020-10-27 08:06:31 +08:00
parent 7cd6339996
commit 8c3c022f0c
2 changed files with 8 additions and 7 deletions

View File

@ -8,17 +8,15 @@ class APIgoatDoc extends APIgoatTemplate
$content = ''; $content = '';
$menu = ''; $menu = '';
//preprint($data);
foreach ($data as $row) { foreach ($data as $row) {
$menu .= li(href($row['name'], '#' . $row['title']), "class='page_item current_page_item'"); $menu .= li(href($row['name'], '#' . $row['title']), "class='page_item current_page_item'");
$content .= div( $content .= div(
anchor($row['title']) . h3($row['name']) anchor($row['title']) . h3($row['name'])
. h2($row['title'], "class='entry-title'") . h2($row['title'], "class='entry-title'")
. p($row['type'] . " " . $row['value']) . span($row['type'] . " " . $row['value'])
. ((!empty($row['example'])) ? pre(htmlentities($row['example'])) : '')
. p(trim($row['text'])) . p(trim($row['text']))
. ((!empty($row['example'])) ? div(span("Example:") . pre(htmlentities($row['example']))) : '')
); );
} }

View File

@ -23,7 +23,8 @@ class APIgoatFetchAPI
$this->clientOptions = [ $this->clientOptions = [
'verify' => false, 'verify' => false,
'content-Type' => 'application/json', 'content-Type' => 'application/json',
'accept' => 'application/json' 'accept' => 'application/json',
'debug' => false
]; ];
if (!$this->authenticationValid()) { if (!$this->authenticationValid()) {
@ -40,7 +41,7 @@ class APIgoatFetchAPI
{ {
$clientOptions = $this->clientOptions; $clientOptions = $this->clientOptions;
$clientOptions['query'] = [ $clientOptions['query'] = [
"Query" => [ "query" => [
"select" => [ "select" => [
["behavior.name", "name"], ["code", "title"], ["description", "text"], "value", "example", "type", ["behavior_category.name", "category_name"] ["behavior.name", "name"], ["code", "title"], ["description", "text"], "value", "example", "type", ["behavior_category.name", "category_name"]
], ],
@ -51,7 +52,8 @@ class APIgoatFetchAPI
] ]
], ],
"join" => ["behavior_category"], "join" => ["behavior_category"],
"limit" => 20 "limit" => 20,
"recurse" => "behavior_file"
], ],
"debug" => true "debug" => true
]; ];
@ -59,6 +61,7 @@ class APIgoatFetchAPI
$response = $this->client->get('Behavior', $clientOptions); $response = $this->client->get('Behavior', $clientOptions);
$body = json_decode($response->getBody()->getContents(), true); $body = json_decode($response->getBody()->getContents(), true);
if ($response->getStatusCode() == 200) { if ($response->getStatusCode() == 200) {
return $body; return $body;