From 84a7e1ad4ce82c6ff7c1d2cf9e07256ae15412ed Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 18 Mar 2022 14:14:10 +0800 Subject: [PATCH] *PUT->POST. --- api/v1/entries/storyactive.php | 8 +++--- api/v1/entries/storyassignto.php | 4 +-- api/v1/entries/storyclose.php | 4 +-- api/v1/entries/storyrecordestimate.php | 39 -------------------------- api/v1/entries/taskclose.php | 4 +-- api/v1/entries/taskfinish.php | 4 +-- api/v1/entries/taskpause.php | 4 +-- api/v1/entries/taskstart.php | 4 +-- 8 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 api/v1/entries/storyrecordestimate.php diff --git a/api/v1/entries/storyactive.php b/api/v1/entries/storyactive.php index cfaf4145bd..d5d6189f55 100644 --- a/api/v1/entries/storyactive.php +++ b/api/v1/entries/storyactive.php @@ -12,15 +12,15 @@ class storyActiveEntry extends Entry { - /** + /** * POST method. * * @param int $storyID * @access public * @return void */ - public function put($storyID) - { + public function post($storyID) + { $oldStory = $this->loadModel('story')->getByID($storyID); $fields = 'assignedTo,status,comment'; @@ -37,6 +37,6 @@ class storyActiveEntry extends Entry $story = $this->loadModel('story')->getByID($storyID); $this->send(200, $story); - } + } } diff --git a/api/v1/entries/storyassignto.php b/api/v1/entries/storyassignto.php index f6869b59f4..0b3477a1ee 100644 --- a/api/v1/entries/storyassignto.php +++ b/api/v1/entries/storyassignto.php @@ -12,13 +12,13 @@ class storyAssignToEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $storyID * @access public * @return void */ - public function put($storyID) + public function post($storyID) { $task = $this->loadModel('story')->getByID($storyID); diff --git a/api/v1/entries/storyclose.php b/api/v1/entries/storyclose.php index 1f6057178d..a83948232e 100644 --- a/api/v1/entries/storyclose.php +++ b/api/v1/entries/storyclose.php @@ -12,13 +12,13 @@ class storyCloseEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $storyID * @access public * @return void */ - public function put($storyID) + public function post($storyID) { $story = $this->loadModel('story')->getByID($storyID); diff --git a/api/v1/entries/storyrecordestimate.php b/api/v1/entries/storyrecordestimate.php deleted file mode 100644 index 389ede8726..0000000000 --- a/api/v1/entries/storyrecordestimate.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @package entries - * @version 1 - * @link http://www.zentao.net - */ -class storyRecordEstimateEntry extends Entry -{ - /** - * POST method. - * - * @param int $storyID - * @access public - * @return void - */ - public function post($storyID) - { - $story = $this->loadModel('story')->getByID($storyID); - - $fields = 'closedReason,duplicateStory,childStories,comment'; - $this->batchSetPost($fields); - - $control = $this->loadController('story', 'close'); - $control->close($storyID); - - $data = $this->getData(); - if(!$data) return $this->send400('error'); - if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - - $story = $this->story->getByID($storyID); - - $this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList')); - } -} diff --git a/api/v1/entries/taskclose.php b/api/v1/entries/taskclose.php index da57db1ec8..774c115c53 100644 --- a/api/v1/entries/taskclose.php +++ b/api/v1/entries/taskclose.php @@ -12,13 +12,13 @@ class taskCloseEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $taskID * @access public * @return void */ - public function put($taskID) + public function post($taskID) { $task = $this->loadModel('task')->getByID($taskID); diff --git a/api/v1/entries/taskfinish.php b/api/v1/entries/taskfinish.php index 564b037bae..2c12a46cc6 100644 --- a/api/v1/entries/taskfinish.php +++ b/api/v1/entries/taskfinish.php @@ -12,13 +12,13 @@ class taskFinishEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $taskID * @access public * @return void */ - public function put($taskID) + public function post($taskID) { $task = $this->loadModel('task')->getByID($taskID); diff --git a/api/v1/entries/taskpause.php b/api/v1/entries/taskpause.php index 438785b5f2..7548fa25e0 100644 --- a/api/v1/entries/taskpause.php +++ b/api/v1/entries/taskpause.php @@ -12,13 +12,13 @@ class taskPauseEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $taskID * @access public * @return void */ - public function put($taskID) + public function post($taskID) { $task = $this->loadModel('task')->getByID($taskID); diff --git a/api/v1/entries/taskstart.php b/api/v1/entries/taskstart.php index 8a041bb377..d21d4bb37a 100644 --- a/api/v1/entries/taskstart.php +++ b/api/v1/entries/taskstart.php @@ -12,13 +12,13 @@ class taskStartEntry extends Entry { /** - * PUT method. + * POST method. * * @param int $taskID * @access public * @return void */ - public function put($taskID) + public function post($taskID) { $task = $this->loadModel('task')->getByID($taskID);