예제 #1
0
 /**
  *
  * @SWG\Delete(
  *     path="/clean/temperature/{id}",
  *     summary="Deletes the specified temperature. Requires authentication.",
  *     @SWG\Response(response="204", description="Temperature was successfully deleted."),
  *
  * )
  * @SWG\Delete(
  *     path="/clean/action/{id}",
  *     summary="Deletes the specified action. Requires authentication.",
  *     @SWG\Response(response="204", description="Action was successfully deleted"),
  *
  * )
  *
  */
 public function actionDelete($resource, $id)
 {
     $auth = $this->authenticate();
     $this->logAction($auth->getId(), "DELETE /clean/" . $resource . "/" . $id);
     if (strtolower($resource) == "temperature") {
         $model = new TemperatureModel($this->context->getService('database.default.context'));
         $model->delete($id);
     }
     if (strtolower($resource) == "login") {
         $model = new ActionModel($this->context->getService('database.default.context'));
         $model->delete($id);
     }
 }
예제 #2
0
 public function logAction($userId, $action)
 {
     $model = new Model\ActionModel($this->context->getService('database.default.context'));
     $model->logAction($userId, $this->getIpAddressId(), $action);
 }