Newer
Older
JerseyExercise / src / main / java / com / example / jerseyexercise / resources / EulerFormulaRest.java
package com.example.jerseyexercise.resources;

import org.springframework.stereotype.Component;

import javax.ws.rs.*;
import javax.ws.rs.core.*;

@Path("/EulerFormula")
@Component
public class EulerFormulaRest {
    private String message = "e^i(x) = cos(x) + i*sin(X)";

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getMessage() {
        return message;
    }

    @PUT
    @Produces(MediaType.TEXT_PLAIN)
    public String setMessage(@FormParam("message") String m) {
        message = m;
        return "Success!!";
    }
}