* Fix list of entry points.
This commit is contained in:
@@ -17,12 +17,13 @@ class bugsEntry extends entry
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$bugs = $data->data->bugs;
|
||||
$pager = $data->data->pager;
|
||||
$result = array();
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
$result[] = $bug;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => $result));
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
|
||||
@@ -14,7 +14,11 @@ class executionsEntry extends entry
|
||||
$control->all($this->param('status', 'all'), $this->param('project', $projectID));
|
||||
$data = $this->getData();
|
||||
|
||||
if(isset($data->status) and $data->status == 'success') return $this->send(200, $data->data->executionStats);
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$pager = $data->data->pager;
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'executions' => $data->data->executionStats));
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
|
||||
return $this->sendError(400, 'error');
|
||||
|
||||
@@ -12,11 +12,12 @@ class productsEntry extends entry
|
||||
{
|
||||
$control = $this->loadController('product', 'all');
|
||||
$control->all();
|
||||
$data = $this->getData();
|
||||
$data = $this->getData();
|
||||
$pager = $data->data->pager;
|
||||
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
return $this->send(200, $data->data->productStats);
|
||||
return $this->send(200, array('products' => $data->data->productStats));
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* 禅道API的program资源类
|
||||
* 版本V1
|
||||
*
|
||||
* The program entry point of zentaopms
|
||||
* Version 1
|
||||
*/
|
||||
class ProgramEntry extends Entry
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* 禅道API的programs资源类
|
||||
* 版本V1
|
||||
*
|
||||
* The programs entry point of zentaopms
|
||||
* Version 1
|
||||
*/
|
||||
class ProgramsEntry extends Entry
|
||||
{
|
||||
public function get()
|
||||
@@ -15,7 +22,7 @@ class ProgramsEntry extends Entry
|
||||
{
|
||||
$result[] = $program;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
return $this->send(200, array('programs' => $result));
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
|
||||
@@ -16,7 +16,8 @@ class projectsEntry extends entry
|
||||
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
return $this->send(200, $data->data->projectStats);
|
||||
$pager = $data->data->pager;
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'projects' => $data->data->projectStats));
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
|
||||
@@ -17,13 +17,15 @@ class storiesEntry extends entry
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$stories = $data->data->stories;
|
||||
$pager = $data->data->pager;
|
||||
$result = array();
|
||||
foreach($stories as $story)
|
||||
{
|
||||
$result[] = $story;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
|
||||
}
|
||||
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
return $this->sendError(400, $data->message);
|
||||
|
||||
@@ -17,12 +17,13 @@ class tasksEntry extends entry
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$tasks = $data->data->tasks;
|
||||
$pager = $data->data->pager;
|
||||
$result = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
$result[] = $task;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'tasks' => $result));
|
||||
}
|
||||
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
|
||||
@@ -17,18 +17,14 @@ class usersEntry extends entry
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$users = $data->data->users;
|
||||
$pager = $data->data->pager;
|
||||
$result = array();
|
||||
foreach($users as $user)
|
||||
{
|
||||
$result[] = $user;
|
||||
}
|
||||
return $this->send(200, $result);
|
||||
}
|
||||
if(isset($data->status) and $data->status == 'fail')
|
||||
{
|
||||
return $this->sendError(400, $data->message);
|
||||
foreach($users as $user) $result[] = $user;
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'users' => $result));
|
||||
}
|
||||
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
|
||||
return $this->sendError(400, 'error');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user