package de.tum.in.www1.artemis.web.rest;

import java.time.Instant;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TimeResource {

    /**
     * {@code GET /time}:
     * @return the current server time as Instant
     */
    @GetMapping(value = "/time", produces = MediaType.TEXT_PLAIN_VALUE)
    public String time() {
        return Instant.now().toString();
    }
}

package de.tum.in.www1.artemis.web.rest;

import java.time.Instant;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TimeResource {

    /**
     * {@code GET /time}:
     * @return the current server time as Instant
     */
    @GetMapping("/time")
    public ResponseEntity<Instant> time() {
        return ResponseEntity.ok(Instant.now());
    }
}

Fix "/time" not returning JSON string
Fix "/time" not returning JSON string

Signed-off-by: Jan Philip Bernius <814ff5be9e22112ef64fe4fffd286a913b75a514@tum.de>
