Skip to content

Commit

Permalink
Issue #116 9 (#246)
Browse files Browse the repository at this point in the history
* Добавил проверку с максимальным значением acr

* issue #116 Добавил тек. точку в лог
  • Loading branch information
iMega authored Jan 31, 2017
1 parent 4e741c7 commit 9155d08
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Kubikvest/Handler/Checkpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,20 @@ public function handle(Request $request)
$point = $pointBuilder->build($group->getPointId());

$response = new Resource\Checkpoint\Response($this->app);
$response->setPosition($position);
$response->setPoint($point);
$response->setQuest($quest);

$this->app['logger']->log(
\Psr\Log\LogLevel::INFO,
'Текущая точка',
[
'PointId' => $point->getPointId(),
'PointLat' => $point->getSector()->getLatitudeRange()->getMin() . " - " . $point->getSector()->getLatitudeRange()->getMax(),
'PointLng' => $point->getSector()->getLongitudeRange()->getMin() . " - " . $point->getSector()->getLongitudeRange()->getMax(),
]
);

$this->app['logger']->log(
\Psr\Log\LogLevel::INFO,
'Расстояния до точек',
Expand Down
4 changes: 4 additions & 0 deletions src/Kubikvest/Resource/Checkpoint/Respondent.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public function response()
'quest' => $this->response->getQuest(),
'point' => $this->response->getPoint(),
'error' => $this->response->error,
'coords' => [
'lat' => $this->response->getPosition()->getCoordinate()->getLatitude(),
'lng' => $this->response->getPosition()->getCoordinate()->getLongitude(),
],
];
$data['total_points'] = $data['quest']['total_points'];

Expand Down
18 changes: 18 additions & 0 deletions src/Kubikvest/Resource/Checkpoint/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use Kubikvest\Model\User;
use Kubikvest\Resource\Point\Model\Point;
use Kubikvest\Resource\Position\Model\Position;
use Kubikvest\Resource\Quest\Model\Quest;
use Silex\Application;

Expand All @@ -34,6 +35,7 @@ class Response
public $error = false;
protected $quest;
protected $point;
protected $position;
/**
* @var User
*/
Expand Down Expand Up @@ -127,4 +129,20 @@ public function getPoint()
{
return $this->point;
}

/**
* @return Position
*/
public function getPosition()
{
return $this->position;
}

/**
* @param Position $position
*/
public function setPosition($position)
{
$this->position = $position;
}
}

0 comments on commit 9155d08

Please sign in to comment.