<?php

$app->group('/comment', function () use($app) {
    $user = new \Model\User();
    $comment = new \Model\Comment();
    $app->get('/', function () use($app, $comment) {
        try {
            $result = $comment->getAll();
            jsonSuccess($app, array('comments' => $result));
        } catch (Exception $e) {
            jsonError($app, $e);
        }
    });
    $app->get('/marker/:id', function ($id) use($app, $comment) {
        try {
            $result = $comment->getByMarker($id);
            jsonSuccess($app, array('comments' => $result));
        } catch (Exception $e) {
            jsonError($app, $e);
        }
    });
    $app->get('/id/:id', function ($id) use($app, $comment) {
        try {
            $result = $comment->getByID($id);
            jsonSuccess($app, $result);
        } catch (Exception $e) {
            jsonError($app, $e);
        }
    });
    $app->get('/user/:id', function ($id) use($app, $comment) {
        try {